diff --git a/.gitignore b/.gitignore index 2a35621..92f7fde 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,14 @@ -vendor/ -composer.lock +# ref: https://github.com/github/gitignore/blob/master/Composer.gitignore + +composer.phar +/vendor/ + +# Commit your application's lock file https://getcomposer.org/doc/01-basic-usage.md#commit-your-composer-lock-file-to-version-control +# You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file +# composer.lock + +# php-cs-fixer cache .php_cs.cache + +# PHPUnit cache +.phpunit.result.cache diff --git a/.php_cs b/.php_cs index 5dacc36..4fbe53e 100644 --- a/.php_cs +++ b/.php_cs @@ -14,10 +14,6 @@ return PhpCsFixer\Config::create() 'braces' => false, 'single_blank_line_at_eof' => false, 'blank_line_after_namespace' => false, - 'single_quote' => true, - 'phpdoc_add_missing_param_annotation' => true, - 'no_empty_phpdoc' => true, - 'phpdoc_indent' => true, ]) ->setFinder( PhpCsFixer\Finder::create() diff --git a/MuxPhp/Api/AssetsApi.php b/MuxPhp/Api/AssetsApi.php index c72aebe..ef00ba8 100644 --- a/MuxPhp/Api/AssetsApi.php +++ b/MuxPhp/Api/AssetsApi.php @@ -1,8 +1,29 @@ client = $client ?: new Client(); $this->config = $config ?: new Configuration(); $this->headerSelector = $selector ?: new HeaderSelector(); - $this->hostIndex = $host_index; + $this->hostIndex = $hostIndex; } /** * Set the host index * - * @param int $host_index Host index (required) + * @param int $hostIndex Host index (required) */ - public function setHostIndex($host_index) + public function setHostIndex($hostIndex) { - $this->hostIndex = $host_index; + $this->hostIndex = $hostIndex; } /** * Get the host index * - * @return Host index + * @return int Host index */ public function getHostIndex() { @@ -97,7 +120,7 @@ public function getConfig() * * Create an asset * - * @param \MuxPhp\Models\CreateAssetRequest $create_asset_request (required) + * @param \MuxPhp\Models\CreateAssetRequest $create_asset_request create_asset_request (required) * * @throws \MuxPhp\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -133,7 +156,7 @@ public function createAssetWithHttpInfo($create_asset_request) "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } @@ -158,7 +181,7 @@ public function createAssetWithHttpInfo($create_asset_request) if ('\MuxPhp\Models\AssetResponse' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -173,7 +196,7 @@ public function createAssetWithHttpInfo($create_asset_request) if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -240,7 +263,7 @@ function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -274,7 +297,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function createAssetRequest($create_asset_request) + public function createAssetRequest($create_asset_request) { // verify the required parameter 'create_asset_request' is set if ($create_asset_request === null || (is_array($create_asset_request) && count($create_asset_request) === 0)) { @@ -293,11 +316,6 @@ protected function createAssetRequest($create_asset_request) - // body params - $_tempBody = null; - if (isset($create_asset_request)) { - $_tempBody = $create_asset_request; - } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -311,21 +329,23 @@ protected function createAssetRequest($create_asset_request) } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present + if (isset($create_asset_request)) { if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($create_asset_request)); } else { - $httpBody = $_tempBody; + $httpBody = $create_asset_request; } } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -341,7 +361,7 @@ protected function createAssetRequest($create_asset_request) // 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()); + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); } $defaultHeaders = []; @@ -355,11 +375,13 @@ protected function createAssetRequest($create_asset_request) $headers ); - $queryParamsDirect = join('&', $queryParams); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + + // MUX: adds support for array params. + // TODO: future upstream? + $query = ObjectSerializer::buildBetterQuery($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($queryParamsDirect ? "?{$queryParamsDirect}" : ''), + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -371,7 +393,7 @@ protected function createAssetRequest($create_asset_request) * Create a playback ID * * @param string $asset_id The asset ID. (required) - * @param \MuxPhp\Models\CreatePlaybackIDRequest $create_playback_id_request (required) + * @param \MuxPhp\Models\CreatePlaybackIDRequest $create_playback_id_request create_playback_id_request (required) * * @throws \MuxPhp\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -408,7 +430,7 @@ public function createAssetPlaybackIdWithHttpInfo($asset_id, $create_playback_id "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } @@ -433,7 +455,7 @@ public function createAssetPlaybackIdWithHttpInfo($asset_id, $create_playback_id if ('\MuxPhp\Models\CreatePlaybackIDResponse' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -448,7 +470,7 @@ public function createAssetPlaybackIdWithHttpInfo($asset_id, $create_playback_id if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -517,7 +539,7 @@ function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -552,7 +574,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function createAssetPlaybackIdRequest($asset_id, $create_playback_id_request) + public function createAssetPlaybackIdRequest($asset_id, $create_playback_id_request) { // verify the required parameter 'asset_id' is set if ($asset_id === null || (is_array($asset_id) && count($asset_id) === 0)) { @@ -585,11 +607,6 @@ protected function createAssetPlaybackIdRequest($asset_id, $create_playback_id_r ); } - // body params - $_tempBody = null; - if (isset($create_playback_id_request)) { - $_tempBody = $create_playback_id_request; - } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -603,21 +620,23 @@ protected function createAssetPlaybackIdRequest($asset_id, $create_playback_id_r } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present + if (isset($create_playback_id_request)) { if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($create_playback_id_request)); } else { - $httpBody = $_tempBody; + $httpBody = $create_playback_id_request; } } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -633,7 +652,7 @@ protected function createAssetPlaybackIdRequest($asset_id, $create_playback_id_r // 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()); + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); } $defaultHeaders = []; @@ -647,11 +666,13 @@ protected function createAssetPlaybackIdRequest($asset_id, $create_playback_id_r $headers ); - $queryParamsDirect = join('&', $queryParams); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + + // MUX: adds support for array params. + // TODO: future upstream? + $query = ObjectSerializer::buildBetterQuery($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($queryParamsDirect ? "?{$queryParamsDirect}" : ''), + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -663,7 +684,7 @@ protected function createAssetPlaybackIdRequest($asset_id, $create_playback_id_r * Create an asset track * * @param string $asset_id The asset ID. (required) - * @param \MuxPhp\Models\CreateTrackRequest $create_track_request (required) + * @param \MuxPhp\Models\CreateTrackRequest $create_track_request create_track_request (required) * * @throws \MuxPhp\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -700,7 +721,7 @@ public function createAssetTrackWithHttpInfo($asset_id, $create_track_request) "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } @@ -725,7 +746,7 @@ public function createAssetTrackWithHttpInfo($asset_id, $create_track_request) if ('\MuxPhp\Models\CreateTrackResponse' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -740,7 +761,7 @@ public function createAssetTrackWithHttpInfo($asset_id, $create_track_request) if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -809,7 +830,7 @@ function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -844,7 +865,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function createAssetTrackRequest($asset_id, $create_track_request) + public function createAssetTrackRequest($asset_id, $create_track_request) { // verify the required parameter 'asset_id' is set if ($asset_id === null || (is_array($asset_id) && count($asset_id) === 0)) { @@ -877,11 +898,6 @@ protected function createAssetTrackRequest($asset_id, $create_track_request) ); } - // body params - $_tempBody = null; - if (isset($create_track_request)) { - $_tempBody = $create_track_request; - } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -895,21 +911,23 @@ protected function createAssetTrackRequest($asset_id, $create_track_request) } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present + if (isset($create_track_request)) { if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($create_track_request)); } else { - $httpBody = $_tempBody; + $httpBody = $create_track_request; } } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -925,7 +943,7 @@ protected function createAssetTrackRequest($asset_id, $create_track_request) // 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()); + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); } $defaultHeaders = []; @@ -939,11 +957,13 @@ protected function createAssetTrackRequest($asset_id, $create_track_request) $headers ); - $queryParamsDirect = join('&', $queryParams); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + + // MUX: adds support for array params. + // TODO: future upstream? + $query = ObjectSerializer::buildBetterQuery($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($queryParamsDirect ? "?{$queryParamsDirect}" : ''), + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -989,7 +1009,7 @@ public function deleteAssetWithHttpInfo($asset_id) "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } @@ -1083,7 +1103,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function deleteAssetRequest($asset_id) + public function deleteAssetRequest($asset_id) { // verify the required parameter 'asset_id' is set if ($asset_id === null || (is_array($asset_id) && count($asset_id) === 0)) { @@ -1110,8 +1130,6 @@ protected function deleteAssetRequest($asset_id) ); } - // body params - $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -1125,21 +1143,17 @@ protected function deleteAssetRequest($asset_id) } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -1155,7 +1169,7 @@ protected function deleteAssetRequest($asset_id) // 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()); + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); } $defaultHeaders = []; @@ -1169,11 +1183,13 @@ protected function deleteAssetRequest($asset_id) $headers ); - $queryParamsDirect = join('&', $queryParams); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + + // MUX: adds support for array params. + // TODO: future upstream? + $query = ObjectSerializer::buildBetterQuery($queryParams); return new Request( 'DELETE', - $this->config->getHost() . $resourcePath . ($queryParamsDirect ? "?{$queryParamsDirect}" : ''), + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1221,7 +1237,7 @@ public function deleteAssetPlaybackIdWithHttpInfo($asset_id, $playback_id) "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } @@ -1318,7 +1334,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function deleteAssetPlaybackIdRequest($asset_id, $playback_id) + public function deleteAssetPlaybackIdRequest($asset_id, $playback_id) { // verify the required parameter 'asset_id' is set if ($asset_id === null || (is_array($asset_id) && count($asset_id) === 0)) { @@ -1359,8 +1375,6 @@ protected function deleteAssetPlaybackIdRequest($asset_id, $playback_id) ); } - // body params - $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -1374,21 +1388,17 @@ protected function deleteAssetPlaybackIdRequest($asset_id, $playback_id) } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -1404,7 +1414,7 @@ protected function deleteAssetPlaybackIdRequest($asset_id, $playback_id) // 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()); + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); } $defaultHeaders = []; @@ -1418,11 +1428,13 @@ protected function deleteAssetPlaybackIdRequest($asset_id, $playback_id) $headers ); - $queryParamsDirect = join('&', $queryParams); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + + // MUX: adds support for array params. + // TODO: future upstream? + $query = ObjectSerializer::buildBetterQuery($queryParams); return new Request( 'DELETE', - $this->config->getHost() . $resourcePath . ($queryParamsDirect ? "?{$queryParamsDirect}" : ''), + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1470,7 +1482,7 @@ public function deleteAssetTrackWithHttpInfo($asset_id, $track_id) "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } @@ -1567,7 +1579,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function deleteAssetTrackRequest($asset_id, $track_id) + public function deleteAssetTrackRequest($asset_id, $track_id) { // verify the required parameter 'asset_id' is set if ($asset_id === null || (is_array($asset_id) && count($asset_id) === 0)) { @@ -1608,8 +1620,6 @@ protected function deleteAssetTrackRequest($asset_id, $track_id) ); } - // body params - $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -1623,21 +1633,17 @@ protected function deleteAssetTrackRequest($asset_id, $track_id) } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -1653,7 +1659,7 @@ protected function deleteAssetTrackRequest($asset_id, $track_id) // 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()); + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); } $defaultHeaders = []; @@ -1667,11 +1673,13 @@ protected function deleteAssetTrackRequest($asset_id, $track_id) $headers ); - $queryParamsDirect = join('&', $queryParams); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + + // MUX: adds support for array params. + // TODO: future upstream? + $query = ObjectSerializer::buildBetterQuery($queryParams); return new Request( 'DELETE', - $this->config->getHost() . $resourcePath . ($queryParamsDirect ? "?{$queryParamsDirect}" : ''), + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1718,7 +1726,7 @@ public function getAssetWithHttpInfo($asset_id) "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } @@ -1743,7 +1751,7 @@ public function getAssetWithHttpInfo($asset_id) if ('\MuxPhp\Models\AssetResponse' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -1758,7 +1766,7 @@ public function getAssetWithHttpInfo($asset_id) if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -1825,7 +1833,7 @@ function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -1859,7 +1867,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getAssetRequest($asset_id) + public function getAssetRequest($asset_id) { // verify the required parameter 'asset_id' is set if ($asset_id === null || (is_array($asset_id) && count($asset_id) === 0)) { @@ -1886,8 +1894,6 @@ protected function getAssetRequest($asset_id) ); } - // body params - $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -1901,21 +1907,17 @@ protected function getAssetRequest($asset_id) } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -1931,7 +1933,7 @@ protected function getAssetRequest($asset_id) // 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()); + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); } $defaultHeaders = []; @@ -1945,11 +1947,13 @@ protected function getAssetRequest($asset_id) $headers ); - $queryParamsDirect = join('&', $queryParams); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + + // MUX: adds support for array params. + // TODO: future upstream? + $query = ObjectSerializer::buildBetterQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($queryParamsDirect ? "?{$queryParamsDirect}" : ''), + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1996,7 +2000,7 @@ public function getAssetInputInfoWithHttpInfo($asset_id) "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } @@ -2021,7 +2025,7 @@ public function getAssetInputInfoWithHttpInfo($asset_id) if ('\MuxPhp\Models\GetAssetInputInfoResponse' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -2036,7 +2040,7 @@ public function getAssetInputInfoWithHttpInfo($asset_id) if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -2103,7 +2107,7 @@ function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -2137,7 +2141,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getAssetInputInfoRequest($asset_id) + public function getAssetInputInfoRequest($asset_id) { // verify the required parameter 'asset_id' is set if ($asset_id === null || (is_array($asset_id) && count($asset_id) === 0)) { @@ -2164,8 +2168,6 @@ protected function getAssetInputInfoRequest($asset_id) ); } - // body params - $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -2179,21 +2181,17 @@ protected function getAssetInputInfoRequest($asset_id) } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -2209,7 +2207,7 @@ protected function getAssetInputInfoRequest($asset_id) // 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()); + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); } $defaultHeaders = []; @@ -2223,11 +2221,13 @@ protected function getAssetInputInfoRequest($asset_id) $headers ); - $queryParamsDirect = join('&', $queryParams); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + + // MUX: adds support for array params. + // TODO: future upstream? + $query = ObjectSerializer::buildBetterQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($queryParamsDirect ? "?{$queryParamsDirect}" : ''), + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -2276,7 +2276,7 @@ public function getAssetPlaybackIdWithHttpInfo($asset_id, $playback_id) "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } @@ -2301,7 +2301,7 @@ public function getAssetPlaybackIdWithHttpInfo($asset_id, $playback_id) if ('\MuxPhp\Models\GetAssetPlaybackIDResponse' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -2316,7 +2316,7 @@ public function getAssetPlaybackIdWithHttpInfo($asset_id, $playback_id) if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -2385,7 +2385,7 @@ function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -2420,7 +2420,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getAssetPlaybackIdRequest($asset_id, $playback_id) + public function getAssetPlaybackIdRequest($asset_id, $playback_id) { // verify the required parameter 'asset_id' is set if ($asset_id === null || (is_array($asset_id) && count($asset_id) === 0)) { @@ -2461,8 +2461,6 @@ protected function getAssetPlaybackIdRequest($asset_id, $playback_id) ); } - // body params - $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -2476,21 +2474,17 @@ protected function getAssetPlaybackIdRequest($asset_id, $playback_id) } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -2506,7 +2500,7 @@ protected function getAssetPlaybackIdRequest($asset_id, $playback_id) // 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()); + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); } $defaultHeaders = []; @@ -2520,11 +2514,13 @@ protected function getAssetPlaybackIdRequest($asset_id, $playback_id) $headers ); - $queryParamsDirect = join('&', $queryParams); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + + // MUX: adds support for array params. + // TODO: future upstream? + $query = ObjectSerializer::buildBetterQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($queryParamsDirect ? "?{$queryParamsDirect}" : ''), + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -2535,17 +2531,16 @@ protected function getAssetPlaybackIdRequest($asset_id, $playback_id) * * List assets * - * @param mixed[] $optionalParams An associative array of optional parameters which can be passed to this function: - * - 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) + * @param int $limit Number of items to include in the response (optional, default to 25) + * @param int $page Offset by this many pages, of the size of `limit` (optional, default to 1) * * @throws \MuxPhp\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \MuxPhp\Models\ListAssetsResponse */ - public function listAssets($optionalParams = []) + public function listAssets($limit = 25, $page = 1) { - list($response) = $this->listAssetsWithHttpInfo($optionalParams); + list($response) = $this->listAssetsWithHttpInfo($limit, $page); return $response; } @@ -2554,17 +2549,16 @@ public function listAssets($optionalParams = []) * * List assets * - * @param mixed[] $optionalParams An associative array of optional parameters which can be passed to this function: - * - 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) + * @param int $limit Number of items to include in the response (optional, default to 25) + * @param int $page Offset by this many pages, of the size of `limit` (optional, default to 1) * * @throws \MuxPhp\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \MuxPhp\Models\ListAssetsResponse, HTTP status code, HTTP response headers (array of strings) */ - public function listAssetsWithHttpInfo($optionalParams = []) + public function listAssetsWithHttpInfo($limit = 25, $page = 1) { - $request = $this->listAssetsRequest($optionalParams); + $request = $this->listAssetsRequest($limit, $page); try { $options = $this->createHttpClientOption(); @@ -2575,7 +2569,7 @@ public function listAssetsWithHttpInfo($optionalParams = []) "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } @@ -2600,7 +2594,7 @@ public function listAssetsWithHttpInfo($optionalParams = []) if ('\MuxPhp\Models\ListAssetsResponse' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -2615,7 +2609,7 @@ public function listAssetsWithHttpInfo($optionalParams = []) if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -2644,16 +2638,15 @@ public function listAssetsWithHttpInfo($optionalParams = []) * * List assets * - * @param mixed[] $optionalParams An associative array of optional parameters which can be passed to this function: - * - 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) + * @param int $limit Number of items to include in the response (optional, default to 25) + * @param int $page Offset by this many pages, of the size of `limit` (optional, default to 1) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function listAssetsAsync($optionalParams = []) + public function listAssetsAsync($limit = 25, $page = 1) { - return $this->listAssetsAsyncWithHttpInfo($optionalParams) + return $this->listAssetsAsyncWithHttpInfo($limit, $page) ->then( function ($response) { return $response[0]; @@ -2666,17 +2659,16 @@ function ($response) { * * List assets * - * @param mixed[] $optionalParams An associative array of optional parameters which can be passed to this function: - * - 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) + * @param int $limit Number of items to include in the response (optional, default to 25) + * @param int $page Offset by this many pages, of the size of `limit` (optional, default to 1) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function listAssetsAsyncWithHttpInfo($optionalParams = []) + public function listAssetsAsyncWithHttpInfo($limit = 25, $page = 1) { $returnType = '\MuxPhp\Models\ListAssetsResponse'; - $request = $this->listAssetsRequest($optionalParams); + $request = $this->listAssetsRequest($limit, $page); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2686,7 +2678,7 @@ function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -2715,18 +2707,14 @@ function ($exception) { /** * Create request for operation 'listAssets' * - * @param mixed[] $optionalParams An associative array of optional parameters which can be passed to this function: - * - 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) + * @param int $limit Number of items to include in the response (optional, default to 25) + * @param int $page Offset by this many pages, of the size of `limit` (optional, default to 1) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function listAssetsRequest($optionalParams) + public function listAssetsRequest($limit = 25, $page = 1) { - // Pull the set optional params from the associative array $optionalParams, setting them to their defaults if they're not set. - $limit = array_key_exists('limit', $optionalParams) ? $optionalParams['limit'] : 25; - $page = array_key_exists('page', $optionalParams) ? $optionalParams['page'] : 1; $resourcePath = '/video/v1/assets'; $formParams = []; @@ -2737,17 +2725,29 @@ protected function listAssetsRequest($optionalParams) // Query Param: limit if ($limit !== null) { - array_push($queryParams, 'limit=' . ObjectSerializer::toQueryValue($limit)); + if('form' === 'form' && is_array($limit)) { + foreach($limit as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['limit'] = $limit; + } } // Query Param: page if ($page !== null) { - array_push($queryParams, 'page=' . ObjectSerializer::toQueryValue($page)); + if('form' === 'form' && is_array($page)) { + foreach($page as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['page'] = $page; + } } - // body params - $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -2761,21 +2761,17 @@ protected function listAssetsRequest($optionalParams) } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -2791,7 +2787,7 @@ protected function listAssetsRequest($optionalParams) // 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()); + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); } $defaultHeaders = []; @@ -2805,11 +2801,13 @@ protected function listAssetsRequest($optionalParams) $headers ); - $queryParamsDirect = join('&', $queryParams); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + + // MUX: adds support for array params. + // TODO: future upstream? + $query = ObjectSerializer::buildBetterQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($queryParamsDirect ? "?{$queryParamsDirect}" : ''), + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -2821,7 +2819,7 @@ protected function listAssetsRequest($optionalParams) * Update master access * * @param string $asset_id The asset ID. (required) - * @param \MuxPhp\Models\UpdateAssetMasterAccessRequest $update_asset_master_access_request (required) + * @param \MuxPhp\Models\UpdateAssetMasterAccessRequest $update_asset_master_access_request update_asset_master_access_request (required) * * @throws \MuxPhp\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -2858,7 +2856,7 @@ public function updateAssetMasterAccessWithHttpInfo($asset_id, $update_asset_mas "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } @@ -2883,7 +2881,7 @@ public function updateAssetMasterAccessWithHttpInfo($asset_id, $update_asset_mas if ('\MuxPhp\Models\AssetResponse' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -2898,7 +2896,7 @@ public function updateAssetMasterAccessWithHttpInfo($asset_id, $update_asset_mas if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -2967,7 +2965,7 @@ function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -3002,7 +3000,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function updateAssetMasterAccessRequest($asset_id, $update_asset_master_access_request) + public function updateAssetMasterAccessRequest($asset_id, $update_asset_master_access_request) { // verify the required parameter 'asset_id' is set if ($asset_id === null || (is_array($asset_id) && count($asset_id) === 0)) { @@ -3035,11 +3033,6 @@ protected function updateAssetMasterAccessRequest($asset_id, $update_asset_maste ); } - // body params - $_tempBody = null; - if (isset($update_asset_master_access_request)) { - $_tempBody = $update_asset_master_access_request; - } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -3053,21 +3046,23 @@ protected function updateAssetMasterAccessRequest($asset_id, $update_asset_maste } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present + if (isset($update_asset_master_access_request)) { if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($update_asset_master_access_request)); } else { - $httpBody = $_tempBody; + $httpBody = $update_asset_master_access_request; } } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -3083,7 +3078,7 @@ protected function updateAssetMasterAccessRequest($asset_id, $update_asset_maste // 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()); + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); } $defaultHeaders = []; @@ -3097,11 +3092,13 @@ protected function updateAssetMasterAccessRequest($asset_id, $update_asset_maste $headers ); - $queryParamsDirect = join('&', $queryParams); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + + // MUX: adds support for array params. + // TODO: future upstream? + $query = ObjectSerializer::buildBetterQuery($queryParams); return new Request( 'PUT', - $this->config->getHost() . $resourcePath . ($queryParamsDirect ? "?{$queryParamsDirect}" : ''), + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -3113,7 +3110,7 @@ protected function updateAssetMasterAccessRequest($asset_id, $update_asset_maste * Update MP4 support * * @param string $asset_id The asset ID. (required) - * @param \MuxPhp\Models\UpdateAssetMP4SupportRequest $update_asset_mp4_support_request (required) + * @param \MuxPhp\Models\UpdateAssetMP4SupportRequest $update_asset_mp4_support_request update_asset_mp4_support_request (required) * * @throws \MuxPhp\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -3150,7 +3147,7 @@ public function updateAssetMp4SupportWithHttpInfo($asset_id, $update_asset_mp4_s "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } @@ -3175,7 +3172,7 @@ public function updateAssetMp4SupportWithHttpInfo($asset_id, $update_asset_mp4_s if ('\MuxPhp\Models\AssetResponse' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -3190,7 +3187,7 @@ public function updateAssetMp4SupportWithHttpInfo($asset_id, $update_asset_mp4_s if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -3259,7 +3256,7 @@ function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -3294,7 +3291,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function updateAssetMp4SupportRequest($asset_id, $update_asset_mp4_support_request) + public function updateAssetMp4SupportRequest($asset_id, $update_asset_mp4_support_request) { // verify the required parameter 'asset_id' is set if ($asset_id === null || (is_array($asset_id) && count($asset_id) === 0)) { @@ -3327,11 +3324,6 @@ protected function updateAssetMp4SupportRequest($asset_id, $update_asset_mp4_sup ); } - // body params - $_tempBody = null; - if (isset($update_asset_mp4_support_request)) { - $_tempBody = $update_asset_mp4_support_request; - } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -3345,21 +3337,23 @@ protected function updateAssetMp4SupportRequest($asset_id, $update_asset_mp4_sup } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present + if (isset($update_asset_mp4_support_request)) { if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($update_asset_mp4_support_request)); } else { - $httpBody = $_tempBody; + $httpBody = $update_asset_mp4_support_request; } } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -3375,7 +3369,7 @@ protected function updateAssetMp4SupportRequest($asset_id, $update_asset_mp4_sup // 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()); + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); } $defaultHeaders = []; @@ -3389,11 +3383,13 @@ protected function updateAssetMp4SupportRequest($asset_id, $update_asset_mp4_sup $headers ); - $queryParamsDirect = join('&', $queryParams); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + + // MUX: adds support for array params. + // TODO: future upstream? + $query = ObjectSerializer::buildBetterQuery($queryParams); return new Request( 'PUT', - $this->config->getHost() . $resourcePath . ($queryParamsDirect ? "?{$queryParamsDirect}" : ''), + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); diff --git a/MuxPhp/Api/DeliveryUsageApi.php b/MuxPhp/Api/DeliveryUsageApi.php index 93b713f..83e52ed 100644 --- a/MuxPhp/Api/DeliveryUsageApi.php +++ b/MuxPhp/Api/DeliveryUsageApi.php @@ -1,8 +1,29 @@ client = $client ?: new Client(); $this->config = $config ?: new Configuration(); $this->headerSelector = $selector ?: new HeaderSelector(); - $this->hostIndex = $host_index; + $this->hostIndex = $hostIndex; } /** * Set the host index * - * @param int $host_index Host index (required) + * @param int $hostIndex Host index (required) */ - public function setHostIndex($host_index) + public function setHostIndex($hostIndex) { - $this->hostIndex = $host_index; + $this->hostIndex = $hostIndex; } /** * Get the host index * - * @return Host index + * @return int Host index */ public function getHostIndex() { @@ -97,19 +120,18 @@ public function getConfig() * * List Usage * - * @param mixed[] $optionalParams An associative array of optional parameters which can be passed to this function: - * - page int - Offset by this many pages, of the size of `limit` (optional, default to 1) - * - limit int - Number of items to include in the response (optional, default to 100) - * - asset_id string - Filter response to return delivery usage for this asset only. (optional) - * - timeframe string[] - Time window to get delivery usage information. timeframe[0] indicates the start time, timeframe[1] indicates the end time in seconds since the Unix epoch. Default time window is 1 hour representing usage from 13th to 12th hour from when the request is made. (optional) + * @param int $page Offset by this many pages, of the size of `limit` (optional, default to 1) + * @param int $limit Number of items to include in the response (optional, default to 100) + * @param string $asset_id Filter response to return delivery usage for this asset only. (optional) + * @param string[] $timeframe Time window to get delivery usage information. timeframe[0] indicates the start time, timeframe[1] indicates the end time in seconds since the Unix epoch. Default time window is 1 hour representing usage from 13th to 12th hour from when the request is made. (optional) * * @throws \MuxPhp\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \MuxPhp\Models\ListDeliveryUsageResponse */ - public function listDeliveryUsage($optionalParams = []) + public function listDeliveryUsage($page = 1, $limit = 100, $asset_id = null, $timeframe = null) { - list($response) = $this->listDeliveryUsageWithHttpInfo($optionalParams); + list($response) = $this->listDeliveryUsageWithHttpInfo($page, $limit, $asset_id, $timeframe); return $response; } @@ -118,19 +140,18 @@ public function listDeliveryUsage($optionalParams = []) * * List Usage * - * @param mixed[] $optionalParams An associative array of optional parameters which can be passed to this function: - * - page int - Offset by this many pages, of the size of `limit` (optional, default to 1) - * - limit int - Number of items to include in the response (optional, default to 100) - * - asset_id string - Filter response to return delivery usage for this asset only. (optional) - * - timeframe string[] - Time window to get delivery usage information. timeframe[0] indicates the start time, timeframe[1] indicates the end time in seconds since the Unix epoch. Default time window is 1 hour representing usage from 13th to 12th hour from when the request is made. (optional) + * @param int $page Offset by this many pages, of the size of `limit` (optional, default to 1) + * @param int $limit Number of items to include in the response (optional, default to 100) + * @param string $asset_id Filter response to return delivery usage for this asset only. (optional) + * @param string[] $timeframe Time window to get delivery usage information. timeframe[0] indicates the start time, timeframe[1] indicates the end time in seconds since the Unix epoch. Default time window is 1 hour representing usage from 13th to 12th hour from when the request is made. (optional) * * @throws \MuxPhp\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \MuxPhp\Models\ListDeliveryUsageResponse, HTTP status code, HTTP response headers (array of strings) */ - public function listDeliveryUsageWithHttpInfo($optionalParams = []) + public function listDeliveryUsageWithHttpInfo($page = 1, $limit = 100, $asset_id = null, $timeframe = null) { - $request = $this->listDeliveryUsageRequest($optionalParams); + $request = $this->listDeliveryUsageRequest($page, $limit, $asset_id, $timeframe); try { $options = $this->createHttpClientOption(); @@ -141,7 +162,7 @@ public function listDeliveryUsageWithHttpInfo($optionalParams = []) "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } @@ -166,7 +187,7 @@ public function listDeliveryUsageWithHttpInfo($optionalParams = []) if ('\MuxPhp\Models\ListDeliveryUsageResponse' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -181,7 +202,7 @@ public function listDeliveryUsageWithHttpInfo($optionalParams = []) if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -210,18 +231,17 @@ public function listDeliveryUsageWithHttpInfo($optionalParams = []) * * List Usage * - * @param mixed[] $optionalParams An associative array of optional parameters which can be passed to this function: - * - page int - Offset by this many pages, of the size of `limit` (optional, default to 1) - * - limit int - Number of items to include in the response (optional, default to 100) - * - asset_id string - Filter response to return delivery usage for this asset only. (optional) - * - timeframe string[] - Time window to get delivery usage information. timeframe[0] indicates the start time, timeframe[1] indicates the end time in seconds since the Unix epoch. Default time window is 1 hour representing usage from 13th to 12th hour from when the request is made. (optional) + * @param int $page Offset by this many pages, of the size of `limit` (optional, default to 1) + * @param int $limit Number of items to include in the response (optional, default to 100) + * @param string $asset_id Filter response to return delivery usage for this asset only. (optional) + * @param string[] $timeframe Time window to get delivery usage information. timeframe[0] indicates the start time, timeframe[1] indicates the end time in seconds since the Unix epoch. Default time window is 1 hour representing usage from 13th to 12th hour from when the request is made. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function listDeliveryUsageAsync($optionalParams = []) + public function listDeliveryUsageAsync($page = 1, $limit = 100, $asset_id = null, $timeframe = null) { - return $this->listDeliveryUsageAsyncWithHttpInfo($optionalParams) + return $this->listDeliveryUsageAsyncWithHttpInfo($page, $limit, $asset_id, $timeframe) ->then( function ($response) { return $response[0]; @@ -234,19 +254,18 @@ function ($response) { * * List Usage * - * @param mixed[] $optionalParams An associative array of optional parameters which can be passed to this function: - * - page int - Offset by this many pages, of the size of `limit` (optional, default to 1) - * - limit int - Number of items to include in the response (optional, default to 100) - * - asset_id string - Filter response to return delivery usage for this asset only. (optional) - * - timeframe string[] - Time window to get delivery usage information. timeframe[0] indicates the start time, timeframe[1] indicates the end time in seconds since the Unix epoch. Default time window is 1 hour representing usage from 13th to 12th hour from when the request is made. (optional) + * @param int $page Offset by this many pages, of the size of `limit` (optional, default to 1) + * @param int $limit Number of items to include in the response (optional, default to 100) + * @param string $asset_id Filter response to return delivery usage for this asset only. (optional) + * @param string[] $timeframe Time window to get delivery usage information. timeframe[0] indicates the start time, timeframe[1] indicates the end time in seconds since the Unix epoch. Default time window is 1 hour representing usage from 13th to 12th hour from when the request is made. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function listDeliveryUsageAsyncWithHttpInfo($optionalParams = []) + public function listDeliveryUsageAsyncWithHttpInfo($page = 1, $limit = 100, $asset_id = null, $timeframe = null) { $returnType = '\MuxPhp\Models\ListDeliveryUsageResponse'; - $request = $this->listDeliveryUsageRequest($optionalParams); + $request = $this->listDeliveryUsageRequest($page, $limit, $asset_id, $timeframe); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -256,7 +275,7 @@ function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -285,22 +304,16 @@ function ($exception) { /** * Create request for operation 'listDeliveryUsage' * - * @param mixed[] $optionalParams An associative array of optional parameters which can be passed to this function: - * - page int - Offset by this many pages, of the size of `limit` (optional, default to 1) - * - limit int - Number of items to include in the response (optional, default to 100) - * - asset_id string - Filter response to return delivery usage for this asset only. (optional) - * - timeframe string[] - Time window to get delivery usage information. timeframe[0] indicates the start time, timeframe[1] indicates the end time in seconds since the Unix epoch. Default time window is 1 hour representing usage from 13th to 12th hour from when the request is made. (optional) + * @param int $page Offset by this many pages, of the size of `limit` (optional, default to 1) + * @param int $limit Number of items to include in the response (optional, default to 100) + * @param string $asset_id Filter response to return delivery usage for this asset only. (optional) + * @param string[] $timeframe Time window to get delivery usage information. timeframe[0] indicates the start time, timeframe[1] indicates the end time in seconds since the Unix epoch. Default time window is 1 hour representing usage from 13th to 12th hour from when the request is made. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function listDeliveryUsageRequest($optionalParams) + public function listDeliveryUsageRequest($page = 1, $limit = 100, $asset_id = null, $timeframe = null) { - // Pull the set optional params from the associative array $optionalParams, setting them to their defaults if they're not set. - $page = array_key_exists('page', $optionalParams) ? $optionalParams['page'] : 1; - $limit = array_key_exists('limit', $optionalParams) ? $optionalParams['limit'] : 100; - $asset_id = array_key_exists('asset_id', $optionalParams) ? $optionalParams['asset_id'] : null; - $timeframe = array_key_exists('timeframe', $optionalParams) ? $optionalParams['timeframe'] : null; $resourcePath = '/video/v1/delivery-usage'; $formParams = []; @@ -311,32 +324,51 @@ protected function listDeliveryUsageRequest($optionalParams) // Query Param: page if ($page !== null) { - array_push($queryParams, 'page=' . ObjectSerializer::toQueryValue($page)); + if('form' === 'form' && is_array($page)) { + foreach($page as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['page'] = $page; + } } // Query Param: limit if ($limit !== null) { - array_push($queryParams, 'limit=' . ObjectSerializer::toQueryValue($limit)); + if('form' === 'form' && is_array($limit)) { + foreach($limit as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['limit'] = $limit; + } } // Query Param: asset_id if ($asset_id !== null) { - array_push($queryParams, 'asset_id=' . ObjectSerializer::toQueryValue($asset_id)); + if('form' === 'form' && is_array($asset_id)) { + foreach($asset_id as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['asset_id'] = $asset_id; + } } - // Query Param: timeframe[] + // Query Param: timeframe if ($timeframe !== null) { if (is_array($timeframe)) { foreach ($timeframe as $p) { - array_push($queryParams, "timeframe[]=$p"); + array_push($queryParams, "timeframe=$p"); } } else { - throw new \InvalidArgumentException('Did not receive an array when expecting one for query parameter timeframe[]'); + throw new \InvalidArgumentException('Did not receive an array when expecting one for query parameter timeframe'); } } - // body params - $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -350,21 +382,17 @@ protected function listDeliveryUsageRequest($optionalParams) } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -380,7 +408,7 @@ protected function listDeliveryUsageRequest($optionalParams) // 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()); + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); } $defaultHeaders = []; @@ -394,11 +422,13 @@ protected function listDeliveryUsageRequest($optionalParams) $headers ); - $queryParamsDirect = join('&', $queryParams); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + + // MUX: adds support for array params. + // TODO: future upstream? + $query = ObjectSerializer::buildBetterQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($queryParamsDirect ? "?{$queryParamsDirect}" : ''), + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); diff --git a/MuxPhp/Api/DimensionsApi.php b/MuxPhp/Api/DimensionsApi.php index fb9ed99..c94a198 100644 --- a/MuxPhp/Api/DimensionsApi.php +++ b/MuxPhp/Api/DimensionsApi.php @@ -1,8 +1,29 @@ client = $client ?: new Client(); $this->config = $config ?: new Configuration(); $this->headerSelector = $selector ?: new HeaderSelector(); - $this->hostIndex = $host_index; + $this->hostIndex = $hostIndex; } /** * Set the host index * - * @param int $host_index Host index (required) + * @param int $hostIndex Host index (required) */ - public function setHostIndex($host_index) + public function setHostIndex($hostIndex) { - $this->hostIndex = $host_index; + $this->hostIndex = $hostIndex; } /** * Get the host index * - * @return Host index + * @return int Host index */ public function getHostIndex() { @@ -98,19 +121,18 @@ public function getConfig() * Lists the values for a specific dimension * * @param string $dimension_id ID of the Dimension (required) - * @param mixed[] $optionalParams An associative array of optional parameters which can be passed to this function: - * - 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) - * - filters string[] - Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. (optional) - * - timeframe string[] - Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. (optional) + * @param int $limit Number of items to include in the response (optional, default to 25) + * @param int $page Offset by this many pages, of the size of `limit` (optional, default to 1) + * @param string[] $filters Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. (optional) + * @param string[] $timeframe Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. (optional) * * @throws \MuxPhp\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \MuxPhp\Models\ListDimensionValuesResponse */ - public function listDimensionValues($dimension_id, $optionalParams = []) + public function listDimensionValues($dimension_id, $limit = 25, $page = 1, $filters = null, $timeframe = null) { - list($response) = $this->listDimensionValuesWithHttpInfo($dimension_id, $optionalParams); + list($response) = $this->listDimensionValuesWithHttpInfo($dimension_id, $limit, $page, $filters, $timeframe); return $response; } @@ -120,19 +142,18 @@ public function listDimensionValues($dimension_id, $optionalParams = []) * Lists the values for a specific dimension * * @param string $dimension_id ID of the Dimension (required) - * @param mixed[] $optionalParams An associative array of optional parameters which can be passed to this function: - * - 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) - * - filters string[] - Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. (optional) - * - timeframe string[] - Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. (optional) + * @param int $limit Number of items to include in the response (optional, default to 25) + * @param int $page Offset by this many pages, of the size of `limit` (optional, default to 1) + * @param string[] $filters Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. (optional) + * @param string[] $timeframe Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. (optional) * * @throws \MuxPhp\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \MuxPhp\Models\ListDimensionValuesResponse, HTTP status code, HTTP response headers (array of strings) */ - public function listDimensionValuesWithHttpInfo($dimension_id, $optionalParams = []) + public function listDimensionValuesWithHttpInfo($dimension_id, $limit = 25, $page = 1, $filters = null, $timeframe = null) { - $request = $this->listDimensionValuesRequest($dimension_id, $optionalParams); + $request = $this->listDimensionValuesRequest($dimension_id, $limit, $page, $filters, $timeframe); try { $options = $this->createHttpClientOption(); @@ -143,7 +164,7 @@ public function listDimensionValuesWithHttpInfo($dimension_id, $optionalParams = "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } @@ -168,7 +189,7 @@ public function listDimensionValuesWithHttpInfo($dimension_id, $optionalParams = if ('\MuxPhp\Models\ListDimensionValuesResponse' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -183,7 +204,7 @@ public function listDimensionValuesWithHttpInfo($dimension_id, $optionalParams = if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -213,18 +234,17 @@ public function listDimensionValuesWithHttpInfo($dimension_id, $optionalParams = * Lists the values for a specific dimension * * @param string $dimension_id ID of the Dimension (required) - * @param mixed[] $optionalParams An associative array of optional parameters which can be passed to this function: - * - 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) - * - filters string[] - Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. (optional) - * - timeframe string[] - Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. (optional) + * @param int $limit Number of items to include in the response (optional, default to 25) + * @param int $page Offset by this many pages, of the size of `limit` (optional, default to 1) + * @param string[] $filters Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. (optional) + * @param string[] $timeframe Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function listDimensionValuesAsync($dimension_id, $optionalParams = []) + public function listDimensionValuesAsync($dimension_id, $limit = 25, $page = 1, $filters = null, $timeframe = null) { - return $this->listDimensionValuesAsyncWithHttpInfo($dimension_id, $optionalParams) + return $this->listDimensionValuesAsyncWithHttpInfo($dimension_id, $limit, $page, $filters, $timeframe) ->then( function ($response) { return $response[0]; @@ -238,19 +258,18 @@ function ($response) { * Lists the values for a specific dimension * * @param string $dimension_id ID of the Dimension (required) - * @param mixed[] $optionalParams An associative array of optional parameters which can be passed to this function: - * - 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) - * - filters string[] - Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. (optional) - * - timeframe string[] - Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. (optional) + * @param int $limit Number of items to include in the response (optional, default to 25) + * @param int $page Offset by this many pages, of the size of `limit` (optional, default to 1) + * @param string[] $filters Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. (optional) + * @param string[] $timeframe Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function listDimensionValuesAsyncWithHttpInfo($dimension_id, $optionalParams = []) + public function listDimensionValuesAsyncWithHttpInfo($dimension_id, $limit = 25, $page = 1, $filters = null, $timeframe = null) { $returnType = '\MuxPhp\Models\ListDimensionValuesResponse'; - $request = $this->listDimensionValuesRequest($dimension_id, $optionalParams); + $request = $this->listDimensionValuesRequest($dimension_id, $limit, $page, $filters, $timeframe); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -260,7 +279,7 @@ function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -290,22 +309,16 @@ function ($exception) { * Create request for operation 'listDimensionValues' * * @param string $dimension_id ID of the Dimension (required) - * @param mixed[] $optionalParams An associative array of optional parameters which can be passed to this function: - * - 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) - * - filters string[] - Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. (optional) - * - timeframe string[] - Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. (optional) + * @param int $limit Number of items to include in the response (optional, default to 25) + * @param int $page Offset by this many pages, of the size of `limit` (optional, default to 1) + * @param string[] $filters Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. (optional) + * @param string[] $timeframe Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function listDimensionValuesRequest($dimension_id, $optionalParams) + public function listDimensionValuesRequest($dimension_id, $limit = 25, $page = 1, $filters = null, $timeframe = null) { - // Pull the set optional params from the associative array $optionalParams, setting them to their defaults if they're not set. - $limit = array_key_exists('limit', $optionalParams) ? $optionalParams['limit'] : 25; - $page = array_key_exists('page', $optionalParams) ? $optionalParams['page'] : 1; - $filters = array_key_exists('filters', $optionalParams) ? $optionalParams['filters'] : null; - $timeframe = array_key_exists('timeframe', $optionalParams) ? $optionalParams['timeframe'] : null; // verify the required parameter 'dimension_id' is set if ($dimension_id === null || (is_array($dimension_id) && count($dimension_id) === 0)) { throw new \InvalidArgumentException( @@ -322,32 +335,46 @@ protected function listDimensionValuesRequest($dimension_id, $optionalParams) // Query Param: limit if ($limit !== null) { - array_push($queryParams, 'limit=' . ObjectSerializer::toQueryValue($limit)); + if('form' === 'form' && is_array($limit)) { + foreach($limit as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['limit'] = $limit; + } } // Query Param: page if ($page !== null) { - array_push($queryParams, 'page=' . ObjectSerializer::toQueryValue($page)); + if('form' === 'form' && is_array($page)) { + foreach($page as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['page'] = $page; + } } - // Query Param: filters[] + // Query Param: filters if ($filters !== null) { if (is_array($filters)) { foreach ($filters as $p) { - array_push($queryParams, "filters[]=$p"); + array_push($queryParams, "filters=$p"); } } else { - throw new \InvalidArgumentException('Did not receive an array when expecting one for query parameter filters[]'); + throw new \InvalidArgumentException('Did not receive an array when expecting one for query parameter filters'); } } - // Query Param: timeframe[] + // Query Param: timeframe if ($timeframe !== null) { if (is_array($timeframe)) { foreach ($timeframe as $p) { - array_push($queryParams, "timeframe[]=$p"); + array_push($queryParams, "timeframe=$p"); } } else { - throw new \InvalidArgumentException('Did not receive an array when expecting one for query parameter timeframe[]'); + throw new \InvalidArgumentException('Did not receive an array when expecting one for query parameter timeframe'); } } @@ -361,8 +388,6 @@ protected function listDimensionValuesRequest($dimension_id, $optionalParams) ); } - // body params - $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -376,21 +401,17 @@ protected function listDimensionValuesRequest($dimension_id, $optionalParams) } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -406,7 +427,7 @@ protected function listDimensionValuesRequest($dimension_id, $optionalParams) // 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()); + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); } $defaultHeaders = []; @@ -420,11 +441,13 @@ protected function listDimensionValuesRequest($dimension_id, $optionalParams) $headers ); - $queryParamsDirect = join('&', $queryParams); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + + // MUX: adds support for array params. + // TODO: future upstream? + $query = ObjectSerializer::buildBetterQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($queryParamsDirect ? "?{$queryParamsDirect}" : ''), + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -469,7 +492,7 @@ public function listDimensionsWithHttpInfo() "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } @@ -494,7 +517,7 @@ public function listDimensionsWithHttpInfo() if ('\MuxPhp\Models\ListDimensionsResponse' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -509,7 +532,7 @@ public function listDimensionsWithHttpInfo() if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -574,7 +597,7 @@ function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -607,7 +630,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function listDimensionsRequest() + public function listDimensionsRequest() { $resourcePath = '/data/v1/dimensions'; @@ -620,8 +643,6 @@ protected function listDimensionsRequest() - // body params - $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -635,21 +656,17 @@ protected function listDimensionsRequest() } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -665,7 +682,7 @@ protected function listDimensionsRequest() // 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()); + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); } $defaultHeaders = []; @@ -679,11 +696,13 @@ protected function listDimensionsRequest() $headers ); - $queryParamsDirect = join('&', $queryParams); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + + // MUX: adds support for array params. + // TODO: future upstream? + $query = ObjectSerializer::buildBetterQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($queryParamsDirect ? "?{$queryParamsDirect}" : ''), + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); diff --git a/MuxPhp/Api/DirectUploadsApi.php b/MuxPhp/Api/DirectUploadsApi.php index 3311ef0..a8588b4 100644 --- a/MuxPhp/Api/DirectUploadsApi.php +++ b/MuxPhp/Api/DirectUploadsApi.php @@ -1,8 +1,29 @@ client = $client ?: new Client(); $this->config = $config ?: new Configuration(); $this->headerSelector = $selector ?: new HeaderSelector(); - $this->hostIndex = $host_index; + $this->hostIndex = $hostIndex; } /** * Set the host index * - * @param int $host_index Host index (required) + * @param int $hostIndex Host index (required) */ - public function setHostIndex($host_index) + public function setHostIndex($hostIndex) { - $this->hostIndex = $host_index; + $this->hostIndex = $hostIndex; } /** * Get the host index * - * @return Host index + * @return int Host index */ public function getHostIndex() { @@ -133,7 +156,7 @@ public function cancelDirectUploadWithHttpInfo($upload_id) "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } @@ -158,7 +181,7 @@ public function cancelDirectUploadWithHttpInfo($upload_id) if ('\MuxPhp\Models\UploadResponse' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -173,7 +196,7 @@ public function cancelDirectUploadWithHttpInfo($upload_id) if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -240,7 +263,7 @@ function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -274,7 +297,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function cancelDirectUploadRequest($upload_id) + public function cancelDirectUploadRequest($upload_id) { // verify the required parameter 'upload_id' is set if ($upload_id === null || (is_array($upload_id) && count($upload_id) === 0)) { @@ -301,8 +324,6 @@ protected function cancelDirectUploadRequest($upload_id) ); } - // body params - $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -316,21 +337,17 @@ protected function cancelDirectUploadRequest($upload_id) } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -346,7 +363,7 @@ protected function cancelDirectUploadRequest($upload_id) // 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()); + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); } $defaultHeaders = []; @@ -360,11 +377,13 @@ protected function cancelDirectUploadRequest($upload_id) $headers ); - $queryParamsDirect = join('&', $queryParams); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + + // MUX: adds support for array params. + // TODO: future upstream? + $query = ObjectSerializer::buildBetterQuery($queryParams); return new Request( 'PUT', - $this->config->getHost() . $resourcePath . ($queryParamsDirect ? "?{$queryParamsDirect}" : ''), + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -375,7 +394,7 @@ protected function cancelDirectUploadRequest($upload_id) * * Create a new direct upload URL * - * @param \MuxPhp\Models\CreateUploadRequest $create_upload_request (required) + * @param \MuxPhp\Models\CreateUploadRequest $create_upload_request create_upload_request (required) * * @throws \MuxPhp\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -411,7 +430,7 @@ public function createDirectUploadWithHttpInfo($create_upload_request) "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } @@ -436,7 +455,7 @@ public function createDirectUploadWithHttpInfo($create_upload_request) if ('\MuxPhp\Models\UploadResponse' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -451,7 +470,7 @@ public function createDirectUploadWithHttpInfo($create_upload_request) if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -518,7 +537,7 @@ function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -552,7 +571,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function createDirectUploadRequest($create_upload_request) + public function createDirectUploadRequest($create_upload_request) { // verify the required parameter 'create_upload_request' is set if ($create_upload_request === null || (is_array($create_upload_request) && count($create_upload_request) === 0)) { @@ -571,11 +590,6 @@ protected function createDirectUploadRequest($create_upload_request) - // body params - $_tempBody = null; - if (isset($create_upload_request)) { - $_tempBody = $create_upload_request; - } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -589,21 +603,23 @@ protected function createDirectUploadRequest($create_upload_request) } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present + if (isset($create_upload_request)) { if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($create_upload_request)); } else { - $httpBody = $_tempBody; + $httpBody = $create_upload_request; } } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -619,7 +635,7 @@ protected function createDirectUploadRequest($create_upload_request) // 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()); + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); } $defaultHeaders = []; @@ -633,11 +649,13 @@ protected function createDirectUploadRequest($create_upload_request) $headers ); - $queryParamsDirect = join('&', $queryParams); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + + // MUX: adds support for array params. + // TODO: future upstream? + $query = ObjectSerializer::buildBetterQuery($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($queryParamsDirect ? "?{$queryParamsDirect}" : ''), + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -684,7 +702,7 @@ public function getDirectUploadWithHttpInfo($upload_id) "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } @@ -709,7 +727,7 @@ public function getDirectUploadWithHttpInfo($upload_id) if ('\MuxPhp\Models\UploadResponse' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -724,7 +742,7 @@ public function getDirectUploadWithHttpInfo($upload_id) if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -791,7 +809,7 @@ function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -825,7 +843,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getDirectUploadRequest($upload_id) + public function getDirectUploadRequest($upload_id) { // verify the required parameter 'upload_id' is set if ($upload_id === null || (is_array($upload_id) && count($upload_id) === 0)) { @@ -852,8 +870,6 @@ protected function getDirectUploadRequest($upload_id) ); } - // body params - $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -867,21 +883,17 @@ protected function getDirectUploadRequest($upload_id) } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -897,7 +909,7 @@ protected function getDirectUploadRequest($upload_id) // 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()); + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); } $defaultHeaders = []; @@ -911,11 +923,13 @@ protected function getDirectUploadRequest($upload_id) $headers ); - $queryParamsDirect = join('&', $queryParams); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + + // MUX: adds support for array params. + // TODO: future upstream? + $query = ObjectSerializer::buildBetterQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($queryParamsDirect ? "?{$queryParamsDirect}" : ''), + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -926,17 +940,16 @@ protected function getDirectUploadRequest($upload_id) * * List direct uploads * - * @param mixed[] $optionalParams An associative array of optional parameters which can be passed to this function: - * - 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) + * @param int $limit Number of items to include in the response (optional, default to 25) + * @param int $page Offset by this many pages, of the size of `limit` (optional, default to 1) * * @throws \MuxPhp\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \MuxPhp\Models\ListUploadsResponse */ - public function listDirectUploads($optionalParams = []) + public function listDirectUploads($limit = 25, $page = 1) { - list($response) = $this->listDirectUploadsWithHttpInfo($optionalParams); + list($response) = $this->listDirectUploadsWithHttpInfo($limit, $page); return $response; } @@ -945,17 +958,16 @@ public function listDirectUploads($optionalParams = []) * * List direct uploads * - * @param mixed[] $optionalParams An associative array of optional parameters which can be passed to this function: - * - 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) + * @param int $limit Number of items to include in the response (optional, default to 25) + * @param int $page Offset by this many pages, of the size of `limit` (optional, default to 1) * * @throws \MuxPhp\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \MuxPhp\Models\ListUploadsResponse, HTTP status code, HTTP response headers (array of strings) */ - public function listDirectUploadsWithHttpInfo($optionalParams = []) + public function listDirectUploadsWithHttpInfo($limit = 25, $page = 1) { - $request = $this->listDirectUploadsRequest($optionalParams); + $request = $this->listDirectUploadsRequest($limit, $page); try { $options = $this->createHttpClientOption(); @@ -966,7 +978,7 @@ public function listDirectUploadsWithHttpInfo($optionalParams = []) "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } @@ -991,7 +1003,7 @@ public function listDirectUploadsWithHttpInfo($optionalParams = []) if ('\MuxPhp\Models\ListUploadsResponse' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -1006,7 +1018,7 @@ public function listDirectUploadsWithHttpInfo($optionalParams = []) if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -1035,16 +1047,15 @@ public function listDirectUploadsWithHttpInfo($optionalParams = []) * * List direct uploads * - * @param mixed[] $optionalParams An associative array of optional parameters which can be passed to this function: - * - 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) + * @param int $limit Number of items to include in the response (optional, default to 25) + * @param int $page Offset by this many pages, of the size of `limit` (optional, default to 1) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function listDirectUploadsAsync($optionalParams = []) + public function listDirectUploadsAsync($limit = 25, $page = 1) { - return $this->listDirectUploadsAsyncWithHttpInfo($optionalParams) + return $this->listDirectUploadsAsyncWithHttpInfo($limit, $page) ->then( function ($response) { return $response[0]; @@ -1057,17 +1068,16 @@ function ($response) { * * List direct uploads * - * @param mixed[] $optionalParams An associative array of optional parameters which can be passed to this function: - * - 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) + * @param int $limit Number of items to include in the response (optional, default to 25) + * @param int $page Offset by this many pages, of the size of `limit` (optional, default to 1) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function listDirectUploadsAsyncWithHttpInfo($optionalParams = []) + public function listDirectUploadsAsyncWithHttpInfo($limit = 25, $page = 1) { $returnType = '\MuxPhp\Models\ListUploadsResponse'; - $request = $this->listDirectUploadsRequest($optionalParams); + $request = $this->listDirectUploadsRequest($limit, $page); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1077,7 +1087,7 @@ function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -1106,18 +1116,14 @@ function ($exception) { /** * Create request for operation 'listDirectUploads' * - * @param mixed[] $optionalParams An associative array of optional parameters which can be passed to this function: - * - 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) + * @param int $limit Number of items to include in the response (optional, default to 25) + * @param int $page Offset by this many pages, of the size of `limit` (optional, default to 1) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function listDirectUploadsRequest($optionalParams) + public function listDirectUploadsRequest($limit = 25, $page = 1) { - // Pull the set optional params from the associative array $optionalParams, setting them to their defaults if they're not set. - $limit = array_key_exists('limit', $optionalParams) ? $optionalParams['limit'] : 25; - $page = array_key_exists('page', $optionalParams) ? $optionalParams['page'] : 1; $resourcePath = '/video/v1/uploads'; $formParams = []; @@ -1128,17 +1134,29 @@ protected function listDirectUploadsRequest($optionalParams) // Query Param: limit if ($limit !== null) { - array_push($queryParams, 'limit=' . ObjectSerializer::toQueryValue($limit)); + if('form' === 'form' && is_array($limit)) { + foreach($limit as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['limit'] = $limit; + } } // Query Param: page if ($page !== null) { - array_push($queryParams, 'page=' . ObjectSerializer::toQueryValue($page)); + if('form' === 'form' && is_array($page)) { + foreach($page as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['page'] = $page; + } } - // body params - $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -1152,21 +1170,17 @@ protected function listDirectUploadsRequest($optionalParams) } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -1182,7 +1196,7 @@ protected function listDirectUploadsRequest($optionalParams) // 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()); + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); } $defaultHeaders = []; @@ -1196,11 +1210,13 @@ protected function listDirectUploadsRequest($optionalParams) $headers ); - $queryParamsDirect = join('&', $queryParams); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + + // MUX: adds support for array params. + // TODO: future upstream? + $query = ObjectSerializer::buildBetterQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($queryParamsDirect ? "?{$queryParamsDirect}" : ''), + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); diff --git a/MuxPhp/Api/ErrorsApi.php b/MuxPhp/Api/ErrorsApi.php index 85166d0..cfe78f7 100644 --- a/MuxPhp/Api/ErrorsApi.php +++ b/MuxPhp/Api/ErrorsApi.php @@ -1,8 +1,29 @@ client = $client ?: new Client(); $this->config = $config ?: new Configuration(); $this->headerSelector = $selector ?: new HeaderSelector(); - $this->hostIndex = $host_index; + $this->hostIndex = $hostIndex; } /** * Set the host index * - * @param int $host_index Host index (required) + * @param int $hostIndex Host index (required) */ - public function setHostIndex($host_index) + public function setHostIndex($hostIndex) { - $this->hostIndex = $host_index; + $this->hostIndex = $hostIndex; } /** * Get the host index * - * @return Host index + * @return int Host index */ public function getHostIndex() { @@ -97,17 +120,16 @@ public function getConfig() * * List Errors * - * @param mixed[] $optionalParams An associative array of optional parameters which can be passed to this function: - * - filters string[] - Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. (optional) - * - timeframe string[] - Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. (optional) + * @param string[] $filters Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. (optional) + * @param string[] $timeframe Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. (optional) * * @throws \MuxPhp\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \MuxPhp\Models\ListErrorsResponse */ - public function listErrors($optionalParams = []) + public function listErrors($filters = null, $timeframe = null) { - list($response) = $this->listErrorsWithHttpInfo($optionalParams); + list($response) = $this->listErrorsWithHttpInfo($filters, $timeframe); return $response; } @@ -116,17 +138,16 @@ public function listErrors($optionalParams = []) * * List Errors * - * @param mixed[] $optionalParams An associative array of optional parameters which can be passed to this function: - * - filters string[] - Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. (optional) - * - timeframe string[] - Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. (optional) + * @param string[] $filters Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. (optional) + * @param string[] $timeframe Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. (optional) * * @throws \MuxPhp\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \MuxPhp\Models\ListErrorsResponse, HTTP status code, HTTP response headers (array of strings) */ - public function listErrorsWithHttpInfo($optionalParams = []) + public function listErrorsWithHttpInfo($filters = null, $timeframe = null) { - $request = $this->listErrorsRequest($optionalParams); + $request = $this->listErrorsRequest($filters, $timeframe); try { $options = $this->createHttpClientOption(); @@ -137,7 +158,7 @@ public function listErrorsWithHttpInfo($optionalParams = []) "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } @@ -162,7 +183,7 @@ public function listErrorsWithHttpInfo($optionalParams = []) if ('\MuxPhp\Models\ListErrorsResponse' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -177,7 +198,7 @@ public function listErrorsWithHttpInfo($optionalParams = []) if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -206,16 +227,15 @@ public function listErrorsWithHttpInfo($optionalParams = []) * * List Errors * - * @param mixed[] $optionalParams An associative array of optional parameters which can be passed to this function: - * - filters string[] - Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. (optional) - * - timeframe string[] - Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. (optional) + * @param string[] $filters Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. (optional) + * @param string[] $timeframe Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function listErrorsAsync($optionalParams = []) + public function listErrorsAsync($filters = null, $timeframe = null) { - return $this->listErrorsAsyncWithHttpInfo($optionalParams) + return $this->listErrorsAsyncWithHttpInfo($filters, $timeframe) ->then( function ($response) { return $response[0]; @@ -228,17 +248,16 @@ function ($response) { * * List Errors * - * @param mixed[] $optionalParams An associative array of optional parameters which can be passed to this function: - * - filters string[] - Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. (optional) - * - timeframe string[] - Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. (optional) + * @param string[] $filters Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. (optional) + * @param string[] $timeframe Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function listErrorsAsyncWithHttpInfo($optionalParams = []) + public function listErrorsAsyncWithHttpInfo($filters = null, $timeframe = null) { $returnType = '\MuxPhp\Models\ListErrorsResponse'; - $request = $this->listErrorsRequest($optionalParams); + $request = $this->listErrorsRequest($filters, $timeframe); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -248,7 +267,7 @@ function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -277,18 +296,14 @@ function ($exception) { /** * Create request for operation 'listErrors' * - * @param mixed[] $optionalParams An associative array of optional parameters which can be passed to this function: - * - filters string[] - Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. (optional) - * - timeframe string[] - Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. (optional) + * @param string[] $filters Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. (optional) + * @param string[] $timeframe Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function listErrorsRequest($optionalParams) + public function listErrorsRequest($filters = null, $timeframe = null) { - // Pull the set optional params from the associative array $optionalParams, setting them to their defaults if they're not set. - $filters = array_key_exists('filters', $optionalParams) ? $optionalParams['filters'] : null; - $timeframe = array_key_exists('timeframe', $optionalParams) ? $optionalParams['timeframe'] : null; $resourcePath = '/data/v1/errors'; $formParams = []; @@ -297,33 +312,31 @@ protected function listErrorsRequest($optionalParams) $httpBody = ''; $multipart = false; - // Query Param: filters[] + // Query Param: filters if ($filters !== null) { if (is_array($filters)) { foreach ($filters as $p) { - array_push($queryParams, "filters[]=$p"); + array_push($queryParams, "filters=$p"); } } else { - throw new \InvalidArgumentException('Did not receive an array when expecting one for query parameter filters[]'); + throw new \InvalidArgumentException('Did not receive an array when expecting one for query parameter filters'); } } - // Query Param: timeframe[] + // Query Param: timeframe if ($timeframe !== null) { if (is_array($timeframe)) { foreach ($timeframe as $p) { - array_push($queryParams, "timeframe[]=$p"); + array_push($queryParams, "timeframe=$p"); } } else { - throw new \InvalidArgumentException('Did not receive an array when expecting one for query parameter timeframe[]'); + throw new \InvalidArgumentException('Did not receive an array when expecting one for query parameter timeframe'); } } - // body params - $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -337,21 +350,17 @@ protected function listErrorsRequest($optionalParams) } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -367,7 +376,7 @@ protected function listErrorsRequest($optionalParams) // 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()); + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); } $defaultHeaders = []; @@ -381,11 +390,13 @@ protected function listErrorsRequest($optionalParams) $headers ); - $queryParamsDirect = join('&', $queryParams); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + + // MUX: adds support for array params. + // TODO: future upstream? + $query = ObjectSerializer::buildBetterQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($queryParamsDirect ? "?{$queryParamsDirect}" : ''), + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); diff --git a/MuxPhp/Api/ExportsApi.php b/MuxPhp/Api/ExportsApi.php index 673fc28..ad2224c 100644 --- a/MuxPhp/Api/ExportsApi.php +++ b/MuxPhp/Api/ExportsApi.php @@ -1,8 +1,29 @@ client = $client ?: new Client(); $this->config = $config ?: new Configuration(); $this->headerSelector = $selector ?: new HeaderSelector(); - $this->hostIndex = $host_index; + $this->hostIndex = $hostIndex; } /** * Set the host index * - * @param int $host_index Host index (required) + * @param int $hostIndex Host index (required) */ - public function setHostIndex($host_index) + public function setHostIndex($hostIndex) { - $this->hostIndex = $host_index; + $this->hostIndex = $hostIndex; } /** * Get the host index * - * @return Host index + * @return int Host index */ public function getHostIndex() { @@ -131,7 +154,7 @@ public function listExportsWithHttpInfo() "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } @@ -156,7 +179,7 @@ public function listExportsWithHttpInfo() if ('\MuxPhp\Models\ListExportsResponse' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -171,7 +194,7 @@ public function listExportsWithHttpInfo() if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -236,7 +259,7 @@ function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -269,7 +292,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function listExportsRequest() + public function listExportsRequest() { $resourcePath = '/data/v1/exports'; @@ -282,8 +305,6 @@ protected function listExportsRequest() - // body params - $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -297,21 +318,17 @@ protected function listExportsRequest() } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -327,7 +344,7 @@ protected function listExportsRequest() // 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()); + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); } $defaultHeaders = []; @@ -341,11 +358,13 @@ protected function listExportsRequest() $headers ); - $queryParamsDirect = join('&', $queryParams); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + + // MUX: adds support for array params. + // TODO: future upstream? + $query = ObjectSerializer::buildBetterQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($queryParamsDirect ? "?{$queryParamsDirect}" : ''), + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); diff --git a/MuxPhp/Api/FiltersApi.php b/MuxPhp/Api/FiltersApi.php index 7df2dad..657ac7a 100644 --- a/MuxPhp/Api/FiltersApi.php +++ b/MuxPhp/Api/FiltersApi.php @@ -1,8 +1,29 @@ client = $client ?: new Client(); $this->config = $config ?: new Configuration(); $this->headerSelector = $selector ?: new HeaderSelector(); - $this->hostIndex = $host_index; + $this->hostIndex = $hostIndex; } /** * Set the host index * - * @param int $host_index Host index (required) + * @param int $hostIndex Host index (required) */ - public function setHostIndex($host_index) + public function setHostIndex($hostIndex) { - $this->hostIndex = $host_index; + $this->hostIndex = $hostIndex; } /** * Get the host index * - * @return Host index + * @return int Host index */ public function getHostIndex() { @@ -98,19 +121,18 @@ public function getConfig() * Lists values for a specific filter * * @param string $filter_id ID of the Filter (required) - * @param mixed[] $optionalParams An associative array of optional parameters which can be passed to this function: - * - 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) - * - filters string[] - Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. (optional) - * - timeframe string[] - Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. (optional) + * @param int $limit Number of items to include in the response (optional, default to 25) + * @param int $page Offset by this many pages, of the size of `limit` (optional, default to 1) + * @param string[] $filters Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. (optional) + * @param string[] $timeframe Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. (optional) * * @throws \MuxPhp\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \MuxPhp\Models\ListFilterValuesResponse */ - public function listFilterValues($filter_id, $optionalParams = []) + public function listFilterValues($filter_id, $limit = 25, $page = 1, $filters = null, $timeframe = null) { - list($response) = $this->listFilterValuesWithHttpInfo($filter_id, $optionalParams); + list($response) = $this->listFilterValuesWithHttpInfo($filter_id, $limit, $page, $filters, $timeframe); return $response; } @@ -120,19 +142,18 @@ public function listFilterValues($filter_id, $optionalParams = []) * Lists values for a specific filter * * @param string $filter_id ID of the Filter (required) - * @param mixed[] $optionalParams An associative array of optional parameters which can be passed to this function: - * - 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) - * - filters string[] - Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. (optional) - * - timeframe string[] - Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. (optional) + * @param int $limit Number of items to include in the response (optional, default to 25) + * @param int $page Offset by this many pages, of the size of `limit` (optional, default to 1) + * @param string[] $filters Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. (optional) + * @param string[] $timeframe Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. (optional) * * @throws \MuxPhp\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \MuxPhp\Models\ListFilterValuesResponse, HTTP status code, HTTP response headers (array of strings) */ - public function listFilterValuesWithHttpInfo($filter_id, $optionalParams = []) + public function listFilterValuesWithHttpInfo($filter_id, $limit = 25, $page = 1, $filters = null, $timeframe = null) { - $request = $this->listFilterValuesRequest($filter_id, $optionalParams); + $request = $this->listFilterValuesRequest($filter_id, $limit, $page, $filters, $timeframe); try { $options = $this->createHttpClientOption(); @@ -143,7 +164,7 @@ public function listFilterValuesWithHttpInfo($filter_id, $optionalParams = []) "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } @@ -168,7 +189,7 @@ public function listFilterValuesWithHttpInfo($filter_id, $optionalParams = []) if ('\MuxPhp\Models\ListFilterValuesResponse' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -183,7 +204,7 @@ public function listFilterValuesWithHttpInfo($filter_id, $optionalParams = []) if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -213,18 +234,17 @@ public function listFilterValuesWithHttpInfo($filter_id, $optionalParams = []) * Lists values for a specific filter * * @param string $filter_id ID of the Filter (required) - * @param mixed[] $optionalParams An associative array of optional parameters which can be passed to this function: - * - 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) - * - filters string[] - Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. (optional) - * - timeframe string[] - Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. (optional) + * @param int $limit Number of items to include in the response (optional, default to 25) + * @param int $page Offset by this many pages, of the size of `limit` (optional, default to 1) + * @param string[] $filters Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. (optional) + * @param string[] $timeframe Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function listFilterValuesAsync($filter_id, $optionalParams = []) + public function listFilterValuesAsync($filter_id, $limit = 25, $page = 1, $filters = null, $timeframe = null) { - return $this->listFilterValuesAsyncWithHttpInfo($filter_id, $optionalParams) + return $this->listFilterValuesAsyncWithHttpInfo($filter_id, $limit, $page, $filters, $timeframe) ->then( function ($response) { return $response[0]; @@ -238,19 +258,18 @@ function ($response) { * Lists values for a specific filter * * @param string $filter_id ID of the Filter (required) - * @param mixed[] $optionalParams An associative array of optional parameters which can be passed to this function: - * - 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) - * - filters string[] - Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. (optional) - * - timeframe string[] - Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. (optional) + * @param int $limit Number of items to include in the response (optional, default to 25) + * @param int $page Offset by this many pages, of the size of `limit` (optional, default to 1) + * @param string[] $filters Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. (optional) + * @param string[] $timeframe Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function listFilterValuesAsyncWithHttpInfo($filter_id, $optionalParams = []) + public function listFilterValuesAsyncWithHttpInfo($filter_id, $limit = 25, $page = 1, $filters = null, $timeframe = null) { $returnType = '\MuxPhp\Models\ListFilterValuesResponse'; - $request = $this->listFilterValuesRequest($filter_id, $optionalParams); + $request = $this->listFilterValuesRequest($filter_id, $limit, $page, $filters, $timeframe); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -260,7 +279,7 @@ function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -290,22 +309,16 @@ function ($exception) { * Create request for operation 'listFilterValues' * * @param string $filter_id ID of the Filter (required) - * @param mixed[] $optionalParams An associative array of optional parameters which can be passed to this function: - * - 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) - * - filters string[] - Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. (optional) - * - timeframe string[] - Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. (optional) + * @param int $limit Number of items to include in the response (optional, default to 25) + * @param int $page Offset by this many pages, of the size of `limit` (optional, default to 1) + * @param string[] $filters Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. (optional) + * @param string[] $timeframe Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function listFilterValuesRequest($filter_id, $optionalParams) + public function listFilterValuesRequest($filter_id, $limit = 25, $page = 1, $filters = null, $timeframe = null) { - // Pull the set optional params from the associative array $optionalParams, setting them to their defaults if they're not set. - $limit = array_key_exists('limit', $optionalParams) ? $optionalParams['limit'] : 25; - $page = array_key_exists('page', $optionalParams) ? $optionalParams['page'] : 1; - $filters = array_key_exists('filters', $optionalParams) ? $optionalParams['filters'] : null; - $timeframe = array_key_exists('timeframe', $optionalParams) ? $optionalParams['timeframe'] : null; // verify the required parameter 'filter_id' is set if ($filter_id === null || (is_array($filter_id) && count($filter_id) === 0)) { throw new \InvalidArgumentException( @@ -322,32 +335,46 @@ protected function listFilterValuesRequest($filter_id, $optionalParams) // Query Param: limit if ($limit !== null) { - array_push($queryParams, 'limit=' . ObjectSerializer::toQueryValue($limit)); + if('form' === 'form' && is_array($limit)) { + foreach($limit as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['limit'] = $limit; + } } // Query Param: page if ($page !== null) { - array_push($queryParams, 'page=' . ObjectSerializer::toQueryValue($page)); + if('form' === 'form' && is_array($page)) { + foreach($page as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['page'] = $page; + } } - // Query Param: filters[] + // Query Param: filters if ($filters !== null) { if (is_array($filters)) { foreach ($filters as $p) { - array_push($queryParams, "filters[]=$p"); + array_push($queryParams, "filters=$p"); } } else { - throw new \InvalidArgumentException('Did not receive an array when expecting one for query parameter filters[]'); + throw new \InvalidArgumentException('Did not receive an array when expecting one for query parameter filters'); } } - // Query Param: timeframe[] + // Query Param: timeframe if ($timeframe !== null) { if (is_array($timeframe)) { foreach ($timeframe as $p) { - array_push($queryParams, "timeframe[]=$p"); + array_push($queryParams, "timeframe=$p"); } } else { - throw new \InvalidArgumentException('Did not receive an array when expecting one for query parameter timeframe[]'); + throw new \InvalidArgumentException('Did not receive an array when expecting one for query parameter timeframe'); } } @@ -361,8 +388,6 @@ protected function listFilterValuesRequest($filter_id, $optionalParams) ); } - // body params - $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -376,21 +401,17 @@ protected function listFilterValuesRequest($filter_id, $optionalParams) } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -406,7 +427,7 @@ protected function listFilterValuesRequest($filter_id, $optionalParams) // 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()); + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); } $defaultHeaders = []; @@ -420,11 +441,13 @@ protected function listFilterValuesRequest($filter_id, $optionalParams) $headers ); - $queryParamsDirect = join('&', $queryParams); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + + // MUX: adds support for array params. + // TODO: future upstream? + $query = ObjectSerializer::buildBetterQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($queryParamsDirect ? "?{$queryParamsDirect}" : ''), + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -469,7 +492,7 @@ public function listFiltersWithHttpInfo() "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } @@ -494,7 +517,7 @@ public function listFiltersWithHttpInfo() if ('\MuxPhp\Models\ListFiltersResponse' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -509,7 +532,7 @@ public function listFiltersWithHttpInfo() if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -574,7 +597,7 @@ function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -607,7 +630,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function listFiltersRequest() + public function listFiltersRequest() { $resourcePath = '/data/v1/filters'; @@ -620,8 +643,6 @@ protected function listFiltersRequest() - // body params - $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -635,21 +656,17 @@ protected function listFiltersRequest() } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -665,7 +682,7 @@ protected function listFiltersRequest() // 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()); + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); } $defaultHeaders = []; @@ -679,11 +696,13 @@ protected function listFiltersRequest() $headers ); - $queryParamsDirect = join('&', $queryParams); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + + // MUX: adds support for array params. + // TODO: future upstream? + $query = ObjectSerializer::buildBetterQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($queryParamsDirect ? "?{$queryParamsDirect}" : ''), + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); diff --git a/MuxPhp/Api/IncidentsApi.php b/MuxPhp/Api/IncidentsApi.php index 6c45e40..82543a8 100644 --- a/MuxPhp/Api/IncidentsApi.php +++ b/MuxPhp/Api/IncidentsApi.php @@ -1,8 +1,29 @@ client = $client ?: new Client(); $this->config = $config ?: new Configuration(); $this->headerSelector = $selector ?: new HeaderSelector(); - $this->hostIndex = $host_index; + $this->hostIndex = $hostIndex; } /** * Set the host index * - * @param int $host_index Host index (required) + * @param int $hostIndex Host index (required) */ - public function setHostIndex($host_index) + public function setHostIndex($hostIndex) { - $this->hostIndex = $host_index; + $this->hostIndex = $hostIndex; } /** * Get the host index * - * @return Host index + * @return int Host index */ public function getHostIndex() { @@ -133,7 +156,7 @@ public function getIncidentWithHttpInfo($incident_id) "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } @@ -158,7 +181,7 @@ public function getIncidentWithHttpInfo($incident_id) if ('\MuxPhp\Models\IncidentResponse' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -173,7 +196,7 @@ public function getIncidentWithHttpInfo($incident_id) if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -240,7 +263,7 @@ function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -274,7 +297,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getIncidentRequest($incident_id) + public function getIncidentRequest($incident_id) { // verify the required parameter 'incident_id' is set if ($incident_id === null || (is_array($incident_id) && count($incident_id) === 0)) { @@ -301,8 +324,6 @@ protected function getIncidentRequest($incident_id) ); } - // body params - $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -316,21 +337,17 @@ protected function getIncidentRequest($incident_id) } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -346,7 +363,7 @@ protected function getIncidentRequest($incident_id) // 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()); + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); } $defaultHeaders = []; @@ -360,11 +377,13 @@ protected function getIncidentRequest($incident_id) $headers ); - $queryParamsDirect = join('&', $queryParams); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + + // MUX: adds support for array params. + // TODO: future upstream? + $query = ObjectSerializer::buildBetterQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($queryParamsDirect ? "?{$queryParamsDirect}" : ''), + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -375,21 +394,20 @@ protected function getIncidentRequest($incident_id) * * List Incidents * - * @param mixed[] $optionalParams An associative array of optional parameters which can be passed to this function: - * - 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) - * - order_by string - Value to order the results by (optional) - * - order_direction string - Sort order. (optional) - * - status string - Status to filter incidents by (optional) - * - severity string - Severity to filter incidents by (optional) + * @param int $limit Number of items to include in the response (optional, default to 25) + * @param int $page Offset by this many pages, of the size of `limit` (optional, default to 1) + * @param string $order_by Value to order the results by (optional) + * @param string $order_direction Sort order. (optional) + * @param string $status Status to filter incidents by (optional) + * @param string $severity Severity to filter incidents by (optional) * * @throws \MuxPhp\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \MuxPhp\Models\ListIncidentsResponse */ - public function listIncidents($optionalParams = []) + public function listIncidents($limit = 25, $page = 1, $order_by = null, $order_direction = null, $status = null, $severity = null) { - list($response) = $this->listIncidentsWithHttpInfo($optionalParams); + list($response) = $this->listIncidentsWithHttpInfo($limit, $page, $order_by, $order_direction, $status, $severity); return $response; } @@ -398,21 +416,20 @@ public function listIncidents($optionalParams = []) * * List Incidents * - * @param mixed[] $optionalParams An associative array of optional parameters which can be passed to this function: - * - 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) - * - order_by string - Value to order the results by (optional) - * - order_direction string - Sort order. (optional) - * - status string - Status to filter incidents by (optional) - * - severity string - Severity to filter incidents by (optional) + * @param int $limit Number of items to include in the response (optional, default to 25) + * @param int $page Offset by this many pages, of the size of `limit` (optional, default to 1) + * @param string $order_by Value to order the results by (optional) + * @param string $order_direction Sort order. (optional) + * @param string $status Status to filter incidents by (optional) + * @param string $severity Severity to filter incidents by (optional) * * @throws \MuxPhp\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \MuxPhp\Models\ListIncidentsResponse, HTTP status code, HTTP response headers (array of strings) */ - public function listIncidentsWithHttpInfo($optionalParams = []) + public function listIncidentsWithHttpInfo($limit = 25, $page = 1, $order_by = null, $order_direction = null, $status = null, $severity = null) { - $request = $this->listIncidentsRequest($optionalParams); + $request = $this->listIncidentsRequest($limit, $page, $order_by, $order_direction, $status, $severity); try { $options = $this->createHttpClientOption(); @@ -423,7 +440,7 @@ public function listIncidentsWithHttpInfo($optionalParams = []) "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } @@ -448,7 +465,7 @@ public function listIncidentsWithHttpInfo($optionalParams = []) if ('\MuxPhp\Models\ListIncidentsResponse' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -463,7 +480,7 @@ public function listIncidentsWithHttpInfo($optionalParams = []) if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -492,20 +509,19 @@ public function listIncidentsWithHttpInfo($optionalParams = []) * * List Incidents * - * @param mixed[] $optionalParams An associative array of optional parameters which can be passed to this function: - * - 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) - * - order_by string - Value to order the results by (optional) - * - order_direction string - Sort order. (optional) - * - status string - Status to filter incidents by (optional) - * - severity string - Severity to filter incidents by (optional) + * @param int $limit Number of items to include in the response (optional, default to 25) + * @param int $page Offset by this many pages, of the size of `limit` (optional, default to 1) + * @param string $order_by Value to order the results by (optional) + * @param string $order_direction Sort order. (optional) + * @param string $status Status to filter incidents by (optional) + * @param string $severity Severity to filter incidents by (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function listIncidentsAsync($optionalParams = []) + public function listIncidentsAsync($limit = 25, $page = 1, $order_by = null, $order_direction = null, $status = null, $severity = null) { - return $this->listIncidentsAsyncWithHttpInfo($optionalParams) + return $this->listIncidentsAsyncWithHttpInfo($limit, $page, $order_by, $order_direction, $status, $severity) ->then( function ($response) { return $response[0]; @@ -518,21 +534,20 @@ function ($response) { * * List Incidents * - * @param mixed[] $optionalParams An associative array of optional parameters which can be passed to this function: - * - 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) - * - order_by string - Value to order the results by (optional) - * - order_direction string - Sort order. (optional) - * - status string - Status to filter incidents by (optional) - * - severity string - Severity to filter incidents by (optional) + * @param int $limit Number of items to include in the response (optional, default to 25) + * @param int $page Offset by this many pages, of the size of `limit` (optional, default to 1) + * @param string $order_by Value to order the results by (optional) + * @param string $order_direction Sort order. (optional) + * @param string $status Status to filter incidents by (optional) + * @param string $severity Severity to filter incidents by (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function listIncidentsAsyncWithHttpInfo($optionalParams = []) + public function listIncidentsAsyncWithHttpInfo($limit = 25, $page = 1, $order_by = null, $order_direction = null, $status = null, $severity = null) { $returnType = '\MuxPhp\Models\ListIncidentsResponse'; - $request = $this->listIncidentsRequest($optionalParams); + $request = $this->listIncidentsRequest($limit, $page, $order_by, $order_direction, $status, $severity); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -542,7 +557,7 @@ function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -571,26 +586,18 @@ function ($exception) { /** * Create request for operation 'listIncidents' * - * @param mixed[] $optionalParams An associative array of optional parameters which can be passed to this function: - * - 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) - * - order_by string - Value to order the results by (optional) - * - order_direction string - Sort order. (optional) - * - status string - Status to filter incidents by (optional) - * - severity string - Severity to filter incidents by (optional) + * @param int $limit Number of items to include in the response (optional, default to 25) + * @param int $page Offset by this many pages, of the size of `limit` (optional, default to 1) + * @param string $order_by Value to order the results by (optional) + * @param string $order_direction Sort order. (optional) + * @param string $status Status to filter incidents by (optional) + * @param string $severity Severity to filter incidents by (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function listIncidentsRequest($optionalParams) + public function listIncidentsRequest($limit = 25, $page = 1, $order_by = null, $order_direction = null, $status = null, $severity = null) { - // Pull the set optional params from the associative array $optionalParams, setting them to their defaults if they're not set. - $limit = array_key_exists('limit', $optionalParams) ? $optionalParams['limit'] : 25; - $page = array_key_exists('page', $optionalParams) ? $optionalParams['page'] : 1; - $order_by = array_key_exists('order_by', $optionalParams) ? $optionalParams['order_by'] : null; - $order_direction = array_key_exists('order_direction', $optionalParams) ? $optionalParams['order_direction'] : null; - $status = array_key_exists('status', $optionalParams) ? $optionalParams['status'] : null; - $severity = array_key_exists('severity', $optionalParams) ? $optionalParams['severity'] : null; $resourcePath = '/data/v1/incidents'; $formParams = []; @@ -601,33 +608,73 @@ protected function listIncidentsRequest($optionalParams) // Query Param: limit if ($limit !== null) { - array_push($queryParams, 'limit=' . ObjectSerializer::toQueryValue($limit)); + if('form' === 'form' && is_array($limit)) { + foreach($limit as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['limit'] = $limit; + } } // Query Param: page if ($page !== null) { - array_push($queryParams, 'page=' . ObjectSerializer::toQueryValue($page)); + if('form' === 'form' && is_array($page)) { + foreach($page as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['page'] = $page; + } } // Query Param: order_by if ($order_by !== null) { - array_push($queryParams, 'order_by=' . ObjectSerializer::toQueryValue($order_by)); + if('form' === 'form' && is_array($order_by)) { + foreach($order_by as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['order_by'] = $order_by; + } } // Query Param: order_direction if ($order_direction !== null) { - array_push($queryParams, 'order_direction=' . ObjectSerializer::toQueryValue($order_direction)); + if('form' === 'form' && is_array($order_direction)) { + foreach($order_direction as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['order_direction'] = $order_direction; + } } // Query Param: status if ($status !== null) { - array_push($queryParams, 'status=' . ObjectSerializer::toQueryValue($status)); + if('form' === 'form' && is_array($status)) { + foreach($status as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['status'] = $status; + } } // Query Param: severity if ($severity !== null) { - array_push($queryParams, 'severity=' . ObjectSerializer::toQueryValue($severity)); + if('form' === 'form' && is_array($severity)) { + foreach($severity as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['severity'] = $severity; + } } - // body params - $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -641,21 +688,17 @@ protected function listIncidentsRequest($optionalParams) } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -671,7 +714,7 @@ protected function listIncidentsRequest($optionalParams) // 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()); + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); } $defaultHeaders = []; @@ -685,11 +728,13 @@ protected function listIncidentsRequest($optionalParams) $headers ); - $queryParamsDirect = join('&', $queryParams); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + + // MUX: adds support for array params. + // TODO: future upstream? + $query = ObjectSerializer::buildBetterQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($queryParamsDirect ? "?{$queryParamsDirect}" : ''), + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -701,19 +746,18 @@ protected function listIncidentsRequest($optionalParams) * List Related Incidents * * @param string $incident_id ID of the Incident (required) - * @param mixed[] $optionalParams An associative array of optional parameters which can be passed to this function: - * - 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) - * - order_by string - Value to order the results by (optional) - * - order_direction string - Sort order. (optional) + * @param int $limit Number of items to include in the response (optional, default to 25) + * @param int $page Offset by this many pages, of the size of `limit` (optional, default to 1) + * @param string $order_by Value to order the results by (optional) + * @param string $order_direction Sort order. (optional) * * @throws \MuxPhp\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \MuxPhp\Models\ListRelatedIncidentsResponse */ - public function listRelatedIncidents($incident_id, $optionalParams = []) + public function listRelatedIncidents($incident_id, $limit = 25, $page = 1, $order_by = null, $order_direction = null) { - list($response) = $this->listRelatedIncidentsWithHttpInfo($incident_id, $optionalParams); + list($response) = $this->listRelatedIncidentsWithHttpInfo($incident_id, $limit, $page, $order_by, $order_direction); return $response; } @@ -723,19 +767,18 @@ public function listRelatedIncidents($incident_id, $optionalParams = []) * List Related Incidents * * @param string $incident_id ID of the Incident (required) - * @param mixed[] $optionalParams An associative array of optional parameters which can be passed to this function: - * - 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) - * - order_by string - Value to order the results by (optional) - * - order_direction string - Sort order. (optional) + * @param int $limit Number of items to include in the response (optional, default to 25) + * @param int $page Offset by this many pages, of the size of `limit` (optional, default to 1) + * @param string $order_by Value to order the results by (optional) + * @param string $order_direction Sort order. (optional) * * @throws \MuxPhp\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \MuxPhp\Models\ListRelatedIncidentsResponse, HTTP status code, HTTP response headers (array of strings) */ - public function listRelatedIncidentsWithHttpInfo($incident_id, $optionalParams = []) + public function listRelatedIncidentsWithHttpInfo($incident_id, $limit = 25, $page = 1, $order_by = null, $order_direction = null) { - $request = $this->listRelatedIncidentsRequest($incident_id, $optionalParams); + $request = $this->listRelatedIncidentsRequest($incident_id, $limit, $page, $order_by, $order_direction); try { $options = $this->createHttpClientOption(); @@ -746,7 +789,7 @@ public function listRelatedIncidentsWithHttpInfo($incident_id, $optionalParams = "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } @@ -771,7 +814,7 @@ public function listRelatedIncidentsWithHttpInfo($incident_id, $optionalParams = if ('\MuxPhp\Models\ListRelatedIncidentsResponse' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -786,7 +829,7 @@ public function listRelatedIncidentsWithHttpInfo($incident_id, $optionalParams = if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -816,18 +859,17 @@ public function listRelatedIncidentsWithHttpInfo($incident_id, $optionalParams = * List Related Incidents * * @param string $incident_id ID of the Incident (required) - * @param mixed[] $optionalParams An associative array of optional parameters which can be passed to this function: - * - 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) - * - order_by string - Value to order the results by (optional) - * - order_direction string - Sort order. (optional) + * @param int $limit Number of items to include in the response (optional, default to 25) + * @param int $page Offset by this many pages, of the size of `limit` (optional, default to 1) + * @param string $order_by Value to order the results by (optional) + * @param string $order_direction Sort order. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function listRelatedIncidentsAsync($incident_id, $optionalParams = []) + public function listRelatedIncidentsAsync($incident_id, $limit = 25, $page = 1, $order_by = null, $order_direction = null) { - return $this->listRelatedIncidentsAsyncWithHttpInfo($incident_id, $optionalParams) + return $this->listRelatedIncidentsAsyncWithHttpInfo($incident_id, $limit, $page, $order_by, $order_direction) ->then( function ($response) { return $response[0]; @@ -841,19 +883,18 @@ function ($response) { * List Related Incidents * * @param string $incident_id ID of the Incident (required) - * @param mixed[] $optionalParams An associative array of optional parameters which can be passed to this function: - * - 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) - * - order_by string - Value to order the results by (optional) - * - order_direction string - Sort order. (optional) + * @param int $limit Number of items to include in the response (optional, default to 25) + * @param int $page Offset by this many pages, of the size of `limit` (optional, default to 1) + * @param string $order_by Value to order the results by (optional) + * @param string $order_direction Sort order. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function listRelatedIncidentsAsyncWithHttpInfo($incident_id, $optionalParams = []) + public function listRelatedIncidentsAsyncWithHttpInfo($incident_id, $limit = 25, $page = 1, $order_by = null, $order_direction = null) { $returnType = '\MuxPhp\Models\ListRelatedIncidentsResponse'; - $request = $this->listRelatedIncidentsRequest($incident_id, $optionalParams); + $request = $this->listRelatedIncidentsRequest($incident_id, $limit, $page, $order_by, $order_direction); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -863,7 +904,7 @@ function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -893,22 +934,16 @@ function ($exception) { * Create request for operation 'listRelatedIncidents' * * @param string $incident_id ID of the Incident (required) - * @param mixed[] $optionalParams An associative array of optional parameters which can be passed to this function: - * - 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) - * - order_by string - Value to order the results by (optional) - * - order_direction string - Sort order. (optional) + * @param int $limit Number of items to include in the response (optional, default to 25) + * @param int $page Offset by this many pages, of the size of `limit` (optional, default to 1) + * @param string $order_by Value to order the results by (optional) + * @param string $order_direction Sort order. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function listRelatedIncidentsRequest($incident_id, $optionalParams) + public function listRelatedIncidentsRequest($incident_id, $limit = 25, $page = 1, $order_by = null, $order_direction = null) { - // Pull the set optional params from the associative array $optionalParams, setting them to their defaults if they're not set. - $limit = array_key_exists('limit', $optionalParams) ? $optionalParams['limit'] : 25; - $page = array_key_exists('page', $optionalParams) ? $optionalParams['page'] : 1; - $order_by = array_key_exists('order_by', $optionalParams) ? $optionalParams['order_by'] : null; - $order_direction = array_key_exists('order_direction', $optionalParams) ? $optionalParams['order_direction'] : null; // verify the required parameter 'incident_id' is set if ($incident_id === null || (is_array($incident_id) && count($incident_id) === 0)) { throw new \InvalidArgumentException( @@ -925,19 +960,47 @@ protected function listRelatedIncidentsRequest($incident_id, $optionalParams) // Query Param: limit if ($limit !== null) { - array_push($queryParams, 'limit=' . ObjectSerializer::toQueryValue($limit)); + if('form' === 'form' && is_array($limit)) { + foreach($limit as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['limit'] = $limit; + } } // Query Param: page if ($page !== null) { - array_push($queryParams, 'page=' . ObjectSerializer::toQueryValue($page)); + if('form' === 'form' && is_array($page)) { + foreach($page as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['page'] = $page; + } } // Query Param: order_by if ($order_by !== null) { - array_push($queryParams, 'order_by=' . ObjectSerializer::toQueryValue($order_by)); + if('form' === 'form' && is_array($order_by)) { + foreach($order_by as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['order_by'] = $order_by; + } } // Query Param: order_direction if ($order_direction !== null) { - array_push($queryParams, 'order_direction=' . ObjectSerializer::toQueryValue($order_direction)); + if('form' === 'form' && is_array($order_direction)) { + foreach($order_direction as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['order_direction'] = $order_direction; + } } @@ -950,8 +1013,6 @@ protected function listRelatedIncidentsRequest($incident_id, $optionalParams) ); } - // body params - $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -965,21 +1026,17 @@ protected function listRelatedIncidentsRequest($incident_id, $optionalParams) } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -995,7 +1052,7 @@ protected function listRelatedIncidentsRequest($incident_id, $optionalParams) // 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()); + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); } $defaultHeaders = []; @@ -1009,11 +1066,13 @@ protected function listRelatedIncidentsRequest($incident_id, $optionalParams) $headers ); - $queryParamsDirect = join('&', $queryParams); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + + // MUX: adds support for array params. + // TODO: future upstream? + $query = ObjectSerializer::buildBetterQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($queryParamsDirect ? "?{$queryParamsDirect}" : ''), + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); diff --git a/MuxPhp/Api/LiveStreamsApi.php b/MuxPhp/Api/LiveStreamsApi.php index aede0b1..8035587 100644 --- a/MuxPhp/Api/LiveStreamsApi.php +++ b/MuxPhp/Api/LiveStreamsApi.php @@ -1,8 +1,29 @@ client = $client ?: new Client(); $this->config = $config ?: new Configuration(); $this->headerSelector = $selector ?: new HeaderSelector(); - $this->hostIndex = $host_index; + $this->hostIndex = $hostIndex; } /** * Set the host index * - * @param int $host_index Host index (required) + * @param int $hostIndex Host index (required) */ - public function setHostIndex($host_index) + public function setHostIndex($hostIndex) { - $this->hostIndex = $host_index; + $this->hostIndex = $hostIndex; } /** * Get the host index * - * @return Host index + * @return int Host index */ public function getHostIndex() { @@ -97,7 +120,7 @@ public function getConfig() * * Create a live stream * - * @param \MuxPhp\Models\CreateLiveStreamRequest $create_live_stream_request (required) + * @param \MuxPhp\Models\CreateLiveStreamRequest $create_live_stream_request create_live_stream_request (required) * * @throws \MuxPhp\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -133,7 +156,7 @@ public function createLiveStreamWithHttpInfo($create_live_stream_request) "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } @@ -158,7 +181,7 @@ public function createLiveStreamWithHttpInfo($create_live_stream_request) if ('\MuxPhp\Models\LiveStreamResponse' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -173,7 +196,7 @@ public function createLiveStreamWithHttpInfo($create_live_stream_request) if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -240,7 +263,7 @@ function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -274,7 +297,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function createLiveStreamRequest($create_live_stream_request) + public function createLiveStreamRequest($create_live_stream_request) { // verify the required parameter 'create_live_stream_request' is set if ($create_live_stream_request === null || (is_array($create_live_stream_request) && count($create_live_stream_request) === 0)) { @@ -293,11 +316,6 @@ protected function createLiveStreamRequest($create_live_stream_request) - // body params - $_tempBody = null; - if (isset($create_live_stream_request)) { - $_tempBody = $create_live_stream_request; - } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -311,21 +329,23 @@ protected function createLiveStreamRequest($create_live_stream_request) } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present + if (isset($create_live_stream_request)) { if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($create_live_stream_request)); } else { - $httpBody = $_tempBody; + $httpBody = $create_live_stream_request; } } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -341,7 +361,7 @@ protected function createLiveStreamRequest($create_live_stream_request) // 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()); + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); } $defaultHeaders = []; @@ -355,11 +375,13 @@ protected function createLiveStreamRequest($create_live_stream_request) $headers ); - $queryParamsDirect = join('&', $queryParams); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + + // MUX: adds support for array params. + // TODO: future upstream? + $query = ObjectSerializer::buildBetterQuery($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($queryParamsDirect ? "?{$queryParamsDirect}" : ''), + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -371,7 +393,7 @@ protected function createLiveStreamRequest($create_live_stream_request) * Create a live stream playback ID * * @param string $live_stream_id The live stream ID (required) - * @param \MuxPhp\Models\CreatePlaybackIDRequest $create_playback_id_request (required) + * @param \MuxPhp\Models\CreatePlaybackIDRequest $create_playback_id_request create_playback_id_request (required) * * @throws \MuxPhp\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -408,7 +430,7 @@ public function createLiveStreamPlaybackIdWithHttpInfo($live_stream_id, $create_ "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } @@ -433,7 +455,7 @@ public function createLiveStreamPlaybackIdWithHttpInfo($live_stream_id, $create_ if ('\MuxPhp\Models\CreatePlaybackIDResponse' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -448,7 +470,7 @@ public function createLiveStreamPlaybackIdWithHttpInfo($live_stream_id, $create_ if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -517,7 +539,7 @@ function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -552,7 +574,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function createLiveStreamPlaybackIdRequest($live_stream_id, $create_playback_id_request) + public function createLiveStreamPlaybackIdRequest($live_stream_id, $create_playback_id_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)) { @@ -585,11 +607,6 @@ protected function createLiveStreamPlaybackIdRequest($live_stream_id, $create_pl ); } - // body params - $_tempBody = null; - if (isset($create_playback_id_request)) { - $_tempBody = $create_playback_id_request; - } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -603,21 +620,23 @@ protected function createLiveStreamPlaybackIdRequest($live_stream_id, $create_pl } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present + if (isset($create_playback_id_request)) { if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($create_playback_id_request)); } else { - $httpBody = $_tempBody; + $httpBody = $create_playback_id_request; } } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -633,7 +652,7 @@ protected function createLiveStreamPlaybackIdRequest($live_stream_id, $create_pl // 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()); + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); } $defaultHeaders = []; @@ -647,11 +666,13 @@ protected function createLiveStreamPlaybackIdRequest($live_stream_id, $create_pl $headers ); - $queryParamsDirect = join('&', $queryParams); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + + // MUX: adds support for array params. + // TODO: future upstream? + $query = ObjectSerializer::buildBetterQuery($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($queryParamsDirect ? "?{$queryParamsDirect}" : ''), + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -663,7 +684,7 @@ protected function createLiveStreamPlaybackIdRequest($live_stream_id, $create_pl * Create a live stream simulcast target * * @param string $live_stream_id The live stream ID (required) - * @param \MuxPhp\Models\CreateSimulcastTargetRequest $create_simulcast_target_request (required) + * @param \MuxPhp\Models\CreateSimulcastTargetRequest $create_simulcast_target_request create_simulcast_target_request (required) * * @throws \MuxPhp\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -700,7 +721,7 @@ public function createLiveStreamSimulcastTargetWithHttpInfo($live_stream_id, $cr "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } @@ -725,7 +746,7 @@ public function createLiveStreamSimulcastTargetWithHttpInfo($live_stream_id, $cr if ('\MuxPhp\Models\SimulcastTargetResponse' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -740,7 +761,7 @@ public function createLiveStreamSimulcastTargetWithHttpInfo($live_stream_id, $cr if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -809,7 +830,7 @@ function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -844,7 +865,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function createLiveStreamSimulcastTargetRequest($live_stream_id, $create_simulcast_target_request) + public function createLiveStreamSimulcastTargetRequest($live_stream_id, $create_simulcast_target_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)) { @@ -877,11 +898,6 @@ protected function createLiveStreamSimulcastTargetRequest($live_stream_id, $crea ); } - // body params - $_tempBody = null; - if (isset($create_simulcast_target_request)) { - $_tempBody = $create_simulcast_target_request; - } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -895,21 +911,23 @@ protected function createLiveStreamSimulcastTargetRequest($live_stream_id, $crea } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present + if (isset($create_simulcast_target_request)) { if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($create_simulcast_target_request)); } else { - $httpBody = $_tempBody; + $httpBody = $create_simulcast_target_request; } } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -925,7 +943,7 @@ protected function createLiveStreamSimulcastTargetRequest($live_stream_id, $crea // 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()); + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); } $defaultHeaders = []; @@ -939,11 +957,13 @@ protected function createLiveStreamSimulcastTargetRequest($live_stream_id, $crea $headers ); - $queryParamsDirect = join('&', $queryParams); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + + // MUX: adds support for array params. + // TODO: future upstream? + $query = ObjectSerializer::buildBetterQuery($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($queryParamsDirect ? "?{$queryParamsDirect}" : ''), + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -989,7 +1009,7 @@ public function deleteLiveStreamWithHttpInfo($live_stream_id) "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } @@ -1083,7 +1103,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function deleteLiveStreamRequest($live_stream_id) + public function deleteLiveStreamRequest($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)) { @@ -1110,8 +1130,6 @@ protected function deleteLiveStreamRequest($live_stream_id) ); } - // body params - $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -1125,21 +1143,17 @@ protected function deleteLiveStreamRequest($live_stream_id) } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -1155,7 +1169,7 @@ protected function deleteLiveStreamRequest($live_stream_id) // 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()); + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); } $defaultHeaders = []; @@ -1169,11 +1183,13 @@ protected function deleteLiveStreamRequest($live_stream_id) $headers ); - $queryParamsDirect = join('&', $queryParams); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + + // MUX: adds support for array params. + // TODO: future upstream? + $query = ObjectSerializer::buildBetterQuery($queryParams); return new Request( 'DELETE', - $this->config->getHost() . $resourcePath . ($queryParamsDirect ? "?{$queryParamsDirect}" : ''), + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1221,7 +1237,7 @@ public function deleteLiveStreamPlaybackIdWithHttpInfo($live_stream_id, $playbac "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } @@ -1318,7 +1334,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function deleteLiveStreamPlaybackIdRequest($live_stream_id, $playback_id) + public function deleteLiveStreamPlaybackIdRequest($live_stream_id, $playback_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)) { @@ -1359,8 +1375,6 @@ protected function deleteLiveStreamPlaybackIdRequest($live_stream_id, $playback_ ); } - // body params - $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -1374,21 +1388,17 @@ protected function deleteLiveStreamPlaybackIdRequest($live_stream_id, $playback_ } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -1404,7 +1414,7 @@ protected function deleteLiveStreamPlaybackIdRequest($live_stream_id, $playback_ // 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()); + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); } $defaultHeaders = []; @@ -1418,11 +1428,13 @@ protected function deleteLiveStreamPlaybackIdRequest($live_stream_id, $playback_ $headers ); - $queryParamsDirect = join('&', $queryParams); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + + // MUX: adds support for array params. + // TODO: future upstream? + $query = ObjectSerializer::buildBetterQuery($queryParams); return new Request( 'DELETE', - $this->config->getHost() . $resourcePath . ($queryParamsDirect ? "?{$queryParamsDirect}" : ''), + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1470,7 +1482,7 @@ public function deleteLiveStreamSimulcastTargetWithHttpInfo($live_stream_id, $si "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } @@ -1567,7 +1579,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function deleteLiveStreamSimulcastTargetRequest($live_stream_id, $simulcast_target_id) + public function deleteLiveStreamSimulcastTargetRequest($live_stream_id, $simulcast_target_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)) { @@ -1608,8 +1620,6 @@ protected function deleteLiveStreamSimulcastTargetRequest($live_stream_id, $simu ); } - // body params - $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -1623,21 +1633,17 @@ protected function deleteLiveStreamSimulcastTargetRequest($live_stream_id, $simu } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -1653,7 +1659,7 @@ protected function deleteLiveStreamSimulcastTargetRequest($live_stream_id, $simu // 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()); + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); } $defaultHeaders = []; @@ -1667,11 +1673,13 @@ protected function deleteLiveStreamSimulcastTargetRequest($live_stream_id, $simu $headers ); - $queryParamsDirect = join('&', $queryParams); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + + // MUX: adds support for array params. + // TODO: future upstream? + $query = ObjectSerializer::buildBetterQuery($queryParams); return new Request( 'DELETE', - $this->config->getHost() . $resourcePath . ($queryParamsDirect ? "?{$queryParamsDirect}" : ''), + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1718,7 +1726,7 @@ public function disableLiveStreamWithHttpInfo($live_stream_id) "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } @@ -1743,7 +1751,7 @@ public function disableLiveStreamWithHttpInfo($live_stream_id) if ('\MuxPhp\Models\DisableLiveStreamResponse' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -1758,7 +1766,7 @@ public function disableLiveStreamWithHttpInfo($live_stream_id) if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -1825,7 +1833,7 @@ function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -1859,7 +1867,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function disableLiveStreamRequest($live_stream_id) + public function disableLiveStreamRequest($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)) { @@ -1886,8 +1894,6 @@ protected function disableLiveStreamRequest($live_stream_id) ); } - // body params - $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -1901,21 +1907,17 @@ protected function disableLiveStreamRequest($live_stream_id) } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -1931,7 +1933,7 @@ protected function disableLiveStreamRequest($live_stream_id) // 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()); + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); } $defaultHeaders = []; @@ -1945,11 +1947,13 @@ protected function disableLiveStreamRequest($live_stream_id) $headers ); - $queryParamsDirect = join('&', $queryParams); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + + // MUX: adds support for array params. + // TODO: future upstream? + $query = ObjectSerializer::buildBetterQuery($queryParams); return new Request( 'PUT', - $this->config->getHost() . $resourcePath . ($queryParamsDirect ? "?{$queryParamsDirect}" : ''), + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1996,7 +2000,7 @@ public function enableLiveStreamWithHttpInfo($live_stream_id) "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } @@ -2021,7 +2025,7 @@ public function enableLiveStreamWithHttpInfo($live_stream_id) if ('\MuxPhp\Models\EnableLiveStreamResponse' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -2036,7 +2040,7 @@ public function enableLiveStreamWithHttpInfo($live_stream_id) if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -2103,7 +2107,7 @@ function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -2137,7 +2141,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function enableLiveStreamRequest($live_stream_id) + public function enableLiveStreamRequest($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)) { @@ -2164,8 +2168,6 @@ protected function enableLiveStreamRequest($live_stream_id) ); } - // body params - $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -2179,21 +2181,17 @@ protected function enableLiveStreamRequest($live_stream_id) } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -2209,7 +2207,7 @@ protected function enableLiveStreamRequest($live_stream_id) // 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()); + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); } $defaultHeaders = []; @@ -2223,11 +2221,13 @@ protected function enableLiveStreamRequest($live_stream_id) $headers ); - $queryParamsDirect = join('&', $queryParams); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + + // MUX: adds support for array params. + // TODO: future upstream? + $query = ObjectSerializer::buildBetterQuery($queryParams); return new Request( 'PUT', - $this->config->getHost() . $resourcePath . ($queryParamsDirect ? "?{$queryParamsDirect}" : ''), + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -2274,7 +2274,7 @@ public function getLiveStreamWithHttpInfo($live_stream_id) "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } @@ -2299,7 +2299,7 @@ public function getLiveStreamWithHttpInfo($live_stream_id) if ('\MuxPhp\Models\LiveStreamResponse' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -2314,7 +2314,7 @@ public function getLiveStreamWithHttpInfo($live_stream_id) if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -2381,7 +2381,7 @@ function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -2415,7 +2415,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getLiveStreamRequest($live_stream_id) + public function getLiveStreamRequest($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)) { @@ -2442,8 +2442,6 @@ protected function getLiveStreamRequest($live_stream_id) ); } - // body params - $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -2457,21 +2455,17 @@ protected function getLiveStreamRequest($live_stream_id) } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -2487,7 +2481,7 @@ protected function getLiveStreamRequest($live_stream_id) // 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()); + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); } $defaultHeaders = []; @@ -2501,11 +2495,13 @@ protected function getLiveStreamRequest($live_stream_id) $headers ); - $queryParamsDirect = join('&', $queryParams); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + + // MUX: adds support for array params. + // TODO: future upstream? + $query = ObjectSerializer::buildBetterQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($queryParamsDirect ? "?{$queryParamsDirect}" : ''), + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -2554,7 +2550,7 @@ public function getLiveStreamSimulcastTargetWithHttpInfo($live_stream_id, $simul "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } @@ -2579,7 +2575,7 @@ public function getLiveStreamSimulcastTargetWithHttpInfo($live_stream_id, $simul if ('\MuxPhp\Models\SimulcastTargetResponse' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -2594,7 +2590,7 @@ public function getLiveStreamSimulcastTargetWithHttpInfo($live_stream_id, $simul if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -2663,7 +2659,7 @@ function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -2698,7 +2694,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getLiveStreamSimulcastTargetRequest($live_stream_id, $simulcast_target_id) + public function getLiveStreamSimulcastTargetRequest($live_stream_id, $simulcast_target_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)) { @@ -2739,8 +2735,6 @@ protected function getLiveStreamSimulcastTargetRequest($live_stream_id, $simulca ); } - // body params - $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -2754,21 +2748,17 @@ protected function getLiveStreamSimulcastTargetRequest($live_stream_id, $simulca } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -2784,7 +2774,7 @@ protected function getLiveStreamSimulcastTargetRequest($live_stream_id, $simulca // 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()); + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); } $defaultHeaders = []; @@ -2798,11 +2788,13 @@ protected function getLiveStreamSimulcastTargetRequest($live_stream_id, $simulca $headers ); - $queryParamsDirect = join('&', $queryParams); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + + // MUX: adds support for array params. + // TODO: future upstream? + $query = ObjectSerializer::buildBetterQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($queryParamsDirect ? "?{$queryParamsDirect}" : ''), + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -2813,17 +2805,16 @@ protected function getLiveStreamSimulcastTargetRequest($live_stream_id, $simulca * * List live streams * - * @param mixed[] $optionalParams An associative array of optional parameters which can be passed to this function: - * - 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) + * @param int $limit Number of items to include in the response (optional, default to 25) + * @param int $page Offset by this many pages, of the size of `limit` (optional, default to 1) * * @throws \MuxPhp\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \MuxPhp\Models\ListLiveStreamsResponse */ - public function listLiveStreams($optionalParams = []) + public function listLiveStreams($limit = 25, $page = 1) { - list($response) = $this->listLiveStreamsWithHttpInfo($optionalParams); + list($response) = $this->listLiveStreamsWithHttpInfo($limit, $page); return $response; } @@ -2832,17 +2823,16 @@ public function listLiveStreams($optionalParams = []) * * List live streams * - * @param mixed[] $optionalParams An associative array of optional parameters which can be passed to this function: - * - 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) + * @param int $limit Number of items to include in the response (optional, default to 25) + * @param int $page Offset by this many pages, of the size of `limit` (optional, default to 1) * * @throws \MuxPhp\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \MuxPhp\Models\ListLiveStreamsResponse, HTTP status code, HTTP response headers (array of strings) */ - public function listLiveStreamsWithHttpInfo($optionalParams = []) + public function listLiveStreamsWithHttpInfo($limit = 25, $page = 1) { - $request = $this->listLiveStreamsRequest($optionalParams); + $request = $this->listLiveStreamsRequest($limit, $page); try { $options = $this->createHttpClientOption(); @@ -2853,7 +2843,7 @@ public function listLiveStreamsWithHttpInfo($optionalParams = []) "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } @@ -2878,7 +2868,7 @@ public function listLiveStreamsWithHttpInfo($optionalParams = []) if ('\MuxPhp\Models\ListLiveStreamsResponse' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -2893,7 +2883,7 @@ public function listLiveStreamsWithHttpInfo($optionalParams = []) if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -2922,16 +2912,15 @@ public function listLiveStreamsWithHttpInfo($optionalParams = []) * * List live streams * - * @param mixed[] $optionalParams An associative array of optional parameters which can be passed to this function: - * - 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) + * @param int $limit Number of items to include in the response (optional, default to 25) + * @param int $page Offset by this many pages, of the size of `limit` (optional, default to 1) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function listLiveStreamsAsync($optionalParams = []) + public function listLiveStreamsAsync($limit = 25, $page = 1) { - return $this->listLiveStreamsAsyncWithHttpInfo($optionalParams) + return $this->listLiveStreamsAsyncWithHttpInfo($limit, $page) ->then( function ($response) { return $response[0]; @@ -2944,17 +2933,16 @@ function ($response) { * * List live streams * - * @param mixed[] $optionalParams An associative array of optional parameters which can be passed to this function: - * - 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) + * @param int $limit Number of items to include in the response (optional, default to 25) + * @param int $page Offset by this many pages, of the size of `limit` (optional, default to 1) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function listLiveStreamsAsyncWithHttpInfo($optionalParams = []) + public function listLiveStreamsAsyncWithHttpInfo($limit = 25, $page = 1) { $returnType = '\MuxPhp\Models\ListLiveStreamsResponse'; - $request = $this->listLiveStreamsRequest($optionalParams); + $request = $this->listLiveStreamsRequest($limit, $page); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2964,7 +2952,7 @@ function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -2993,18 +2981,14 @@ function ($exception) { /** * Create request for operation 'listLiveStreams' * - * @param mixed[] $optionalParams An associative array of optional parameters which can be passed to this function: - * - 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) + * @param int $limit Number of items to include in the response (optional, default to 25) + * @param int $page Offset by this many pages, of the size of `limit` (optional, default to 1) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function listLiveStreamsRequest($optionalParams) + public function listLiveStreamsRequest($limit = 25, $page = 1) { - // Pull the set optional params from the associative array $optionalParams, setting them to their defaults if they're not set. - $limit = array_key_exists('limit', $optionalParams) ? $optionalParams['limit'] : 25; - $page = array_key_exists('page', $optionalParams) ? $optionalParams['page'] : 1; $resourcePath = '/video/v1/live-streams'; $formParams = []; @@ -3015,17 +2999,29 @@ protected function listLiveStreamsRequest($optionalParams) // Query Param: limit if ($limit !== null) { - array_push($queryParams, 'limit=' . ObjectSerializer::toQueryValue($limit)); + if('form' === 'form' && is_array($limit)) { + foreach($limit as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['limit'] = $limit; + } } // Query Param: page if ($page !== null) { - array_push($queryParams, 'page=' . ObjectSerializer::toQueryValue($page)); + if('form' === 'form' && is_array($page)) { + foreach($page as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['page'] = $page; + } } - // body params - $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -3039,21 +3035,17 @@ protected function listLiveStreamsRequest($optionalParams) } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -3069,7 +3061,7 @@ protected function listLiveStreamsRequest($optionalParams) // 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()); + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); } $defaultHeaders = []; @@ -3083,11 +3075,13 @@ protected function listLiveStreamsRequest($optionalParams) $headers ); - $queryParamsDirect = join('&', $queryParams); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + + // MUX: adds support for array params. + // TODO: future upstream? + $query = ObjectSerializer::buildBetterQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($queryParamsDirect ? "?{$queryParamsDirect}" : ''), + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -3134,7 +3128,7 @@ public function resetStreamKeyWithHttpInfo($live_stream_id) "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } @@ -3159,7 +3153,7 @@ public function resetStreamKeyWithHttpInfo($live_stream_id) if ('\MuxPhp\Models\LiveStreamResponse' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -3174,7 +3168,7 @@ public function resetStreamKeyWithHttpInfo($live_stream_id) if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -3241,7 +3235,7 @@ function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -3275,7 +3269,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function resetStreamKeyRequest($live_stream_id) + public function resetStreamKeyRequest($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)) { @@ -3302,8 +3296,6 @@ protected function resetStreamKeyRequest($live_stream_id) ); } - // body params - $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -3317,21 +3309,17 @@ protected function resetStreamKeyRequest($live_stream_id) } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -3347,7 +3335,7 @@ protected function resetStreamKeyRequest($live_stream_id) // 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()); + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); } $defaultHeaders = []; @@ -3361,11 +3349,13 @@ protected function resetStreamKeyRequest($live_stream_id) $headers ); - $queryParamsDirect = join('&', $queryParams); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + + // MUX: adds support for array params. + // TODO: future upstream? + $query = ObjectSerializer::buildBetterQuery($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($queryParamsDirect ? "?{$queryParamsDirect}" : ''), + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -3412,7 +3402,7 @@ public function signalLiveStreamCompleteWithHttpInfo($live_stream_id) "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } @@ -3437,7 +3427,7 @@ public function signalLiveStreamCompleteWithHttpInfo($live_stream_id) if ('\MuxPhp\Models\SignalLiveStreamCompleteResponse' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -3452,7 +3442,7 @@ public function signalLiveStreamCompleteWithHttpInfo($live_stream_id) if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -3519,7 +3509,7 @@ function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -3553,7 +3543,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function signalLiveStreamCompleteRequest($live_stream_id) + public function signalLiveStreamCompleteRequest($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)) { @@ -3580,8 +3570,6 @@ protected function signalLiveStreamCompleteRequest($live_stream_id) ); } - // body params - $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -3595,21 +3583,17 @@ protected function signalLiveStreamCompleteRequest($live_stream_id) } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -3625,7 +3609,7 @@ protected function signalLiveStreamCompleteRequest($live_stream_id) // 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()); + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); } $defaultHeaders = []; @@ -3639,11 +3623,13 @@ protected function signalLiveStreamCompleteRequest($live_stream_id) $headers ); - $queryParamsDirect = join('&', $queryParams); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + + // MUX: adds support for array params. + // TODO: future upstream? + $query = ObjectSerializer::buildBetterQuery($queryParams); return new Request( 'PUT', - $this->config->getHost() . $resourcePath . ($queryParamsDirect ? "?{$queryParamsDirect}" : ''), + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); diff --git a/MuxPhp/Api/MetricsApi.php b/MuxPhp/Api/MetricsApi.php index 123a683..6c9a9c3 100644 --- a/MuxPhp/Api/MetricsApi.php +++ b/MuxPhp/Api/MetricsApi.php @@ -1,8 +1,29 @@ client = $client ?: new Client(); $this->config = $config ?: new Configuration(); $this->headerSelector = $selector ?: new HeaderSelector(); - $this->hostIndex = $host_index; + $this->hostIndex = $hostIndex; } /** * Set the host index * - * @param int $host_index Host index (required) + * @param int $hostIndex Host index (required) */ - public function setHostIndex($host_index) + public function setHostIndex($hostIndex) { - $this->hostIndex = $host_index; + $this->hostIndex = $hostIndex; } /** * Get the host index * - * @return Host index + * @return int Host index */ public function getHostIndex() { @@ -98,20 +121,19 @@ public function getConfig() * Get metric timeseries data * * @param string $metric_id ID of the Metric (required) - * @param mixed[] $optionalParams An associative array of optional parameters which can be passed to this function: - * - timeframe string[] - Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. (optional) - * - filters string[] - Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. (optional) - * - measurement string - Measurement for the provided metric. If omitted, the deafult for the metric will be used. (optional) - * - order_direction string - Sort order. (optional) - * - group_by string - Time granularity to group results by. If this value is omitted, a default granularity is chosen based on the supplied timeframe. (optional) + * @param string[] $timeframe Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. (optional) + * @param string[] $filters Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. (optional) + * @param string $measurement Measurement for the provided metric. If omitted, the deafult for the metric will be used. (optional) + * @param string $order_direction Sort order. (optional) + * @param string $group_by Time granularity to group results by. If this value is omitted, a default granularity is chosen based on the supplied timeframe. (optional) * * @throws \MuxPhp\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \MuxPhp\Models\GetMetricTimeseriesDataResponse */ - public function getMetricTimeseriesData($metric_id, $optionalParams = []) + public function getMetricTimeseriesData($metric_id, $timeframe = null, $filters = null, $measurement = null, $order_direction = null, $group_by = null) { - list($response) = $this->getMetricTimeseriesDataWithHttpInfo($metric_id, $optionalParams); + list($response) = $this->getMetricTimeseriesDataWithHttpInfo($metric_id, $timeframe, $filters, $measurement, $order_direction, $group_by); return $response; } @@ -121,20 +143,19 @@ public function getMetricTimeseriesData($metric_id, $optionalParams = []) * Get metric timeseries data * * @param string $metric_id ID of the Metric (required) - * @param mixed[] $optionalParams An associative array of optional parameters which can be passed to this function: - * - timeframe string[] - Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. (optional) - * - filters string[] - Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. (optional) - * - measurement string - Measurement for the provided metric. If omitted, the deafult for the metric will be used. (optional) - * - order_direction string - Sort order. (optional) - * - group_by string - Time granularity to group results by. If this value is omitted, a default granularity is chosen based on the supplied timeframe. (optional) + * @param string[] $timeframe Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. (optional) + * @param string[] $filters Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. (optional) + * @param string $measurement Measurement for the provided metric. If omitted, the deafult for the metric will be used. (optional) + * @param string $order_direction Sort order. (optional) + * @param string $group_by Time granularity to group results by. If this value is omitted, a default granularity is chosen based on the supplied timeframe. (optional) * * @throws \MuxPhp\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \MuxPhp\Models\GetMetricTimeseriesDataResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getMetricTimeseriesDataWithHttpInfo($metric_id, $optionalParams = []) + public function getMetricTimeseriesDataWithHttpInfo($metric_id, $timeframe = null, $filters = null, $measurement = null, $order_direction = null, $group_by = null) { - $request = $this->getMetricTimeseriesDataRequest($metric_id, $optionalParams); + $request = $this->getMetricTimeseriesDataRequest($metric_id, $timeframe, $filters, $measurement, $order_direction, $group_by); try { $options = $this->createHttpClientOption(); @@ -145,7 +166,7 @@ public function getMetricTimeseriesDataWithHttpInfo($metric_id, $optionalParams "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } @@ -170,7 +191,7 @@ public function getMetricTimeseriesDataWithHttpInfo($metric_id, $optionalParams if ('\MuxPhp\Models\GetMetricTimeseriesDataResponse' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -185,7 +206,7 @@ public function getMetricTimeseriesDataWithHttpInfo($metric_id, $optionalParams if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -215,19 +236,18 @@ public function getMetricTimeseriesDataWithHttpInfo($metric_id, $optionalParams * Get metric timeseries data * * @param string $metric_id ID of the Metric (required) - * @param mixed[] $optionalParams An associative array of optional parameters which can be passed to this function: - * - timeframe string[] - Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. (optional) - * - filters string[] - Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. (optional) - * - measurement string - Measurement for the provided metric. If omitted, the deafult for the metric will be used. (optional) - * - order_direction string - Sort order. (optional) - * - group_by string - Time granularity to group results by. If this value is omitted, a default granularity is chosen based on the supplied timeframe. (optional) + * @param string[] $timeframe Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. (optional) + * @param string[] $filters Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. (optional) + * @param string $measurement Measurement for the provided metric. If omitted, the deafult for the metric will be used. (optional) + * @param string $order_direction Sort order. (optional) + * @param string $group_by Time granularity to group results by. If this value is omitted, a default granularity is chosen based on the supplied timeframe. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getMetricTimeseriesDataAsync($metric_id, $optionalParams = []) + public function getMetricTimeseriesDataAsync($metric_id, $timeframe = null, $filters = null, $measurement = null, $order_direction = null, $group_by = null) { - return $this->getMetricTimeseriesDataAsyncWithHttpInfo($metric_id, $optionalParams) + return $this->getMetricTimeseriesDataAsyncWithHttpInfo($metric_id, $timeframe, $filters, $measurement, $order_direction, $group_by) ->then( function ($response) { return $response[0]; @@ -241,20 +261,19 @@ function ($response) { * Get metric timeseries data * * @param string $metric_id ID of the Metric (required) - * @param mixed[] $optionalParams An associative array of optional parameters which can be passed to this function: - * - timeframe string[] - Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. (optional) - * - filters string[] - Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. (optional) - * - measurement string - Measurement for the provided metric. If omitted, the deafult for the metric will be used. (optional) - * - order_direction string - Sort order. (optional) - * - group_by string - Time granularity to group results by. If this value is omitted, a default granularity is chosen based on the supplied timeframe. (optional) + * @param string[] $timeframe Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. (optional) + * @param string[] $filters Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. (optional) + * @param string $measurement Measurement for the provided metric. If omitted, the deafult for the metric will be used. (optional) + * @param string $order_direction Sort order. (optional) + * @param string $group_by Time granularity to group results by. If this value is omitted, a default granularity is chosen based on the supplied timeframe. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getMetricTimeseriesDataAsyncWithHttpInfo($metric_id, $optionalParams = []) + public function getMetricTimeseriesDataAsyncWithHttpInfo($metric_id, $timeframe = null, $filters = null, $measurement = null, $order_direction = null, $group_by = null) { $returnType = '\MuxPhp\Models\GetMetricTimeseriesDataResponse'; - $request = $this->getMetricTimeseriesDataRequest($metric_id, $optionalParams); + $request = $this->getMetricTimeseriesDataRequest($metric_id, $timeframe, $filters, $measurement, $order_direction, $group_by); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -264,7 +283,7 @@ function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -294,24 +313,17 @@ function ($exception) { * Create request for operation 'getMetricTimeseriesData' * * @param string $metric_id ID of the Metric (required) - * @param mixed[] $optionalParams An associative array of optional parameters which can be passed to this function: - * - timeframe string[] - Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. (optional) - * - filters string[] - Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. (optional) - * - measurement string - Measurement for the provided metric. If omitted, the deafult for the metric will be used. (optional) - * - order_direction string - Sort order. (optional) - * - group_by string - Time granularity to group results by. If this value is omitted, a default granularity is chosen based on the supplied timeframe. (optional) + * @param string[] $timeframe Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. (optional) + * @param string[] $filters Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. (optional) + * @param string $measurement Measurement for the provided metric. If omitted, the deafult for the metric will be used. (optional) + * @param string $order_direction Sort order. (optional) + * @param string $group_by Time granularity to group results by. If this value is omitted, a default granularity is chosen based on the supplied timeframe. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getMetricTimeseriesDataRequest($metric_id, $optionalParams) + public function getMetricTimeseriesDataRequest($metric_id, $timeframe = null, $filters = null, $measurement = null, $order_direction = null, $group_by = null) { - // Pull the set optional params from the associative array $optionalParams, setting them to their defaults if they're not set. - $timeframe = array_key_exists('timeframe', $optionalParams) ? $optionalParams['timeframe'] : null; - $filters = array_key_exists('filters', $optionalParams) ? $optionalParams['filters'] : null; - $measurement = array_key_exists('measurement', $optionalParams) ? $optionalParams['measurement'] : null; - $order_direction = array_key_exists('order_direction', $optionalParams) ? $optionalParams['order_direction'] : null; - $group_by = array_key_exists('group_by', $optionalParams) ? $optionalParams['group_by'] : null; // verify the required parameter 'metric_id' is set if ($metric_id === null || (is_array($metric_id) && count($metric_id) === 0)) { throw new \InvalidArgumentException( @@ -326,39 +338,60 @@ protected function getMetricTimeseriesDataRequest($metric_id, $optionalParams) $httpBody = ''; $multipart = false; - // Query Param: timeframe[] + // Query Param: timeframe if ($timeframe !== null) { if (is_array($timeframe)) { foreach ($timeframe as $p) { - array_push($queryParams, "timeframe[]=$p"); + array_push($queryParams, "timeframe=$p"); } } else { - throw new \InvalidArgumentException('Did not receive an array when expecting one for query parameter timeframe[]'); + throw new \InvalidArgumentException('Did not receive an array when expecting one for query parameter timeframe'); } } - // Query Param: filters[] + // Query Param: filters if ($filters !== null) { if (is_array($filters)) { foreach ($filters as $p) { - array_push($queryParams, "filters[]=$p"); + array_push($queryParams, "filters=$p"); } } else { - throw new \InvalidArgumentException('Did not receive an array when expecting one for query parameter filters[]'); + throw new \InvalidArgumentException('Did not receive an array when expecting one for query parameter filters'); } } // Query Param: measurement if ($measurement !== null) { - array_push($queryParams, 'measurement=' . ObjectSerializer::toQueryValue($measurement)); + if('form' === 'form' && is_array($measurement)) { + foreach($measurement as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['measurement'] = $measurement; + } } // Query Param: order_direction if ($order_direction !== null) { - array_push($queryParams, 'order_direction=' . ObjectSerializer::toQueryValue($order_direction)); + if('form' === 'form' && is_array($order_direction)) { + foreach($order_direction as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['order_direction'] = $order_direction; + } } // Query Param: group_by if ($group_by !== null) { - array_push($queryParams, 'group_by=' . ObjectSerializer::toQueryValue($group_by)); + if('form' === 'form' && is_array($group_by)) { + foreach($group_by as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['group_by'] = $group_by; + } } @@ -371,8 +404,6 @@ protected function getMetricTimeseriesDataRequest($metric_id, $optionalParams) ); } - // body params - $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -386,21 +417,17 @@ protected function getMetricTimeseriesDataRequest($metric_id, $optionalParams) } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -416,7 +443,7 @@ protected function getMetricTimeseriesDataRequest($metric_id, $optionalParams) // 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()); + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); } $defaultHeaders = []; @@ -430,11 +457,13 @@ protected function getMetricTimeseriesDataRequest($metric_id, $optionalParams) $headers ); - $queryParamsDirect = join('&', $queryParams); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + + // MUX: adds support for array params. + // TODO: future upstream? + $query = ObjectSerializer::buildBetterQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($queryParamsDirect ? "?{$queryParamsDirect}" : ''), + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -446,18 +475,17 @@ protected function getMetricTimeseriesDataRequest($metric_id, $optionalParams) * Get Overall values * * @param string $metric_id ID of the Metric (required) - * @param mixed[] $optionalParams An associative array of optional parameters which can be passed to this function: - * - timeframe string[] - Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. (optional) - * - filters string[] - Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. (optional) - * - measurement string - Measurement for the provided metric. If omitted, the deafult for the metric will be used. (optional) + * @param string[] $timeframe Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. (optional) + * @param string[] $filters Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. (optional) + * @param string $measurement Measurement for the provided metric. If omitted, the deafult for the metric will be used. (optional) * * @throws \MuxPhp\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \MuxPhp\Models\GetOverallValuesResponse */ - public function getOverallValues($metric_id, $optionalParams = []) + public function getOverallValues($metric_id, $timeframe = null, $filters = null, $measurement = null) { - list($response) = $this->getOverallValuesWithHttpInfo($metric_id, $optionalParams); + list($response) = $this->getOverallValuesWithHttpInfo($metric_id, $timeframe, $filters, $measurement); return $response; } @@ -467,18 +495,17 @@ public function getOverallValues($metric_id, $optionalParams = []) * Get Overall values * * @param string $metric_id ID of the Metric (required) - * @param mixed[] $optionalParams An associative array of optional parameters which can be passed to this function: - * - timeframe string[] - Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. (optional) - * - filters string[] - Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. (optional) - * - measurement string - Measurement for the provided metric. If omitted, the deafult for the metric will be used. (optional) + * @param string[] $timeframe Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. (optional) + * @param string[] $filters Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. (optional) + * @param string $measurement Measurement for the provided metric. If omitted, the deafult for the metric will be used. (optional) * * @throws \MuxPhp\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \MuxPhp\Models\GetOverallValuesResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getOverallValuesWithHttpInfo($metric_id, $optionalParams = []) + public function getOverallValuesWithHttpInfo($metric_id, $timeframe = null, $filters = null, $measurement = null) { - $request = $this->getOverallValuesRequest($metric_id, $optionalParams); + $request = $this->getOverallValuesRequest($metric_id, $timeframe, $filters, $measurement); try { $options = $this->createHttpClientOption(); @@ -489,7 +516,7 @@ public function getOverallValuesWithHttpInfo($metric_id, $optionalParams = []) "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } @@ -514,7 +541,7 @@ public function getOverallValuesWithHttpInfo($metric_id, $optionalParams = []) if ('\MuxPhp\Models\GetOverallValuesResponse' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -529,7 +556,7 @@ public function getOverallValuesWithHttpInfo($metric_id, $optionalParams = []) if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -559,17 +586,16 @@ public function getOverallValuesWithHttpInfo($metric_id, $optionalParams = []) * Get Overall values * * @param string $metric_id ID of the Metric (required) - * @param mixed[] $optionalParams An associative array of optional parameters which can be passed to this function: - * - timeframe string[] - Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. (optional) - * - filters string[] - Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. (optional) - * - measurement string - Measurement for the provided metric. If omitted, the deafult for the metric will be used. (optional) + * @param string[] $timeframe Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. (optional) + * @param string[] $filters Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. (optional) + * @param string $measurement Measurement for the provided metric. If omitted, the deafult for the metric will be used. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getOverallValuesAsync($metric_id, $optionalParams = []) + public function getOverallValuesAsync($metric_id, $timeframe = null, $filters = null, $measurement = null) { - return $this->getOverallValuesAsyncWithHttpInfo($metric_id, $optionalParams) + return $this->getOverallValuesAsyncWithHttpInfo($metric_id, $timeframe, $filters, $measurement) ->then( function ($response) { return $response[0]; @@ -583,18 +609,17 @@ function ($response) { * Get Overall values * * @param string $metric_id ID of the Metric (required) - * @param mixed[] $optionalParams An associative array of optional parameters which can be passed to this function: - * - timeframe string[] - Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. (optional) - * - filters string[] - Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. (optional) - * - measurement string - Measurement for the provided metric. If omitted, the deafult for the metric will be used. (optional) + * @param string[] $timeframe Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. (optional) + * @param string[] $filters Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. (optional) + * @param string $measurement Measurement for the provided metric. If omitted, the deafult for the metric will be used. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getOverallValuesAsyncWithHttpInfo($metric_id, $optionalParams = []) + public function getOverallValuesAsyncWithHttpInfo($metric_id, $timeframe = null, $filters = null, $measurement = null) { $returnType = '\MuxPhp\Models\GetOverallValuesResponse'; - $request = $this->getOverallValuesRequest($metric_id, $optionalParams); + $request = $this->getOverallValuesRequest($metric_id, $timeframe, $filters, $measurement); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -604,7 +629,7 @@ function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -634,20 +659,15 @@ function ($exception) { * Create request for operation 'getOverallValues' * * @param string $metric_id ID of the Metric (required) - * @param mixed[] $optionalParams An associative array of optional parameters which can be passed to this function: - * - timeframe string[] - Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. (optional) - * - filters string[] - Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. (optional) - * - measurement string - Measurement for the provided metric. If omitted, the deafult for the metric will be used. (optional) + * @param string[] $timeframe Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. (optional) + * @param string[] $filters Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. (optional) + * @param string $measurement Measurement for the provided metric. If omitted, the deafult for the metric will be used. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getOverallValuesRequest($metric_id, $optionalParams) + public function getOverallValuesRequest($metric_id, $timeframe = null, $filters = null, $measurement = null) { - // Pull the set optional params from the associative array $optionalParams, setting them to their defaults if they're not set. - $timeframe = array_key_exists('timeframe', $optionalParams) ? $optionalParams['timeframe'] : null; - $filters = array_key_exists('filters', $optionalParams) ? $optionalParams['filters'] : null; - $measurement = array_key_exists('measurement', $optionalParams) ? $optionalParams['measurement'] : null; // verify the required parameter 'metric_id' is set if ($metric_id === null || (is_array($metric_id) && count($metric_id) === 0)) { throw new \InvalidArgumentException( @@ -662,31 +682,38 @@ protected function getOverallValuesRequest($metric_id, $optionalParams) $httpBody = ''; $multipart = false; - // Query Param: timeframe[] + // Query Param: timeframe if ($timeframe !== null) { if (is_array($timeframe)) { foreach ($timeframe as $p) { - array_push($queryParams, "timeframe[]=$p"); + array_push($queryParams, "timeframe=$p"); } } else { - throw new \InvalidArgumentException('Did not receive an array when expecting one for query parameter timeframe[]'); + throw new \InvalidArgumentException('Did not receive an array when expecting one for query parameter timeframe'); } } - // Query Param: filters[] + // Query Param: filters if ($filters !== null) { if (is_array($filters)) { foreach ($filters as $p) { - array_push($queryParams, "filters[]=$p"); + array_push($queryParams, "filters=$p"); } } else { - throw new \InvalidArgumentException('Did not receive an array when expecting one for query parameter filters[]'); + throw new \InvalidArgumentException('Did not receive an array when expecting one for query parameter filters'); } } // Query Param: measurement if ($measurement !== null) { - array_push($queryParams, 'measurement=' . ObjectSerializer::toQueryValue($measurement)); + if('form' === 'form' && is_array($measurement)) { + foreach($measurement as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['measurement'] = $measurement; + } } @@ -699,8 +726,6 @@ protected function getOverallValuesRequest($metric_id, $optionalParams) ); } - // body params - $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -714,21 +739,17 @@ protected function getOverallValuesRequest($metric_id, $optionalParams) } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -744,7 +765,7 @@ protected function getOverallValuesRequest($metric_id, $optionalParams) // 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()); + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); } $defaultHeaders = []; @@ -758,11 +779,13 @@ protected function getOverallValuesRequest($metric_id, $optionalParams) $headers ); - $queryParamsDirect = join('&', $queryParams); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + + // MUX: adds support for array params. + // TODO: future upstream? + $query = ObjectSerializer::buildBetterQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($queryParamsDirect ? "?{$queryParamsDirect}" : ''), + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -773,19 +796,18 @@ protected function getOverallValuesRequest($metric_id, $optionalParams) * * List all metric values * - * @param mixed[] $optionalParams An associative array of optional parameters which can be passed to this function: - * - timeframe string[] - Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. (optional) - * - filters string[] - Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. (optional) - * - dimension string - Dimension the specified value belongs to (optional) - * - value string - Value to show all available metrics for (optional) + * @param string[] $timeframe Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. (optional) + * @param string[] $filters Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. (optional) + * @param string $dimension Dimension the specified value belongs to (optional) + * @param string $value Value to show all available metrics for (optional) * * @throws \MuxPhp\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \MuxPhp\Models\ListAllMetricValuesResponse */ - public function listAllMetricValues($optionalParams = []) + public function listAllMetricValues($timeframe = null, $filters = null, $dimension = null, $value = null) { - list($response) = $this->listAllMetricValuesWithHttpInfo($optionalParams); + list($response) = $this->listAllMetricValuesWithHttpInfo($timeframe, $filters, $dimension, $value); return $response; } @@ -794,19 +816,18 @@ public function listAllMetricValues($optionalParams = []) * * List all metric values * - * @param mixed[] $optionalParams An associative array of optional parameters which can be passed to this function: - * - timeframe string[] - Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. (optional) - * - filters string[] - Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. (optional) - * - dimension string - Dimension the specified value belongs to (optional) - * - value string - Value to show all available metrics for (optional) + * @param string[] $timeframe Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. (optional) + * @param string[] $filters Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. (optional) + * @param string $dimension Dimension the specified value belongs to (optional) + * @param string $value Value to show all available metrics for (optional) * * @throws \MuxPhp\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \MuxPhp\Models\ListAllMetricValuesResponse, HTTP status code, HTTP response headers (array of strings) */ - public function listAllMetricValuesWithHttpInfo($optionalParams = []) + public function listAllMetricValuesWithHttpInfo($timeframe = null, $filters = null, $dimension = null, $value = null) { - $request = $this->listAllMetricValuesRequest($optionalParams); + $request = $this->listAllMetricValuesRequest($timeframe, $filters, $dimension, $value); try { $options = $this->createHttpClientOption(); @@ -817,7 +838,7 @@ public function listAllMetricValuesWithHttpInfo($optionalParams = []) "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } @@ -842,7 +863,7 @@ public function listAllMetricValuesWithHttpInfo($optionalParams = []) if ('\MuxPhp\Models\ListAllMetricValuesResponse' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -857,7 +878,7 @@ public function listAllMetricValuesWithHttpInfo($optionalParams = []) if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -886,18 +907,17 @@ public function listAllMetricValuesWithHttpInfo($optionalParams = []) * * List all metric values * - * @param mixed[] $optionalParams An associative array of optional parameters which can be passed to this function: - * - timeframe string[] - Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. (optional) - * - filters string[] - Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. (optional) - * - dimension string - Dimension the specified value belongs to (optional) - * - value string - Value to show all available metrics for (optional) + * @param string[] $timeframe Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. (optional) + * @param string[] $filters Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. (optional) + * @param string $dimension Dimension the specified value belongs to (optional) + * @param string $value Value to show all available metrics for (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function listAllMetricValuesAsync($optionalParams = []) + public function listAllMetricValuesAsync($timeframe = null, $filters = null, $dimension = null, $value = null) { - return $this->listAllMetricValuesAsyncWithHttpInfo($optionalParams) + return $this->listAllMetricValuesAsyncWithHttpInfo($timeframe, $filters, $dimension, $value) ->then( function ($response) { return $response[0]; @@ -910,19 +930,18 @@ function ($response) { * * List all metric values * - * @param mixed[] $optionalParams An associative array of optional parameters which can be passed to this function: - * - timeframe string[] - Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. (optional) - * - filters string[] - Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. (optional) - * - dimension string - Dimension the specified value belongs to (optional) - * - value string - Value to show all available metrics for (optional) + * @param string[] $timeframe Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. (optional) + * @param string[] $filters Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. (optional) + * @param string $dimension Dimension the specified value belongs to (optional) + * @param string $value Value to show all available metrics for (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function listAllMetricValuesAsyncWithHttpInfo($optionalParams = []) + public function listAllMetricValuesAsyncWithHttpInfo($timeframe = null, $filters = null, $dimension = null, $value = null) { $returnType = '\MuxPhp\Models\ListAllMetricValuesResponse'; - $request = $this->listAllMetricValuesRequest($optionalParams); + $request = $this->listAllMetricValuesRequest($timeframe, $filters, $dimension, $value); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -932,7 +951,7 @@ function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -961,22 +980,16 @@ function ($exception) { /** * Create request for operation 'listAllMetricValues' * - * @param mixed[] $optionalParams An associative array of optional parameters which can be passed to this function: - * - timeframe string[] - Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. (optional) - * - filters string[] - Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. (optional) - * - dimension string - Dimension the specified value belongs to (optional) - * - value string - Value to show all available metrics for (optional) + * @param string[] $timeframe Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. (optional) + * @param string[] $filters Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. (optional) + * @param string $dimension Dimension the specified value belongs to (optional) + * @param string $value Value to show all available metrics for (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function listAllMetricValuesRequest($optionalParams) + public function listAllMetricValuesRequest($timeframe = null, $filters = null, $dimension = null, $value = null) { - // Pull the set optional params from the associative array $optionalParams, setting them to their defaults if they're not set. - $timeframe = array_key_exists('timeframe', $optionalParams) ? $optionalParams['timeframe'] : null; - $filters = array_key_exists('filters', $optionalParams) ? $optionalParams['filters'] : null; - $dimension = array_key_exists('dimension', $optionalParams) ? $optionalParams['dimension'] : null; - $value = array_key_exists('value', $optionalParams) ? $optionalParams['value'] : null; $resourcePath = '/data/v1/metrics/comparison'; $formParams = []; @@ -985,41 +998,53 @@ protected function listAllMetricValuesRequest($optionalParams) $httpBody = ''; $multipart = false; - // Query Param: timeframe[] + // Query Param: timeframe if ($timeframe !== null) { if (is_array($timeframe)) { foreach ($timeframe as $p) { - array_push($queryParams, "timeframe[]=$p"); + array_push($queryParams, "timeframe=$p"); } } else { - throw new \InvalidArgumentException('Did not receive an array when expecting one for query parameter timeframe[]'); + throw new \InvalidArgumentException('Did not receive an array when expecting one for query parameter timeframe'); } } - // Query Param: filters[] + // Query Param: filters if ($filters !== null) { if (is_array($filters)) { foreach ($filters as $p) { - array_push($queryParams, "filters[]=$p"); + array_push($queryParams, "filters=$p"); } } else { - throw new \InvalidArgumentException('Did not receive an array when expecting one for query parameter filters[]'); + throw new \InvalidArgumentException('Did not receive an array when expecting one for query parameter filters'); } } // Query Param: dimension if ($dimension !== null) { - array_push($queryParams, 'dimension=' . ObjectSerializer::toQueryValue($dimension)); + if('form' === 'form' && is_array($dimension)) { + foreach($dimension as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['dimension'] = $dimension; + } } // Query Param: value if ($value !== null) { - array_push($queryParams, 'value=' . ObjectSerializer::toQueryValue($value)); + if('form' === 'form' && is_array($value)) { + foreach($value as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['value'] = $value; + } } - // body params - $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -1033,21 +1058,17 @@ protected function listAllMetricValuesRequest($optionalParams) } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -1063,7 +1084,7 @@ protected function listAllMetricValuesRequest($optionalParams) // 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()); + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); } $defaultHeaders = []; @@ -1077,11 +1098,13 @@ protected function listAllMetricValuesRequest($optionalParams) $headers ); - $queryParamsDirect = join('&', $queryParams); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + + // MUX: adds support for array params. + // TODO: future upstream? + $query = ObjectSerializer::buildBetterQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($queryParamsDirect ? "?{$queryParamsDirect}" : ''), + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1093,23 +1116,22 @@ protected function listAllMetricValuesRequest($optionalParams) * List breakdown values * * @param string $metric_id ID of the Metric (required) - * @param mixed[] $optionalParams An associative array of optional parameters which can be passed to this function: - * - group_by string - Breakdown value to group the results by (optional) - * - measurement string - Measurement for the provided metric. If omitted, the deafult for the metric will be used. (optional) - * - filters string[] - Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. (optional) - * - 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) - * - order_by string - Value to order the results by (optional) - * - order_direction string - Sort order. (optional) - * - timeframe string[] - Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. (optional) + * @param string $group_by Breakdown value to group the results by (optional) + * @param string $measurement Measurement for the provided metric. If omitted, the deafult for the metric will be used. (optional) + * @param string[] $filters Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. (optional) + * @param int $limit Number of items to include in the response (optional, default to 25) + * @param int $page Offset by this many pages, of the size of `limit` (optional, default to 1) + * @param string $order_by Value to order the results by (optional) + * @param string $order_direction Sort order. (optional) + * @param string[] $timeframe Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. (optional) * * @throws \MuxPhp\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \MuxPhp\Models\ListBreakdownValuesResponse */ - public function listBreakdownValues($metric_id, $optionalParams = []) + public function listBreakdownValues($metric_id, $group_by = null, $measurement = null, $filters = null, $limit = 25, $page = 1, $order_by = null, $order_direction = null, $timeframe = null) { - list($response) = $this->listBreakdownValuesWithHttpInfo($metric_id, $optionalParams); + list($response) = $this->listBreakdownValuesWithHttpInfo($metric_id, $group_by, $measurement, $filters, $limit, $page, $order_by, $order_direction, $timeframe); return $response; } @@ -1119,23 +1141,22 @@ public function listBreakdownValues($metric_id, $optionalParams = []) * List breakdown values * * @param string $metric_id ID of the Metric (required) - * @param mixed[] $optionalParams An associative array of optional parameters which can be passed to this function: - * - group_by string - Breakdown value to group the results by (optional) - * - measurement string - Measurement for the provided metric. If omitted, the deafult for the metric will be used. (optional) - * - filters string[] - Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. (optional) - * - 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) - * - order_by string - Value to order the results by (optional) - * - order_direction string - Sort order. (optional) - * - timeframe string[] - Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. (optional) + * @param string $group_by Breakdown value to group the results by (optional) + * @param string $measurement Measurement for the provided metric. If omitted, the deafult for the metric will be used. (optional) + * @param string[] $filters Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. (optional) + * @param int $limit Number of items to include in the response (optional, default to 25) + * @param int $page Offset by this many pages, of the size of `limit` (optional, default to 1) + * @param string $order_by Value to order the results by (optional) + * @param string $order_direction Sort order. (optional) + * @param string[] $timeframe Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. (optional) * * @throws \MuxPhp\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \MuxPhp\Models\ListBreakdownValuesResponse, HTTP status code, HTTP response headers (array of strings) */ - public function listBreakdownValuesWithHttpInfo($metric_id, $optionalParams = []) + public function listBreakdownValuesWithHttpInfo($metric_id, $group_by = null, $measurement = null, $filters = null, $limit = 25, $page = 1, $order_by = null, $order_direction = null, $timeframe = null) { - $request = $this->listBreakdownValuesRequest($metric_id, $optionalParams); + $request = $this->listBreakdownValuesRequest($metric_id, $group_by, $measurement, $filters, $limit, $page, $order_by, $order_direction, $timeframe); try { $options = $this->createHttpClientOption(); @@ -1146,7 +1167,7 @@ public function listBreakdownValuesWithHttpInfo($metric_id, $optionalParams = [] "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } @@ -1171,7 +1192,7 @@ public function listBreakdownValuesWithHttpInfo($metric_id, $optionalParams = [] if ('\MuxPhp\Models\ListBreakdownValuesResponse' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -1186,7 +1207,7 @@ public function listBreakdownValuesWithHttpInfo($metric_id, $optionalParams = [] if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -1216,22 +1237,21 @@ public function listBreakdownValuesWithHttpInfo($metric_id, $optionalParams = [] * List breakdown values * * @param string $metric_id ID of the Metric (required) - * @param mixed[] $optionalParams An associative array of optional parameters which can be passed to this function: - * - group_by string - Breakdown value to group the results by (optional) - * - measurement string - Measurement for the provided metric. If omitted, the deafult for the metric will be used. (optional) - * - filters string[] - Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. (optional) - * - 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) - * - order_by string - Value to order the results by (optional) - * - order_direction string - Sort order. (optional) - * - timeframe string[] - Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. (optional) + * @param string $group_by Breakdown value to group the results by (optional) + * @param string $measurement Measurement for the provided metric. If omitted, the deafult for the metric will be used. (optional) + * @param string[] $filters Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. (optional) + * @param int $limit Number of items to include in the response (optional, default to 25) + * @param int $page Offset by this many pages, of the size of `limit` (optional, default to 1) + * @param string $order_by Value to order the results by (optional) + * @param string $order_direction Sort order. (optional) + * @param string[] $timeframe Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function listBreakdownValuesAsync($metric_id, $optionalParams = []) + public function listBreakdownValuesAsync($metric_id, $group_by = null, $measurement = null, $filters = null, $limit = 25, $page = 1, $order_by = null, $order_direction = null, $timeframe = null) { - return $this->listBreakdownValuesAsyncWithHttpInfo($metric_id, $optionalParams) + return $this->listBreakdownValuesAsyncWithHttpInfo($metric_id, $group_by, $measurement, $filters, $limit, $page, $order_by, $order_direction, $timeframe) ->then( function ($response) { return $response[0]; @@ -1245,23 +1265,22 @@ function ($response) { * List breakdown values * * @param string $metric_id ID of the Metric (required) - * @param mixed[] $optionalParams An associative array of optional parameters which can be passed to this function: - * - group_by string - Breakdown value to group the results by (optional) - * - measurement string - Measurement for the provided metric. If omitted, the deafult for the metric will be used. (optional) - * - filters string[] - Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. (optional) - * - 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) - * - order_by string - Value to order the results by (optional) - * - order_direction string - Sort order. (optional) - * - timeframe string[] - Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. (optional) + * @param string $group_by Breakdown value to group the results by (optional) + * @param string $measurement Measurement for the provided metric. If omitted, the deafult for the metric will be used. (optional) + * @param string[] $filters Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. (optional) + * @param int $limit Number of items to include in the response (optional, default to 25) + * @param int $page Offset by this many pages, of the size of `limit` (optional, default to 1) + * @param string $order_by Value to order the results by (optional) + * @param string $order_direction Sort order. (optional) + * @param string[] $timeframe Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function listBreakdownValuesAsyncWithHttpInfo($metric_id, $optionalParams = []) + public function listBreakdownValuesAsyncWithHttpInfo($metric_id, $group_by = null, $measurement = null, $filters = null, $limit = 25, $page = 1, $order_by = null, $order_direction = null, $timeframe = null) { $returnType = '\MuxPhp\Models\ListBreakdownValuesResponse'; - $request = $this->listBreakdownValuesRequest($metric_id, $optionalParams); + $request = $this->listBreakdownValuesRequest($metric_id, $group_by, $measurement, $filters, $limit, $page, $order_by, $order_direction, $timeframe); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1271,7 +1290,7 @@ function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -1301,30 +1320,20 @@ function ($exception) { * Create request for operation 'listBreakdownValues' * * @param string $metric_id ID of the Metric (required) - * @param mixed[] $optionalParams An associative array of optional parameters which can be passed to this function: - * - group_by string - Breakdown value to group the results by (optional) - * - measurement string - Measurement for the provided metric. If omitted, the deafult for the metric will be used. (optional) - * - filters string[] - Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. (optional) - * - 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) - * - order_by string - Value to order the results by (optional) - * - order_direction string - Sort order. (optional) - * - timeframe string[] - Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. (optional) + * @param string $group_by Breakdown value to group the results by (optional) + * @param string $measurement Measurement for the provided metric. If omitted, the deafult for the metric will be used. (optional) + * @param string[] $filters Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. (optional) + * @param int $limit Number of items to include in the response (optional, default to 25) + * @param int $page Offset by this many pages, of the size of `limit` (optional, default to 1) + * @param string $order_by Value to order the results by (optional) + * @param string $order_direction Sort order. (optional) + * @param string[] $timeframe Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function listBreakdownValuesRequest($metric_id, $optionalParams) + public function listBreakdownValuesRequest($metric_id, $group_by = null, $measurement = null, $filters = null, $limit = 25, $page = 1, $order_by = null, $order_direction = null, $timeframe = null) { - // Pull the set optional params from the associative array $optionalParams, setting them to their defaults if they're not set. - $group_by = array_key_exists('group_by', $optionalParams) ? $optionalParams['group_by'] : null; - $measurement = array_key_exists('measurement', $optionalParams) ? $optionalParams['measurement'] : null; - $filters = array_key_exists('filters', $optionalParams) ? $optionalParams['filters'] : null; - $limit = array_key_exists('limit', $optionalParams) ? $optionalParams['limit'] : 25; - $page = array_key_exists('page', $optionalParams) ? $optionalParams['page'] : 1; - $order_by = array_key_exists('order_by', $optionalParams) ? $optionalParams['order_by'] : null; - $order_direction = array_key_exists('order_direction', $optionalParams) ? $optionalParams['order_direction'] : null; - $timeframe = array_key_exists('timeframe', $optionalParams) ? $optionalParams['timeframe'] : null; // verify the required parameter 'metric_id' is set if ($metric_id === null || (is_array($metric_id) && count($metric_id) === 0)) { throw new \InvalidArgumentException( @@ -1341,48 +1350,90 @@ protected function listBreakdownValuesRequest($metric_id, $optionalParams) // Query Param: group_by if ($group_by !== null) { - array_push($queryParams, 'group_by=' . ObjectSerializer::toQueryValue($group_by)); + if('form' === 'form' && is_array($group_by)) { + foreach($group_by as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['group_by'] = $group_by; + } } // Query Param: measurement if ($measurement !== null) { - array_push($queryParams, 'measurement=' . ObjectSerializer::toQueryValue($measurement)); + if('form' === 'form' && is_array($measurement)) { + foreach($measurement as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['measurement'] = $measurement; + } } - // Query Param: filters[] + // Query Param: filters if ($filters !== null) { if (is_array($filters)) { foreach ($filters as $p) { - array_push($queryParams, "filters[]=$p"); + array_push($queryParams, "filters=$p"); } } else { - throw new \InvalidArgumentException('Did not receive an array when expecting one for query parameter filters[]'); + throw new \InvalidArgumentException('Did not receive an array when expecting one for query parameter filters'); } } // Query Param: limit if ($limit !== null) { - array_push($queryParams, 'limit=' . ObjectSerializer::toQueryValue($limit)); + if('form' === 'form' && is_array($limit)) { + foreach($limit as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['limit'] = $limit; + } } // Query Param: page if ($page !== null) { - array_push($queryParams, 'page=' . ObjectSerializer::toQueryValue($page)); + if('form' === 'form' && is_array($page)) { + foreach($page as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['page'] = $page; + } } // Query Param: order_by if ($order_by !== null) { - array_push($queryParams, 'order_by=' . ObjectSerializer::toQueryValue($order_by)); + if('form' === 'form' && is_array($order_by)) { + foreach($order_by as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['order_by'] = $order_by; + } } // Query Param: order_direction if ($order_direction !== null) { - array_push($queryParams, 'order_direction=' . ObjectSerializer::toQueryValue($order_direction)); + if('form' === 'form' && is_array($order_direction)) { + foreach($order_direction as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['order_direction'] = $order_direction; + } } - // Query Param: timeframe[] + // Query Param: timeframe if ($timeframe !== null) { if (is_array($timeframe)) { foreach ($timeframe as $p) { - array_push($queryParams, "timeframe[]=$p"); + array_push($queryParams, "timeframe=$p"); } } else { - throw new \InvalidArgumentException('Did not receive an array when expecting one for query parameter timeframe[]'); + throw new \InvalidArgumentException('Did not receive an array when expecting one for query parameter timeframe'); } } @@ -1396,8 +1447,6 @@ protected function listBreakdownValuesRequest($metric_id, $optionalParams) ); } - // body params - $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -1411,21 +1460,17 @@ protected function listBreakdownValuesRequest($metric_id, $optionalParams) } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -1441,7 +1486,7 @@ protected function listBreakdownValuesRequest($metric_id, $optionalParams) // 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()); + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); } $defaultHeaders = []; @@ -1455,11 +1500,13 @@ protected function listBreakdownValuesRequest($metric_id, $optionalParams) $headers ); - $queryParamsDirect = join('&', $queryParams); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + + // MUX: adds support for array params. + // TODO: future upstream? + $query = ObjectSerializer::buildBetterQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($queryParamsDirect ? "?{$queryParamsDirect}" : ''), + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1471,18 +1518,17 @@ protected function listBreakdownValuesRequest($metric_id, $optionalParams) * List Insights * * @param string $metric_id ID of the Metric (required) - * @param mixed[] $optionalParams An associative array of optional parameters which can be passed to this function: - * - measurement string - Measurement for the provided metric. If omitted, the deafult for the metric will be used. (optional) - * - order_direction string - Sort order. (optional) - * - timeframe string[] - Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. (optional) + * @param string $measurement Measurement for the provided metric. If omitted, the deafult for the metric will be used. (optional) + * @param string $order_direction Sort order. (optional) + * @param string[] $timeframe Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. (optional) * * @throws \MuxPhp\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \MuxPhp\Models\ListInsightsResponse */ - public function listInsights($metric_id, $optionalParams = []) + public function listInsights($metric_id, $measurement = null, $order_direction = null, $timeframe = null) { - list($response) = $this->listInsightsWithHttpInfo($metric_id, $optionalParams); + list($response) = $this->listInsightsWithHttpInfo($metric_id, $measurement, $order_direction, $timeframe); return $response; } @@ -1492,18 +1538,17 @@ public function listInsights($metric_id, $optionalParams = []) * List Insights * * @param string $metric_id ID of the Metric (required) - * @param mixed[] $optionalParams An associative array of optional parameters which can be passed to this function: - * - measurement string - Measurement for the provided metric. If omitted, the deafult for the metric will be used. (optional) - * - order_direction string - Sort order. (optional) - * - timeframe string[] - Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. (optional) + * @param string $measurement Measurement for the provided metric. If omitted, the deafult for the metric will be used. (optional) + * @param string $order_direction Sort order. (optional) + * @param string[] $timeframe Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. (optional) * * @throws \MuxPhp\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \MuxPhp\Models\ListInsightsResponse, HTTP status code, HTTP response headers (array of strings) */ - public function listInsightsWithHttpInfo($metric_id, $optionalParams = []) + public function listInsightsWithHttpInfo($metric_id, $measurement = null, $order_direction = null, $timeframe = null) { - $request = $this->listInsightsRequest($metric_id, $optionalParams); + $request = $this->listInsightsRequest($metric_id, $measurement, $order_direction, $timeframe); try { $options = $this->createHttpClientOption(); @@ -1514,7 +1559,7 @@ public function listInsightsWithHttpInfo($metric_id, $optionalParams = []) "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } @@ -1539,7 +1584,7 @@ public function listInsightsWithHttpInfo($metric_id, $optionalParams = []) if ('\MuxPhp\Models\ListInsightsResponse' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -1554,7 +1599,7 @@ public function listInsightsWithHttpInfo($metric_id, $optionalParams = []) if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -1584,17 +1629,16 @@ public function listInsightsWithHttpInfo($metric_id, $optionalParams = []) * List Insights * * @param string $metric_id ID of the Metric (required) - * @param mixed[] $optionalParams An associative array of optional parameters which can be passed to this function: - * - measurement string - Measurement for the provided metric. If omitted, the deafult for the metric will be used. (optional) - * - order_direction string - Sort order. (optional) - * - timeframe string[] - Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. (optional) + * @param string $measurement Measurement for the provided metric. If omitted, the deafult for the metric will be used. (optional) + * @param string $order_direction Sort order. (optional) + * @param string[] $timeframe Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function listInsightsAsync($metric_id, $optionalParams = []) + public function listInsightsAsync($metric_id, $measurement = null, $order_direction = null, $timeframe = null) { - return $this->listInsightsAsyncWithHttpInfo($metric_id, $optionalParams) + return $this->listInsightsAsyncWithHttpInfo($metric_id, $measurement, $order_direction, $timeframe) ->then( function ($response) { return $response[0]; @@ -1608,18 +1652,17 @@ function ($response) { * List Insights * * @param string $metric_id ID of the Metric (required) - * @param mixed[] $optionalParams An associative array of optional parameters which can be passed to this function: - * - measurement string - Measurement for the provided metric. If omitted, the deafult for the metric will be used. (optional) - * - order_direction string - Sort order. (optional) - * - timeframe string[] - Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. (optional) + * @param string $measurement Measurement for the provided metric. If omitted, the deafult for the metric will be used. (optional) + * @param string $order_direction Sort order. (optional) + * @param string[] $timeframe Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function listInsightsAsyncWithHttpInfo($metric_id, $optionalParams = []) + public function listInsightsAsyncWithHttpInfo($metric_id, $measurement = null, $order_direction = null, $timeframe = null) { $returnType = '\MuxPhp\Models\ListInsightsResponse'; - $request = $this->listInsightsRequest($metric_id, $optionalParams); + $request = $this->listInsightsRequest($metric_id, $measurement, $order_direction, $timeframe); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1629,7 +1672,7 @@ function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -1659,20 +1702,15 @@ function ($exception) { * Create request for operation 'listInsights' * * @param string $metric_id ID of the Metric (required) - * @param mixed[] $optionalParams An associative array of optional parameters which can be passed to this function: - * - measurement string - Measurement for the provided metric. If omitted, the deafult for the metric will be used. (optional) - * - order_direction string - Sort order. (optional) - * - timeframe string[] - Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. (optional) + * @param string $measurement Measurement for the provided metric. If omitted, the deafult for the metric will be used. (optional) + * @param string $order_direction Sort order. (optional) + * @param string[] $timeframe Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function listInsightsRequest($metric_id, $optionalParams) + public function listInsightsRequest($metric_id, $measurement = null, $order_direction = null, $timeframe = null) { - // Pull the set optional params from the associative array $optionalParams, setting them to their defaults if they're not set. - $measurement = array_key_exists('measurement', $optionalParams) ? $optionalParams['measurement'] : null; - $order_direction = array_key_exists('order_direction', $optionalParams) ? $optionalParams['order_direction'] : null; - $timeframe = array_key_exists('timeframe', $optionalParams) ? $optionalParams['timeframe'] : null; // verify the required parameter 'metric_id' is set if ($metric_id === null || (is_array($metric_id) && count($metric_id) === 0)) { throw new \InvalidArgumentException( @@ -1689,21 +1727,35 @@ protected function listInsightsRequest($metric_id, $optionalParams) // Query Param: measurement if ($measurement !== null) { - array_push($queryParams, 'measurement=' . ObjectSerializer::toQueryValue($measurement)); + if('form' === 'form' && is_array($measurement)) { + foreach($measurement as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['measurement'] = $measurement; + } } // Query Param: order_direction if ($order_direction !== null) { - array_push($queryParams, 'order_direction=' . ObjectSerializer::toQueryValue($order_direction)); + if('form' === 'form' && is_array($order_direction)) { + foreach($order_direction as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['order_direction'] = $order_direction; + } } - // Query Param: timeframe[] + // Query Param: timeframe if ($timeframe !== null) { if (is_array($timeframe)) { foreach ($timeframe as $p) { - array_push($queryParams, "timeframe[]=$p"); + array_push($queryParams, "timeframe=$p"); } } else { - throw new \InvalidArgumentException('Did not receive an array when expecting one for query parameter timeframe[]'); + throw new \InvalidArgumentException('Did not receive an array when expecting one for query parameter timeframe'); } } @@ -1717,8 +1769,6 @@ protected function listInsightsRequest($metric_id, $optionalParams) ); } - // body params - $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -1732,21 +1782,17 @@ protected function listInsightsRequest($metric_id, $optionalParams) } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -1762,7 +1808,7 @@ protected function listInsightsRequest($metric_id, $optionalParams) // 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()); + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); } $defaultHeaders = []; @@ -1776,11 +1822,13 @@ protected function listInsightsRequest($metric_id, $optionalParams) $headers ); - $queryParamsDirect = join('&', $queryParams); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + + // MUX: adds support for array params. + // TODO: future upstream? + $query = ObjectSerializer::buildBetterQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($queryParamsDirect ? "?{$queryParamsDirect}" : ''), + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); diff --git a/MuxPhp/Api/PlaybackIDApi.php b/MuxPhp/Api/PlaybackIDApi.php index 4c3f937..912483f 100644 --- a/MuxPhp/Api/PlaybackIDApi.php +++ b/MuxPhp/Api/PlaybackIDApi.php @@ -1,8 +1,29 @@ client = $client ?: new Client(); $this->config = $config ?: new Configuration(); $this->headerSelector = $selector ?: new HeaderSelector(); - $this->hostIndex = $host_index; + $this->hostIndex = $hostIndex; } /** * Set the host index * - * @param int $host_index Host index (required) + * @param int $hostIndex Host index (required) */ - public function setHostIndex($host_index) + public function setHostIndex($hostIndex) { - $this->hostIndex = $host_index; + $this->hostIndex = $hostIndex; } /** * Get the host index * - * @return Host index + * @return int Host index */ public function getHostIndex() { @@ -133,7 +156,7 @@ public function getAssetOrLivestreamIdWithHttpInfo($playback_id) "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } @@ -158,7 +181,7 @@ public function getAssetOrLivestreamIdWithHttpInfo($playback_id) if ('\MuxPhp\Models\GetAssetOrLiveStreamIdResponse' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -173,7 +196,7 @@ public function getAssetOrLivestreamIdWithHttpInfo($playback_id) if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -240,7 +263,7 @@ function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -274,7 +297,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getAssetOrLivestreamIdRequest($playback_id) + public function getAssetOrLivestreamIdRequest($playback_id) { // verify the required parameter 'playback_id' is set if ($playback_id === null || (is_array($playback_id) && count($playback_id) === 0)) { @@ -301,8 +324,6 @@ protected function getAssetOrLivestreamIdRequest($playback_id) ); } - // body params - $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -316,21 +337,17 @@ protected function getAssetOrLivestreamIdRequest($playback_id) } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -346,7 +363,7 @@ protected function getAssetOrLivestreamIdRequest($playback_id) // 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()); + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); } $defaultHeaders = []; @@ -360,11 +377,13 @@ protected function getAssetOrLivestreamIdRequest($playback_id) $headers ); - $queryParamsDirect = join('&', $queryParams); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + + // MUX: adds support for array params. + // TODO: future upstream? + $query = ObjectSerializer::buildBetterQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($queryParamsDirect ? "?{$queryParamsDirect}" : ''), + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); diff --git a/MuxPhp/Api/RealTimeApi.php b/MuxPhp/Api/RealTimeApi.php index ba6d660..de4e6f3 100644 --- a/MuxPhp/Api/RealTimeApi.php +++ b/MuxPhp/Api/RealTimeApi.php @@ -1,8 +1,29 @@ client = $client ?: new Client(); $this->config = $config ?: new Configuration(); $this->headerSelector = $selector ?: new HeaderSelector(); - $this->hostIndex = $host_index; + $this->hostIndex = $hostIndex; } /** * Set the host index * - * @param int $host_index Host index (required) + * @param int $hostIndex Host index (required) */ - public function setHostIndex($host_index) + public function setHostIndex($hostIndex) { - $this->hostIndex = $host_index; + $this->hostIndex = $hostIndex; } /** * Get the host index * - * @return Host index + * @return int Host index */ public function getHostIndex() { @@ -98,20 +121,19 @@ public function getConfig() * Get Real-Time Breakdown * * @param string $realtime_metric_id ID of the Realtime Metric (required) - * @param mixed[] $optionalParams An associative array of optional parameters which can be passed to this function: - * - dimension string - Dimension the specified value belongs to (optional) - * - timestamp double - Timestamp to limit results by. This value must be provided as a unix timestamp. Defaults to the current unix timestamp. (optional) - * - filters string[] - Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. (optional) - * - order_by string - Value to order the results by (optional) - * - order_direction string - Sort order. (optional) + * @param string $dimension Dimension the specified value belongs to (optional) + * @param float $timestamp Timestamp to limit results by. This value must be provided as a unix timestamp. Defaults to the current unix timestamp. (optional) + * @param string[] $filters Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. (optional) + * @param string $order_by Value to order the results by (optional) + * @param string $order_direction Sort order. (optional) * * @throws \MuxPhp\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \MuxPhp\Models\GetRealTimeBreakdownResponse */ - public function getRealtimeBreakdown($realtime_metric_id, $optionalParams = []) + public function getRealtimeBreakdown($realtime_metric_id, $dimension = null, $timestamp = null, $filters = null, $order_by = null, $order_direction = null) { - list($response) = $this->getRealtimeBreakdownWithHttpInfo($realtime_metric_id, $optionalParams); + list($response) = $this->getRealtimeBreakdownWithHttpInfo($realtime_metric_id, $dimension, $timestamp, $filters, $order_by, $order_direction); return $response; } @@ -121,20 +143,19 @@ public function getRealtimeBreakdown($realtime_metric_id, $optionalParams = []) * Get Real-Time Breakdown * * @param string $realtime_metric_id ID of the Realtime Metric (required) - * @param mixed[] $optionalParams An associative array of optional parameters which can be passed to this function: - * - dimension string - Dimension the specified value belongs to (optional) - * - timestamp double - Timestamp to limit results by. This value must be provided as a unix timestamp. Defaults to the current unix timestamp. (optional) - * - filters string[] - Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. (optional) - * - order_by string - Value to order the results by (optional) - * - order_direction string - Sort order. (optional) + * @param string $dimension Dimension the specified value belongs to (optional) + * @param float $timestamp Timestamp to limit results by. This value must be provided as a unix timestamp. Defaults to the current unix timestamp. (optional) + * @param string[] $filters Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. (optional) + * @param string $order_by Value to order the results by (optional) + * @param string $order_direction Sort order. (optional) * * @throws \MuxPhp\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \MuxPhp\Models\GetRealTimeBreakdownResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getRealtimeBreakdownWithHttpInfo($realtime_metric_id, $optionalParams = []) + public function getRealtimeBreakdownWithHttpInfo($realtime_metric_id, $dimension = null, $timestamp = null, $filters = null, $order_by = null, $order_direction = null) { - $request = $this->getRealtimeBreakdownRequest($realtime_metric_id, $optionalParams); + $request = $this->getRealtimeBreakdownRequest($realtime_metric_id, $dimension, $timestamp, $filters, $order_by, $order_direction); try { $options = $this->createHttpClientOption(); @@ -145,7 +166,7 @@ public function getRealtimeBreakdownWithHttpInfo($realtime_metric_id, $optionalP "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } @@ -170,7 +191,7 @@ public function getRealtimeBreakdownWithHttpInfo($realtime_metric_id, $optionalP if ('\MuxPhp\Models\GetRealTimeBreakdownResponse' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -185,7 +206,7 @@ public function getRealtimeBreakdownWithHttpInfo($realtime_metric_id, $optionalP if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -215,19 +236,18 @@ public function getRealtimeBreakdownWithHttpInfo($realtime_metric_id, $optionalP * Get Real-Time Breakdown * * @param string $realtime_metric_id ID of the Realtime Metric (required) - * @param mixed[] $optionalParams An associative array of optional parameters which can be passed to this function: - * - dimension string - Dimension the specified value belongs to (optional) - * - timestamp double - Timestamp to limit results by. This value must be provided as a unix timestamp. Defaults to the current unix timestamp. (optional) - * - filters string[] - Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. (optional) - * - order_by string - Value to order the results by (optional) - * - order_direction string - Sort order. (optional) + * @param string $dimension Dimension the specified value belongs to (optional) + * @param float $timestamp Timestamp to limit results by. This value must be provided as a unix timestamp. Defaults to the current unix timestamp. (optional) + * @param string[] $filters Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. (optional) + * @param string $order_by Value to order the results by (optional) + * @param string $order_direction Sort order. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getRealtimeBreakdownAsync($realtime_metric_id, $optionalParams = []) + public function getRealtimeBreakdownAsync($realtime_metric_id, $dimension = null, $timestamp = null, $filters = null, $order_by = null, $order_direction = null) { - return $this->getRealtimeBreakdownAsyncWithHttpInfo($realtime_metric_id, $optionalParams) + return $this->getRealtimeBreakdownAsyncWithHttpInfo($realtime_metric_id, $dimension, $timestamp, $filters, $order_by, $order_direction) ->then( function ($response) { return $response[0]; @@ -241,20 +261,19 @@ function ($response) { * Get Real-Time Breakdown * * @param string $realtime_metric_id ID of the Realtime Metric (required) - * @param mixed[] $optionalParams An associative array of optional parameters which can be passed to this function: - * - dimension string - Dimension the specified value belongs to (optional) - * - timestamp double - Timestamp to limit results by. This value must be provided as a unix timestamp. Defaults to the current unix timestamp. (optional) - * - filters string[] - Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. (optional) - * - order_by string - Value to order the results by (optional) - * - order_direction string - Sort order. (optional) + * @param string $dimension Dimension the specified value belongs to (optional) + * @param float $timestamp Timestamp to limit results by. This value must be provided as a unix timestamp. Defaults to the current unix timestamp. (optional) + * @param string[] $filters Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. (optional) + * @param string $order_by Value to order the results by (optional) + * @param string $order_direction Sort order. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getRealtimeBreakdownAsyncWithHttpInfo($realtime_metric_id, $optionalParams = []) + public function getRealtimeBreakdownAsyncWithHttpInfo($realtime_metric_id, $dimension = null, $timestamp = null, $filters = null, $order_by = null, $order_direction = null) { $returnType = '\MuxPhp\Models\GetRealTimeBreakdownResponse'; - $request = $this->getRealtimeBreakdownRequest($realtime_metric_id, $optionalParams); + $request = $this->getRealtimeBreakdownRequest($realtime_metric_id, $dimension, $timestamp, $filters, $order_by, $order_direction); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -264,7 +283,7 @@ function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -294,24 +313,17 @@ function ($exception) { * Create request for operation 'getRealtimeBreakdown' * * @param string $realtime_metric_id ID of the Realtime Metric (required) - * @param mixed[] $optionalParams An associative array of optional parameters which can be passed to this function: - * - dimension string - Dimension the specified value belongs to (optional) - * - timestamp double - Timestamp to limit results by. This value must be provided as a unix timestamp. Defaults to the current unix timestamp. (optional) - * - filters string[] - Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. (optional) - * - order_by string - Value to order the results by (optional) - * - order_direction string - Sort order. (optional) + * @param string $dimension Dimension the specified value belongs to (optional) + * @param float $timestamp Timestamp to limit results by. This value must be provided as a unix timestamp. Defaults to the current unix timestamp. (optional) + * @param string[] $filters Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. (optional) + * @param string $order_by Value to order the results by (optional) + * @param string $order_direction Sort order. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getRealtimeBreakdownRequest($realtime_metric_id, $optionalParams) + public function getRealtimeBreakdownRequest($realtime_metric_id, $dimension = null, $timestamp = null, $filters = null, $order_by = null, $order_direction = null) { - // Pull the set optional params from the associative array $optionalParams, setting them to their defaults if they're not set. - $dimension = array_key_exists('dimension', $optionalParams) ? $optionalParams['dimension'] : null; - $timestamp = array_key_exists('timestamp', $optionalParams) ? $optionalParams['timestamp'] : null; - $filters = array_key_exists('filters', $optionalParams) ? $optionalParams['filters'] : null; - $order_by = array_key_exists('order_by', $optionalParams) ? $optionalParams['order_by'] : null; - $order_direction = array_key_exists('order_direction', $optionalParams) ? $optionalParams['order_direction'] : null; // verify the required parameter 'realtime_metric_id' is set if ($realtime_metric_id === null || (is_array($realtime_metric_id) && count($realtime_metric_id) === 0)) { throw new \InvalidArgumentException( @@ -328,30 +340,58 @@ protected function getRealtimeBreakdownRequest($realtime_metric_id, $optionalPar // Query Param: dimension if ($dimension !== null) { - array_push($queryParams, 'dimension=' . ObjectSerializer::toQueryValue($dimension)); + if('form' === 'form' && is_array($dimension)) { + foreach($dimension as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['dimension'] = $dimension; + } } // Query Param: timestamp if ($timestamp !== null) { - array_push($queryParams, 'timestamp=' . ObjectSerializer::toQueryValue($timestamp)); + if('form' === 'form' && is_array($timestamp)) { + foreach($timestamp as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['timestamp'] = $timestamp; + } } - // Query Param: filters[] + // Query Param: filters if ($filters !== null) { if (is_array($filters)) { foreach ($filters as $p) { - array_push($queryParams, "filters[]=$p"); + array_push($queryParams, "filters=$p"); } } else { - throw new \InvalidArgumentException('Did not receive an array when expecting one for query parameter filters[]'); + throw new \InvalidArgumentException('Did not receive an array when expecting one for query parameter filters'); } } // Query Param: order_by if ($order_by !== null) { - array_push($queryParams, 'order_by=' . ObjectSerializer::toQueryValue($order_by)); + if('form' === 'form' && is_array($order_by)) { + foreach($order_by as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['order_by'] = $order_by; + } } // Query Param: order_direction if ($order_direction !== null) { - array_push($queryParams, 'order_direction=' . ObjectSerializer::toQueryValue($order_direction)); + if('form' === 'form' && is_array($order_direction)) { + foreach($order_direction as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['order_direction'] = $order_direction; + } } @@ -364,8 +404,6 @@ protected function getRealtimeBreakdownRequest($realtime_metric_id, $optionalPar ); } - // body params - $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -379,21 +417,17 @@ protected function getRealtimeBreakdownRequest($realtime_metric_id, $optionalPar } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -409,7 +443,7 @@ protected function getRealtimeBreakdownRequest($realtime_metric_id, $optionalPar // 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()); + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); } $defaultHeaders = []; @@ -423,11 +457,13 @@ protected function getRealtimeBreakdownRequest($realtime_metric_id, $optionalPar $headers ); - $queryParamsDirect = join('&', $queryParams); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + + // MUX: adds support for array params. + // TODO: future upstream? + $query = ObjectSerializer::buildBetterQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($queryParamsDirect ? "?{$queryParamsDirect}" : ''), + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -439,16 +475,15 @@ protected function getRealtimeBreakdownRequest($realtime_metric_id, $optionalPar * Get Real-Time Histogram Timeseries * * @param string $realtime_metric_id ID of the Realtime Metric (required) - * @param mixed[] $optionalParams An associative array of optional parameters which can be passed to this function: - * - filters string[] - Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. (optional) + * @param string[] $filters Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. (optional) * * @throws \MuxPhp\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \MuxPhp\Models\GetRealTimeHistogramTimeseriesResponse */ - public function getRealtimeHistogramTimeseries($realtime_metric_id, $optionalParams = []) + public function getRealtimeHistogramTimeseries($realtime_metric_id, $filters = null) { - list($response) = $this->getRealtimeHistogramTimeseriesWithHttpInfo($realtime_metric_id, $optionalParams); + list($response) = $this->getRealtimeHistogramTimeseriesWithHttpInfo($realtime_metric_id, $filters); return $response; } @@ -458,16 +493,15 @@ public function getRealtimeHistogramTimeseries($realtime_metric_id, $optionalPar * Get Real-Time Histogram Timeseries * * @param string $realtime_metric_id ID of the Realtime Metric (required) - * @param mixed[] $optionalParams An associative array of optional parameters which can be passed to this function: - * - filters string[] - Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. (optional) + * @param string[] $filters Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. (optional) * * @throws \MuxPhp\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \MuxPhp\Models\GetRealTimeHistogramTimeseriesResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getRealtimeHistogramTimeseriesWithHttpInfo($realtime_metric_id, $optionalParams = []) + public function getRealtimeHistogramTimeseriesWithHttpInfo($realtime_metric_id, $filters = null) { - $request = $this->getRealtimeHistogramTimeseriesRequest($realtime_metric_id, $optionalParams); + $request = $this->getRealtimeHistogramTimeseriesRequest($realtime_metric_id, $filters); try { $options = $this->createHttpClientOption(); @@ -478,7 +512,7 @@ public function getRealtimeHistogramTimeseriesWithHttpInfo($realtime_metric_id, "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } @@ -503,7 +537,7 @@ public function getRealtimeHistogramTimeseriesWithHttpInfo($realtime_metric_id, if ('\MuxPhp\Models\GetRealTimeHistogramTimeseriesResponse' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -518,7 +552,7 @@ public function getRealtimeHistogramTimeseriesWithHttpInfo($realtime_metric_id, if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -548,15 +582,14 @@ public function getRealtimeHistogramTimeseriesWithHttpInfo($realtime_metric_id, * Get Real-Time Histogram Timeseries * * @param string $realtime_metric_id ID of the Realtime Metric (required) - * @param mixed[] $optionalParams An associative array of optional parameters which can be passed to this function: - * - filters string[] - Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. (optional) + * @param string[] $filters Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getRealtimeHistogramTimeseriesAsync($realtime_metric_id, $optionalParams = []) + public function getRealtimeHistogramTimeseriesAsync($realtime_metric_id, $filters = null) { - return $this->getRealtimeHistogramTimeseriesAsyncWithHttpInfo($realtime_metric_id, $optionalParams) + return $this->getRealtimeHistogramTimeseriesAsyncWithHttpInfo($realtime_metric_id, $filters) ->then( function ($response) { return $response[0]; @@ -570,16 +603,15 @@ function ($response) { * Get Real-Time Histogram Timeseries * * @param string $realtime_metric_id ID of the Realtime Metric (required) - * @param mixed[] $optionalParams An associative array of optional parameters which can be passed to this function: - * - filters string[] - Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. (optional) + * @param string[] $filters Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getRealtimeHistogramTimeseriesAsyncWithHttpInfo($realtime_metric_id, $optionalParams = []) + public function getRealtimeHistogramTimeseriesAsyncWithHttpInfo($realtime_metric_id, $filters = null) { $returnType = '\MuxPhp\Models\GetRealTimeHistogramTimeseriesResponse'; - $request = $this->getRealtimeHistogramTimeseriesRequest($realtime_metric_id, $optionalParams); + $request = $this->getRealtimeHistogramTimeseriesRequest($realtime_metric_id, $filters); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -589,7 +621,7 @@ function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -619,16 +651,13 @@ function ($exception) { * Create request for operation 'getRealtimeHistogramTimeseries' * * @param string $realtime_metric_id ID of the Realtime Metric (required) - * @param mixed[] $optionalParams An associative array of optional parameters which can be passed to this function: - * - filters string[] - Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. (optional) + * @param string[] $filters Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getRealtimeHistogramTimeseriesRequest($realtime_metric_id, $optionalParams) + public function getRealtimeHistogramTimeseriesRequest($realtime_metric_id, $filters = null) { - // Pull the set optional params from the associative array $optionalParams, setting them to their defaults if they're not set. - $filters = array_key_exists('filters', $optionalParams) ? $optionalParams['filters'] : null; // verify the required parameter 'realtime_metric_id' is set if ($realtime_metric_id === null || (is_array($realtime_metric_id) && count($realtime_metric_id) === 0)) { throw new \InvalidArgumentException( @@ -643,15 +672,15 @@ protected function getRealtimeHistogramTimeseriesRequest($realtime_metric_id, $o $httpBody = ''; $multipart = false; - // Query Param: filters[] + // Query Param: filters if ($filters !== null) { if (is_array($filters)) { foreach ($filters as $p) { - array_push($queryParams, "filters[]=$p"); + array_push($queryParams, "filters=$p"); } } else { - throw new \InvalidArgumentException('Did not receive an array when expecting one for query parameter filters[]'); + throw new \InvalidArgumentException('Did not receive an array when expecting one for query parameter filters'); } } @@ -665,8 +694,6 @@ protected function getRealtimeHistogramTimeseriesRequest($realtime_metric_id, $o ); } - // body params - $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -680,21 +707,17 @@ protected function getRealtimeHistogramTimeseriesRequest($realtime_metric_id, $o } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -710,7 +733,7 @@ protected function getRealtimeHistogramTimeseriesRequest($realtime_metric_id, $o // 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()); + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); } $defaultHeaders = []; @@ -724,11 +747,13 @@ protected function getRealtimeHistogramTimeseriesRequest($realtime_metric_id, $o $headers ); - $queryParamsDirect = join('&', $queryParams); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + + // MUX: adds support for array params. + // TODO: future upstream? + $query = ObjectSerializer::buildBetterQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($queryParamsDirect ? "?{$queryParamsDirect}" : ''), + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -740,16 +765,15 @@ protected function getRealtimeHistogramTimeseriesRequest($realtime_metric_id, $o * Get Real-Time Timeseries * * @param string $realtime_metric_id ID of the Realtime Metric (required) - * @param mixed[] $optionalParams An associative array of optional parameters which can be passed to this function: - * - filters string[] - Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. (optional) + * @param string[] $filters Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. (optional) * * @throws \MuxPhp\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \MuxPhp\Models\GetRealTimeTimeseriesResponse */ - public function getRealtimeTimeseries($realtime_metric_id, $optionalParams = []) + public function getRealtimeTimeseries($realtime_metric_id, $filters = null) { - list($response) = $this->getRealtimeTimeseriesWithHttpInfo($realtime_metric_id, $optionalParams); + list($response) = $this->getRealtimeTimeseriesWithHttpInfo($realtime_metric_id, $filters); return $response; } @@ -759,16 +783,15 @@ public function getRealtimeTimeseries($realtime_metric_id, $optionalParams = []) * Get Real-Time Timeseries * * @param string $realtime_metric_id ID of the Realtime Metric (required) - * @param mixed[] $optionalParams An associative array of optional parameters which can be passed to this function: - * - filters string[] - Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. (optional) + * @param string[] $filters Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. (optional) * * @throws \MuxPhp\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \MuxPhp\Models\GetRealTimeTimeseriesResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getRealtimeTimeseriesWithHttpInfo($realtime_metric_id, $optionalParams = []) + public function getRealtimeTimeseriesWithHttpInfo($realtime_metric_id, $filters = null) { - $request = $this->getRealtimeTimeseriesRequest($realtime_metric_id, $optionalParams); + $request = $this->getRealtimeTimeseriesRequest($realtime_metric_id, $filters); try { $options = $this->createHttpClientOption(); @@ -779,7 +802,7 @@ public function getRealtimeTimeseriesWithHttpInfo($realtime_metric_id, $optional "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } @@ -804,7 +827,7 @@ public function getRealtimeTimeseriesWithHttpInfo($realtime_metric_id, $optional if ('\MuxPhp\Models\GetRealTimeTimeseriesResponse' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -819,7 +842,7 @@ public function getRealtimeTimeseriesWithHttpInfo($realtime_metric_id, $optional if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -849,15 +872,14 @@ public function getRealtimeTimeseriesWithHttpInfo($realtime_metric_id, $optional * Get Real-Time Timeseries * * @param string $realtime_metric_id ID of the Realtime Metric (required) - * @param mixed[] $optionalParams An associative array of optional parameters which can be passed to this function: - * - filters string[] - Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. (optional) + * @param string[] $filters Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getRealtimeTimeseriesAsync($realtime_metric_id, $optionalParams = []) + public function getRealtimeTimeseriesAsync($realtime_metric_id, $filters = null) { - return $this->getRealtimeTimeseriesAsyncWithHttpInfo($realtime_metric_id, $optionalParams) + return $this->getRealtimeTimeseriesAsyncWithHttpInfo($realtime_metric_id, $filters) ->then( function ($response) { return $response[0]; @@ -871,16 +893,15 @@ function ($response) { * Get Real-Time Timeseries * * @param string $realtime_metric_id ID of the Realtime Metric (required) - * @param mixed[] $optionalParams An associative array of optional parameters which can be passed to this function: - * - filters string[] - Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. (optional) + * @param string[] $filters Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getRealtimeTimeseriesAsyncWithHttpInfo($realtime_metric_id, $optionalParams = []) + public function getRealtimeTimeseriesAsyncWithHttpInfo($realtime_metric_id, $filters = null) { $returnType = '\MuxPhp\Models\GetRealTimeTimeseriesResponse'; - $request = $this->getRealtimeTimeseriesRequest($realtime_metric_id, $optionalParams); + $request = $this->getRealtimeTimeseriesRequest($realtime_metric_id, $filters); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -890,7 +911,7 @@ function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -920,16 +941,13 @@ function ($exception) { * Create request for operation 'getRealtimeTimeseries' * * @param string $realtime_metric_id ID of the Realtime Metric (required) - * @param mixed[] $optionalParams An associative array of optional parameters which can be passed to this function: - * - filters string[] - Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. (optional) + * @param string[] $filters Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getRealtimeTimeseriesRequest($realtime_metric_id, $optionalParams) + public function getRealtimeTimeseriesRequest($realtime_metric_id, $filters = null) { - // Pull the set optional params from the associative array $optionalParams, setting them to their defaults if they're not set. - $filters = array_key_exists('filters', $optionalParams) ? $optionalParams['filters'] : null; // verify the required parameter 'realtime_metric_id' is set if ($realtime_metric_id === null || (is_array($realtime_metric_id) && count($realtime_metric_id) === 0)) { throw new \InvalidArgumentException( @@ -944,15 +962,15 @@ protected function getRealtimeTimeseriesRequest($realtime_metric_id, $optionalPa $httpBody = ''; $multipart = false; - // Query Param: filters[] + // Query Param: filters if ($filters !== null) { if (is_array($filters)) { foreach ($filters as $p) { - array_push($queryParams, "filters[]=$p"); + array_push($queryParams, "filters=$p"); } } else { - throw new \InvalidArgumentException('Did not receive an array when expecting one for query parameter filters[]'); + throw new \InvalidArgumentException('Did not receive an array when expecting one for query parameter filters'); } } @@ -966,8 +984,6 @@ protected function getRealtimeTimeseriesRequest($realtime_metric_id, $optionalPa ); } - // body params - $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -981,21 +997,17 @@ protected function getRealtimeTimeseriesRequest($realtime_metric_id, $optionalPa } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -1011,7 +1023,7 @@ protected function getRealtimeTimeseriesRequest($realtime_metric_id, $optionalPa // 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()); + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); } $defaultHeaders = []; @@ -1025,11 +1037,13 @@ protected function getRealtimeTimeseriesRequest($realtime_metric_id, $optionalPa $headers ); - $queryParamsDirect = join('&', $queryParams); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + + // MUX: adds support for array params. + // TODO: future upstream? + $query = ObjectSerializer::buildBetterQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($queryParamsDirect ? "?{$queryParamsDirect}" : ''), + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1074,7 +1088,7 @@ public function listRealtimeDimensionsWithHttpInfo() "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } @@ -1099,7 +1113,7 @@ public function listRealtimeDimensionsWithHttpInfo() if ('\MuxPhp\Models\ListRealTimeDimensionsResponse' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -1114,7 +1128,7 @@ public function listRealtimeDimensionsWithHttpInfo() if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -1179,7 +1193,7 @@ function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -1212,7 +1226,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function listRealtimeDimensionsRequest() + public function listRealtimeDimensionsRequest() { $resourcePath = '/data/v1/realtime/dimensions'; @@ -1225,8 +1239,6 @@ protected function listRealtimeDimensionsRequest() - // body params - $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -1240,21 +1252,17 @@ protected function listRealtimeDimensionsRequest() } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -1270,7 +1278,7 @@ protected function listRealtimeDimensionsRequest() // 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()); + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); } $defaultHeaders = []; @@ -1284,11 +1292,13 @@ protected function listRealtimeDimensionsRequest() $headers ); - $queryParamsDirect = join('&', $queryParams); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + + // MUX: adds support for array params. + // TODO: future upstream? + $query = ObjectSerializer::buildBetterQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($queryParamsDirect ? "?{$queryParamsDirect}" : ''), + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1333,7 +1343,7 @@ public function listRealtimeMetricsWithHttpInfo() "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } @@ -1358,7 +1368,7 @@ public function listRealtimeMetricsWithHttpInfo() if ('\MuxPhp\Models\ListRealTimeMetricsResponse' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -1373,7 +1383,7 @@ public function listRealtimeMetricsWithHttpInfo() if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -1438,7 +1448,7 @@ function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -1471,7 +1481,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function listRealtimeMetricsRequest() + public function listRealtimeMetricsRequest() { $resourcePath = '/data/v1/realtime/metrics'; @@ -1484,8 +1494,6 @@ protected function listRealtimeMetricsRequest() - // body params - $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -1499,21 +1507,17 @@ protected function listRealtimeMetricsRequest() } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -1529,7 +1533,7 @@ protected function listRealtimeMetricsRequest() // 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()); + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); } $defaultHeaders = []; @@ -1543,11 +1547,13 @@ protected function listRealtimeMetricsRequest() $headers ); - $queryParamsDirect = join('&', $queryParams); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + + // MUX: adds support for array params. + // TODO: future upstream? + $query = ObjectSerializer::buildBetterQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($queryParamsDirect ? "?{$queryParamsDirect}" : ''), + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); diff --git a/MuxPhp/Api/URLSigningKeysApi.php b/MuxPhp/Api/URLSigningKeysApi.php index 3855631..0e21671 100644 --- a/MuxPhp/Api/URLSigningKeysApi.php +++ b/MuxPhp/Api/URLSigningKeysApi.php @@ -1,8 +1,29 @@ client = $client ?: new Client(); $this->config = $config ?: new Configuration(); $this->headerSelector = $selector ?: new HeaderSelector(); - $this->hostIndex = $host_index; + $this->hostIndex = $hostIndex; } /** * Set the host index * - * @param int $host_index Host index (required) + * @param int $hostIndex Host index (required) */ - public function setHostIndex($host_index) + public function setHostIndex($hostIndex) { - $this->hostIndex = $host_index; + $this->hostIndex = $hostIndex; } /** * Get the host index * - * @return Host index + * @return int Host index */ public function getHostIndex() { @@ -131,7 +154,7 @@ public function createUrlSigningKeyWithHttpInfo() "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } @@ -156,7 +179,7 @@ public function createUrlSigningKeyWithHttpInfo() if ('\MuxPhp\Models\SigningKeyResponse' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -171,7 +194,7 @@ public function createUrlSigningKeyWithHttpInfo() if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -236,7 +259,7 @@ function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -269,7 +292,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function createUrlSigningKeyRequest() + public function createUrlSigningKeyRequest() { $resourcePath = '/video/v1/signing-keys'; @@ -282,8 +305,6 @@ protected function createUrlSigningKeyRequest() - // body params - $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -297,21 +318,17 @@ protected function createUrlSigningKeyRequest() } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -327,7 +344,7 @@ protected function createUrlSigningKeyRequest() // 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()); + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); } $defaultHeaders = []; @@ -341,11 +358,13 @@ protected function createUrlSigningKeyRequest() $headers ); - $queryParamsDirect = join('&', $queryParams); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + + // MUX: adds support for array params. + // TODO: future upstream? + $query = ObjectSerializer::buildBetterQuery($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($queryParamsDirect ? "?{$queryParamsDirect}" : ''), + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -391,7 +410,7 @@ public function deleteUrlSigningKeyWithHttpInfo($signing_key_id) "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } @@ -485,7 +504,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function deleteUrlSigningKeyRequest($signing_key_id) + public function deleteUrlSigningKeyRequest($signing_key_id) { // verify the required parameter 'signing_key_id' is set if ($signing_key_id === null || (is_array($signing_key_id) && count($signing_key_id) === 0)) { @@ -512,8 +531,6 @@ protected function deleteUrlSigningKeyRequest($signing_key_id) ); } - // body params - $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -527,21 +544,17 @@ protected function deleteUrlSigningKeyRequest($signing_key_id) } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -557,7 +570,7 @@ protected function deleteUrlSigningKeyRequest($signing_key_id) // 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()); + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); } $defaultHeaders = []; @@ -571,11 +584,13 @@ protected function deleteUrlSigningKeyRequest($signing_key_id) $headers ); - $queryParamsDirect = join('&', $queryParams); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + + // MUX: adds support for array params. + // TODO: future upstream? + $query = ObjectSerializer::buildBetterQuery($queryParams); return new Request( 'DELETE', - $this->config->getHost() . $resourcePath . ($queryParamsDirect ? "?{$queryParamsDirect}" : ''), + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -622,7 +637,7 @@ public function getUrlSigningKeyWithHttpInfo($signing_key_id) "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } @@ -647,7 +662,7 @@ public function getUrlSigningKeyWithHttpInfo($signing_key_id) if ('\MuxPhp\Models\SigningKeyResponse' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -662,7 +677,7 @@ public function getUrlSigningKeyWithHttpInfo($signing_key_id) if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -729,7 +744,7 @@ function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -763,7 +778,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getUrlSigningKeyRequest($signing_key_id) + public function getUrlSigningKeyRequest($signing_key_id) { // verify the required parameter 'signing_key_id' is set if ($signing_key_id === null || (is_array($signing_key_id) && count($signing_key_id) === 0)) { @@ -790,8 +805,6 @@ protected function getUrlSigningKeyRequest($signing_key_id) ); } - // body params - $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -805,21 +818,17 @@ protected function getUrlSigningKeyRequest($signing_key_id) } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -835,7 +844,7 @@ protected function getUrlSigningKeyRequest($signing_key_id) // 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()); + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); } $defaultHeaders = []; @@ -849,11 +858,13 @@ protected function getUrlSigningKeyRequest($signing_key_id) $headers ); - $queryParamsDirect = join('&', $queryParams); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + + // MUX: adds support for array params. + // TODO: future upstream? + $query = ObjectSerializer::buildBetterQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($queryParamsDirect ? "?{$queryParamsDirect}" : ''), + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -864,17 +875,16 @@ protected function getUrlSigningKeyRequest($signing_key_id) * * List URL signing keys * - * @param mixed[] $optionalParams An associative array of optional parameters which can be passed to this function: - * - 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) + * @param int $limit Number of items to include in the response (optional, default to 25) + * @param int $page Offset by this many pages, of the size of `limit` (optional, default to 1) * * @throws \MuxPhp\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \MuxPhp\Models\ListSigningKeysResponse */ - public function listUrlSigningKeys($optionalParams = []) + public function listUrlSigningKeys($limit = 25, $page = 1) { - list($response) = $this->listUrlSigningKeysWithHttpInfo($optionalParams); + list($response) = $this->listUrlSigningKeysWithHttpInfo($limit, $page); return $response; } @@ -883,17 +893,16 @@ public function listUrlSigningKeys($optionalParams = []) * * List URL signing keys * - * @param mixed[] $optionalParams An associative array of optional parameters which can be passed to this function: - * - 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) + * @param int $limit Number of items to include in the response (optional, default to 25) + * @param int $page Offset by this many pages, of the size of `limit` (optional, default to 1) * * @throws \MuxPhp\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \MuxPhp\Models\ListSigningKeysResponse, HTTP status code, HTTP response headers (array of strings) */ - public function listUrlSigningKeysWithHttpInfo($optionalParams = []) + public function listUrlSigningKeysWithHttpInfo($limit = 25, $page = 1) { - $request = $this->listUrlSigningKeysRequest($optionalParams); + $request = $this->listUrlSigningKeysRequest($limit, $page); try { $options = $this->createHttpClientOption(); @@ -904,7 +913,7 @@ public function listUrlSigningKeysWithHttpInfo($optionalParams = []) "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } @@ -929,7 +938,7 @@ public function listUrlSigningKeysWithHttpInfo($optionalParams = []) if ('\MuxPhp\Models\ListSigningKeysResponse' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -944,7 +953,7 @@ public function listUrlSigningKeysWithHttpInfo($optionalParams = []) if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -973,16 +982,15 @@ public function listUrlSigningKeysWithHttpInfo($optionalParams = []) * * List URL signing keys * - * @param mixed[] $optionalParams An associative array of optional parameters which can be passed to this function: - * - 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) + * @param int $limit Number of items to include in the response (optional, default to 25) + * @param int $page Offset by this many pages, of the size of `limit` (optional, default to 1) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function listUrlSigningKeysAsync($optionalParams = []) + public function listUrlSigningKeysAsync($limit = 25, $page = 1) { - return $this->listUrlSigningKeysAsyncWithHttpInfo($optionalParams) + return $this->listUrlSigningKeysAsyncWithHttpInfo($limit, $page) ->then( function ($response) { return $response[0]; @@ -995,17 +1003,16 @@ function ($response) { * * List URL signing keys * - * @param mixed[] $optionalParams An associative array of optional parameters which can be passed to this function: - * - 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) + * @param int $limit Number of items to include in the response (optional, default to 25) + * @param int $page Offset by this many pages, of the size of `limit` (optional, default to 1) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function listUrlSigningKeysAsyncWithHttpInfo($optionalParams = []) + public function listUrlSigningKeysAsyncWithHttpInfo($limit = 25, $page = 1) { $returnType = '\MuxPhp\Models\ListSigningKeysResponse'; - $request = $this->listUrlSigningKeysRequest($optionalParams); + $request = $this->listUrlSigningKeysRequest($limit, $page); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1015,7 +1022,7 @@ function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -1044,18 +1051,14 @@ function ($exception) { /** * Create request for operation 'listUrlSigningKeys' * - * @param mixed[] $optionalParams An associative array of optional parameters which can be passed to this function: - * - 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) + * @param int $limit Number of items to include in the response (optional, default to 25) + * @param int $page Offset by this many pages, of the size of `limit` (optional, default to 1) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function listUrlSigningKeysRequest($optionalParams) + public function listUrlSigningKeysRequest($limit = 25, $page = 1) { - // Pull the set optional params from the associative array $optionalParams, setting them to their defaults if they're not set. - $limit = array_key_exists('limit', $optionalParams) ? $optionalParams['limit'] : 25; - $page = array_key_exists('page', $optionalParams) ? $optionalParams['page'] : 1; $resourcePath = '/video/v1/signing-keys'; $formParams = []; @@ -1066,17 +1069,29 @@ protected function listUrlSigningKeysRequest($optionalParams) // Query Param: limit if ($limit !== null) { - array_push($queryParams, 'limit=' . ObjectSerializer::toQueryValue($limit)); + if('form' === 'form' && is_array($limit)) { + foreach($limit as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['limit'] = $limit; + } } // Query Param: page if ($page !== null) { - array_push($queryParams, 'page=' . ObjectSerializer::toQueryValue($page)); + if('form' === 'form' && is_array($page)) { + foreach($page as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['page'] = $page; + } } - // body params - $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -1090,21 +1105,17 @@ protected function listUrlSigningKeysRequest($optionalParams) } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -1120,7 +1131,7 @@ protected function listUrlSigningKeysRequest($optionalParams) // 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()); + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); } $defaultHeaders = []; @@ -1134,11 +1145,13 @@ protected function listUrlSigningKeysRequest($optionalParams) $headers ); - $queryParamsDirect = join('&', $queryParams); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + + // MUX: adds support for array params. + // TODO: future upstream? + $query = ObjectSerializer::buildBetterQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($queryParamsDirect ? "?{$queryParamsDirect}" : ''), + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); diff --git a/MuxPhp/Api/VideoViewsApi.php b/MuxPhp/Api/VideoViewsApi.php index 47e996b..99bb229 100644 --- a/MuxPhp/Api/VideoViewsApi.php +++ b/MuxPhp/Api/VideoViewsApi.php @@ -1,8 +1,29 @@ client = $client ?: new Client(); $this->config = $config ?: new Configuration(); $this->headerSelector = $selector ?: new HeaderSelector(); - $this->hostIndex = $host_index; + $this->hostIndex = $hostIndex; } /** * Set the host index * - * @param int $host_index Host index (required) + * @param int $hostIndex Host index (required) */ - public function setHostIndex($host_index) + public function setHostIndex($hostIndex) { - $this->hostIndex = $host_index; + $this->hostIndex = $hostIndex; } /** * Get the host index * - * @return Host index + * @return int Host index */ public function getHostIndex() { @@ -133,7 +156,7 @@ public function getVideoViewWithHttpInfo($video_view_id) "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } @@ -158,7 +181,7 @@ public function getVideoViewWithHttpInfo($video_view_id) if ('\MuxPhp\Models\VideoViewResponse' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -173,7 +196,7 @@ public function getVideoViewWithHttpInfo($video_view_id) if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -240,7 +263,7 @@ function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -274,7 +297,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getVideoViewRequest($video_view_id) + public function getVideoViewRequest($video_view_id) { // verify the required parameter 'video_view_id' is set if ($video_view_id === null || (is_array($video_view_id) && count($video_view_id) === 0)) { @@ -301,8 +324,6 @@ protected function getVideoViewRequest($video_view_id) ); } - // body params - $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -316,21 +337,17 @@ protected function getVideoViewRequest($video_view_id) } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -346,7 +363,7 @@ protected function getVideoViewRequest($video_view_id) // 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()); + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); } $defaultHeaders = []; @@ -360,11 +377,13 @@ protected function getVideoViewRequest($video_view_id) $headers ); - $queryParamsDirect = join('&', $queryParams); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + + // MUX: adds support for array params. + // TODO: future upstream? + $query = ObjectSerializer::buildBetterQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($queryParamsDirect ? "?{$queryParamsDirect}" : ''), + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -375,22 +394,21 @@ protected function getVideoViewRequest($video_view_id) * * List Video Views * - * @param mixed[] $optionalParams An associative array of optional parameters which can be passed to this function: - * - 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) - * - viewer_id string - Viewer ID to filter results by. This value may be provided by the integration, or may be created by Mux. (optional) - * - error_id int - Filter video views by the provided error ID (as returned in the error_type_id field in the list video views endpoint). If you provide any as the error ID, this will filter the results to those with any error. (optional) - * - order_direction string - Sort order. (optional) - * - filters string[] - Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. (optional) - * - timeframe string[] - Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. (optional) + * @param int $limit Number of items to include in the response (optional, default to 25) + * @param int $page Offset by this many pages, of the size of `limit` (optional, default to 1) + * @param string $viewer_id Viewer ID to filter results by. This value may be provided by the integration, or may be created by Mux. (optional) + * @param int $error_id Filter video views by the provided error ID (as returned in the error_type_id field in the list video views endpoint). If you provide any as the error ID, this will filter the results to those with any error. (optional) + * @param string $order_direction Sort order. (optional) + * @param string[] $filters Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. (optional) + * @param string[] $timeframe Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. (optional) * * @throws \MuxPhp\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \MuxPhp\Models\ListVideoViewsResponse */ - public function listVideoViews($optionalParams = []) + public function listVideoViews($limit = 25, $page = 1, $viewer_id = null, $error_id = null, $order_direction = null, $filters = null, $timeframe = null) { - list($response) = $this->listVideoViewsWithHttpInfo($optionalParams); + list($response) = $this->listVideoViewsWithHttpInfo($limit, $page, $viewer_id, $error_id, $order_direction, $filters, $timeframe); return $response; } @@ -399,22 +417,21 @@ public function listVideoViews($optionalParams = []) * * List Video Views * - * @param mixed[] $optionalParams An associative array of optional parameters which can be passed to this function: - * - 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) - * - viewer_id string - Viewer ID to filter results by. This value may be provided by the integration, or may be created by Mux. (optional) - * - error_id int - Filter video views by the provided error ID (as returned in the error_type_id field in the list video views endpoint). If you provide any as the error ID, this will filter the results to those with any error. (optional) - * - order_direction string - Sort order. (optional) - * - filters string[] - Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. (optional) - * - timeframe string[] - Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. (optional) + * @param int $limit Number of items to include in the response (optional, default to 25) + * @param int $page Offset by this many pages, of the size of `limit` (optional, default to 1) + * @param string $viewer_id Viewer ID to filter results by. This value may be provided by the integration, or may be created by Mux. (optional) + * @param int $error_id Filter video views by the provided error ID (as returned in the error_type_id field in the list video views endpoint). If you provide any as the error ID, this will filter the results to those with any error. (optional) + * @param string $order_direction Sort order. (optional) + * @param string[] $filters Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. (optional) + * @param string[] $timeframe Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. (optional) * * @throws \MuxPhp\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \MuxPhp\Models\ListVideoViewsResponse, HTTP status code, HTTP response headers (array of strings) */ - public function listVideoViewsWithHttpInfo($optionalParams = []) + public function listVideoViewsWithHttpInfo($limit = 25, $page = 1, $viewer_id = null, $error_id = null, $order_direction = null, $filters = null, $timeframe = null) { - $request = $this->listVideoViewsRequest($optionalParams); + $request = $this->listVideoViewsRequest($limit, $page, $viewer_id, $error_id, $order_direction, $filters, $timeframe); try { $options = $this->createHttpClientOption(); @@ -425,7 +442,7 @@ public function listVideoViewsWithHttpInfo($optionalParams = []) "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } @@ -450,7 +467,7 @@ public function listVideoViewsWithHttpInfo($optionalParams = []) if ('\MuxPhp\Models\ListVideoViewsResponse' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -465,7 +482,7 @@ public function listVideoViewsWithHttpInfo($optionalParams = []) if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -494,21 +511,20 @@ public function listVideoViewsWithHttpInfo($optionalParams = []) * * List Video Views * - * @param mixed[] $optionalParams An associative array of optional parameters which can be passed to this function: - * - 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) - * - viewer_id string - Viewer ID to filter results by. This value may be provided by the integration, or may be created by Mux. (optional) - * - error_id int - Filter video views by the provided error ID (as returned in the error_type_id field in the list video views endpoint). If you provide any as the error ID, this will filter the results to those with any error. (optional) - * - order_direction string - Sort order. (optional) - * - filters string[] - Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. (optional) - * - timeframe string[] - Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. (optional) + * @param int $limit Number of items to include in the response (optional, default to 25) + * @param int $page Offset by this many pages, of the size of `limit` (optional, default to 1) + * @param string $viewer_id Viewer ID to filter results by. This value may be provided by the integration, or may be created by Mux. (optional) + * @param int $error_id Filter video views by the provided error ID (as returned in the error_type_id field in the list video views endpoint). If you provide any as the error ID, this will filter the results to those with any error. (optional) + * @param string $order_direction Sort order. (optional) + * @param string[] $filters Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. (optional) + * @param string[] $timeframe Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function listVideoViewsAsync($optionalParams = []) + public function listVideoViewsAsync($limit = 25, $page = 1, $viewer_id = null, $error_id = null, $order_direction = null, $filters = null, $timeframe = null) { - return $this->listVideoViewsAsyncWithHttpInfo($optionalParams) + return $this->listVideoViewsAsyncWithHttpInfo($limit, $page, $viewer_id, $error_id, $order_direction, $filters, $timeframe) ->then( function ($response) { return $response[0]; @@ -521,22 +537,21 @@ function ($response) { * * List Video Views * - * @param mixed[] $optionalParams An associative array of optional parameters which can be passed to this function: - * - 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) - * - viewer_id string - Viewer ID to filter results by. This value may be provided by the integration, or may be created by Mux. (optional) - * - error_id int - Filter video views by the provided error ID (as returned in the error_type_id field in the list video views endpoint). If you provide any as the error ID, this will filter the results to those with any error. (optional) - * - order_direction string - Sort order. (optional) - * - filters string[] - Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. (optional) - * - timeframe string[] - Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. (optional) + * @param int $limit Number of items to include in the response (optional, default to 25) + * @param int $page Offset by this many pages, of the size of `limit` (optional, default to 1) + * @param string $viewer_id Viewer ID to filter results by. This value may be provided by the integration, or may be created by Mux. (optional) + * @param int $error_id Filter video views by the provided error ID (as returned in the error_type_id field in the list video views endpoint). If you provide any as the error ID, this will filter the results to those with any error. (optional) + * @param string $order_direction Sort order. (optional) + * @param string[] $filters Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. (optional) + * @param string[] $timeframe Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function listVideoViewsAsyncWithHttpInfo($optionalParams = []) + public function listVideoViewsAsyncWithHttpInfo($limit = 25, $page = 1, $viewer_id = null, $error_id = null, $order_direction = null, $filters = null, $timeframe = null) { $returnType = '\MuxPhp\Models\ListVideoViewsResponse'; - $request = $this->listVideoViewsRequest($optionalParams); + $request = $this->listVideoViewsRequest($limit, $page, $viewer_id, $error_id, $order_direction, $filters, $timeframe); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -546,7 +561,7 @@ function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -575,28 +590,19 @@ function ($exception) { /** * Create request for operation 'listVideoViews' * - * @param mixed[] $optionalParams An associative array of optional parameters which can be passed to this function: - * - 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) - * - viewer_id string - Viewer ID to filter results by. This value may be provided by the integration, or may be created by Mux. (optional) - * - error_id int - Filter video views by the provided error ID (as returned in the error_type_id field in the list video views endpoint). If you provide any as the error ID, this will filter the results to those with any error. (optional) - * - order_direction string - Sort order. (optional) - * - filters string[] - Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. (optional) - * - timeframe string[] - Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. (optional) + * @param int $limit Number of items to include in the response (optional, default to 25) + * @param int $page Offset by this many pages, of the size of `limit` (optional, default to 1) + * @param string $viewer_id Viewer ID to filter results by. This value may be provided by the integration, or may be created by Mux. (optional) + * @param int $error_id Filter video views by the provided error ID (as returned in the error_type_id field in the list video views endpoint). If you provide any as the error ID, this will filter the results to those with any error. (optional) + * @param string $order_direction Sort order. (optional) + * @param string[] $filters Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. (optional) + * @param string[] $timeframe Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function listVideoViewsRequest($optionalParams) + public function listVideoViewsRequest($limit = 25, $page = 1, $viewer_id = null, $error_id = null, $order_direction = null, $filters = null, $timeframe = null) { - // Pull the set optional params from the associative array $optionalParams, setting them to their defaults if they're not set. - $limit = array_key_exists('limit', $optionalParams) ? $optionalParams['limit'] : 25; - $page = array_key_exists('page', $optionalParams) ? $optionalParams['page'] : 1; - $viewer_id = array_key_exists('viewer_id', $optionalParams) ? $optionalParams['viewer_id'] : null; - $error_id = array_key_exists('error_id', $optionalParams) ? $optionalParams['error_id'] : null; - $order_direction = array_key_exists('order_direction', $optionalParams) ? $optionalParams['order_direction'] : null; - $filters = array_key_exists('filters', $optionalParams) ? $optionalParams['filters'] : null; - $timeframe = array_key_exists('timeframe', $optionalParams) ? $optionalParams['timeframe'] : null; $resourcePath = '/data/v1/video-views'; $formParams = []; @@ -607,51 +613,84 @@ protected function listVideoViewsRequest($optionalParams) // Query Param: limit if ($limit !== null) { - array_push($queryParams, 'limit=' . ObjectSerializer::toQueryValue($limit)); + if('form' === 'form' && is_array($limit)) { + foreach($limit as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['limit'] = $limit; + } } // Query Param: page if ($page !== null) { - array_push($queryParams, 'page=' . ObjectSerializer::toQueryValue($page)); + if('form' === 'form' && is_array($page)) { + foreach($page as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['page'] = $page; + } } // Query Param: viewer_id if ($viewer_id !== null) { - array_push($queryParams, 'viewer_id=' . ObjectSerializer::toQueryValue($viewer_id)); + if('form' === 'form' && is_array($viewer_id)) { + foreach($viewer_id as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['viewer_id'] = $viewer_id; + } } // Query Param: error_id if ($error_id !== null) { - array_push($queryParams, 'error_id=' . ObjectSerializer::toQueryValue($error_id)); + if('form' === 'form' && is_array($error_id)) { + foreach($error_id as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['error_id'] = $error_id; + } } // Query Param: order_direction if ($order_direction !== null) { - array_push($queryParams, 'order_direction=' . ObjectSerializer::toQueryValue($order_direction)); + if('form' === 'form' && is_array($order_direction)) { + foreach($order_direction as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['order_direction'] = $order_direction; + } } - // Query Param: filters[] + // Query Param: filters if ($filters !== null) { if (is_array($filters)) { foreach ($filters as $p) { - array_push($queryParams, "filters[]=$p"); + array_push($queryParams, "filters=$p"); } } else { - throw new \InvalidArgumentException('Did not receive an array when expecting one for query parameter filters[]'); + throw new \InvalidArgumentException('Did not receive an array when expecting one for query parameter filters'); } } - // Query Param: timeframe[] + // Query Param: timeframe if ($timeframe !== null) { if (is_array($timeframe)) { foreach ($timeframe as $p) { - array_push($queryParams, "timeframe[]=$p"); + array_push($queryParams, "timeframe=$p"); } } else { - throw new \InvalidArgumentException('Did not receive an array when expecting one for query parameter timeframe[]'); + throw new \InvalidArgumentException('Did not receive an array when expecting one for query parameter timeframe'); } } - // body params - $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -665,21 +704,17 @@ protected function listVideoViewsRequest($optionalParams) } // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -695,7 +730,7 @@ protected function listVideoViewsRequest($optionalParams) // 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()); + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); } $defaultHeaders = []; @@ -709,11 +744,13 @@ protected function listVideoViewsRequest($optionalParams) $headers ); - $queryParamsDirect = join('&', $queryParams); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + + // MUX: adds support for array params. + // TODO: future upstream? + $query = ObjectSerializer::buildBetterQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($queryParamsDirect ? "?{$queryParamsDirect}" : ''), + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); diff --git a/MuxPhp/ApiException.php b/MuxPhp/ApiException.php index 898a27a..b6159bf 100644 --- a/MuxPhp/ApiException.php +++ b/MuxPhp/ApiException.php @@ -1,8 +1,29 @@ responseHeaders = $responseHeaders; @@ -67,7 +90,7 @@ public function getResponseHeaders() /** * Gets the HTTP body of the server response either as Json or string * - * @return mixed HTTP body of the server response either as \stdClass or string + * @return \stdClass|string|null HTTP body of the server response either as \stdClass or string */ public function getResponseBody() { diff --git a/MuxPhp/Configuration.php b/MuxPhp/Configuration.php index 793915e..153a762 100644 --- a/MuxPhp/Configuration.php +++ b/MuxPhp/Configuration.php @@ -1,21 +1,47 @@ getTempFolderPath() . PHP_EOL; @@ -385,7 +411,7 @@ public static function toDebugReport() * * @param string $apiKeyIdentifier name of apikey * - * @return string API key with the prefix + * @return null|string API key with the prefix */ public function getApiKeyWithPrefix($apiKeyIdentifier) { @@ -408,24 +434,24 @@ public function getApiKeyWithPrefix($apiKeyIdentifier) /** * Returns an array of host settings * - * @return an array of host settings + * @return array an array of host settings */ public function getHostSettings() { return [ - [ - 'url' => 'https://api.mux.com/', - 'description' => 'Mux Production Environment', - ] + [ + "url" => "https://api.mux.com", + "description" => "Mux Production Environment", + ] ]; } /** * Returns URL based on the index and variables * - * @param $index array index of the host settings - * @param $variables hash of variable and the corresponding value (optional) - * @return URL based on host settings + * @param int $index index of the host settings + * @param array|null $variables hash of variable and the corresponding value (optional) + * @return string URL based on host settings */ public function getHostFromSettings($index, $variables = null) { @@ -441,19 +467,19 @@ public function getHostFromSettings($index, $variables = null) } $host = $hosts[$index]; - $url = $host['url']; + $url = $host["url"]; // go through variable and assign a value - foreach ($host['variables'] as $name => $variable) { + foreach ($host["variables"] ?? [] as $name => $variable) { if (array_key_exists($name, $variables)) { // check to see if it's in the variables provided by the user - if (in_array($variables[$name], $variable['enum_values'], true)) { // check to see if the value is in the enum - $url = str_replace('{'.$name.'}', $variables[$name], $url); + if (in_array($variables[$name], $variable["enum_values"], true)) { // check to see if the value is in the enum + $url = str_replace("{".$name."}", $variables[$name], $url); } else { - throw new \InvalidArgumentException("The variable `$name` in the host URL has invalid value ".$variables[$name].'. Must be '.join(',', $variable['enum_values']).'.'); + throw new \InvalidArgumentException("The variable `$name` in the host URL has invalid value ".$variables[$name].". Must be ".join(',', $variable["enum_values"])."."); } } else { // use default value - $url = str_replace('{'.$name.'}', $variable['default_value'], $url); + $url = str_replace("{".$name."}", $variable["default_value"], $url); } } diff --git a/MuxPhp/HeaderSelector.php b/MuxPhp/HeaderSelector.php index 1f8f724..4d5cfa2 100644 --- a/MuxPhp/HeaderSelector.php +++ b/MuxPhp/HeaderSelector.php @@ -1,8 +1,29 @@ + * @template TKey int|null + * @template TValue mixed|null */ -class AbridgedVideoView implements ModelInterface, ArrayAccess +class AbridgedVideoView implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'AbridgedVideoView'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'id' => 'string', 'viewer_os_family' => 'string', @@ -47,10 +74,12 @@ class AbridgedVideoView implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'id' => null, 'viewer_os_family' => null, @@ -203,17 +232,20 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['id'] = isset($data['id']) ? $data['id'] : null; - $this->container['viewer_os_family'] = isset($data['viewer_os_family']) ? $data['viewer_os_family'] : null; - $this->container['viewer_application_name'] = isset($data['viewer_application_name']) ? $data['viewer_application_name'] : null; - $this->container['video_title'] = isset($data['video_title']) ? $data['video_title'] : null; - $this->container['total_row_count'] = isset($data['total_row_count']) ? $data['total_row_count'] : null; - $this->container['player_error_message'] = isset($data['player_error_message']) ? $data['player_error_message'] : null; - $this->container['player_error_code'] = isset($data['player_error_code']) ? $data['player_error_code'] : null; - $this->container['error_type_id'] = isset($data['error_type_id']) ? $data['error_type_id'] : null; - $this->container['country_code'] = isset($data['country_code']) ? $data['country_code'] : null; - $this->container['view_start'] = isset($data['view_start']) ? $data['view_start'] : null; - $this->container['view_end'] = isset($data['view_end']) ? $data['view_end'] : 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->container['id'] = $data['id'] ?? null; + $this->container['viewer_os_family'] = $data['viewer_os_family'] ?? null; + $this->container['viewer_application_name'] = $data['viewer_application_name'] ?? null; + $this->container['video_title'] = $data['video_title'] ?? null; + $this->container['total_row_count'] = $data['total_row_count'] ?? null; + $this->container['player_error_message'] = $data['player_error_message'] ?? null; + $this->container['player_error_code'] = $data['player_error_code'] ?? null; + $this->container['error_type_id'] = $data['error_type_id'] ?? null; + $this->container['country_code'] = $data['country_code'] ?? null; + $this->container['view_start'] = $data['view_start'] ?? null; + $this->container['view_end'] = $data['view_end'] ?? null; } /** @@ -255,7 +287,7 @@ public function getId() * * @param string|null $id id * - * @return $this + * @return self */ public function setId($id) { @@ -279,7 +311,7 @@ public function getViewerOsFamily() * * @param string|null $viewer_os_family viewer_os_family * - * @return $this + * @return self */ public function setViewerOsFamily($viewer_os_family) { @@ -303,7 +335,7 @@ public function getViewerApplicationName() * * @param string|null $viewer_application_name viewer_application_name * - * @return $this + * @return self */ public function setViewerApplicationName($viewer_application_name) { @@ -327,7 +359,7 @@ public function getVideoTitle() * * @param string|null $video_title video_title * - * @return $this + * @return self */ public function setVideoTitle($video_title) { @@ -351,7 +383,7 @@ public function getTotalRowCount() * * @param int|null $total_row_count total_row_count * - * @return $this + * @return self */ public function setTotalRowCount($total_row_count) { @@ -375,7 +407,7 @@ public function getPlayerErrorMessage() * * @param string|null $player_error_message player_error_message * - * @return $this + * @return self */ public function setPlayerErrorMessage($player_error_message) { @@ -399,7 +431,7 @@ public function getPlayerErrorCode() * * @param string|null $player_error_code player_error_code * - * @return $this + * @return self */ public function setPlayerErrorCode($player_error_code) { @@ -423,7 +455,7 @@ public function getErrorTypeId() * * @param int|null $error_type_id error_type_id * - * @return $this + * @return self */ public function setErrorTypeId($error_type_id) { @@ -447,7 +479,7 @@ public function getCountryCode() * * @param string|null $country_code country_code * - * @return $this + * @return self */ public function setCountryCode($country_code) { @@ -471,7 +503,7 @@ public function getViewStart() * * @param string|null $view_start view_start * - * @return $this + * @return self */ public function setViewStart($view_start) { @@ -495,7 +527,7 @@ public function getViewEnd() * * @param string|null $view_end view_end * - * @return $this + * @return self */ public function setViewEnd($view_end) { @@ -520,18 +552,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -556,6 +588,18 @@ public function offsetUnset($offset) 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. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -568,6 +612,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/MuxPhp/Models/Asset.php b/MuxPhp/Models/Asset.php index 60dabf1..ecc649f 100644 --- a/MuxPhp/Models/Asset.php +++ b/MuxPhp/Models/Asset.php @@ -1,8 +1,30 @@ + * @template TKey int|null + * @template TValue mixed|null */ -class Asset implements ModelInterface, ArrayAccess +class Asset implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'Asset'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'id' => 'string', 'created_at' => 'string', @@ -60,10 +87,12 @@ class Asset implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'id' => null, 'created_at' => 'int64', @@ -249,18 +278,18 @@ public function getModelName() return self::$openAPIModelName; } - const STATUS_PREPARING = 'preparing'; - const STATUS_READY = 'ready'; - const STATUS_ERRORED = 'errored'; - const MAX_STORED_RESOLUTION_AUDIO_ONLY = 'Audio only'; - const MAX_STORED_RESOLUTION_SD = 'SD'; - const MAX_STORED_RESOLUTION_HD = 'HD'; - const MAX_STORED_RESOLUTION_FHD = 'FHD'; - const MAX_STORED_RESOLUTION_UHD = 'UHD'; - const MASTER_ACCESS_TEMPORARY = 'temporary'; - const MASTER_ACCESS_NONE = 'none'; - const MP4_SUPPORT_STANDARD = 'standard'; - const MP4_SUPPORT_NONE = 'none'; + public const STATUS_PREPARING = 'preparing'; + public const STATUS_READY = 'ready'; + public const STATUS_ERRORED = 'errored'; + public const MAX_STORED_RESOLUTION_AUDIO_ONLY = 'Audio only'; + public const MAX_STORED_RESOLUTION_SD = 'SD'; + public const MAX_STORED_RESOLUTION_HD = 'HD'; + public const MAX_STORED_RESOLUTION_FHD = 'FHD'; + public const MAX_STORED_RESOLUTION_UHD = 'UHD'; + public const MASTER_ACCESS_TEMPORARY = 'temporary'; + public const MASTER_ACCESS_NONE = 'none'; + public const MP4_SUPPORT_STANDARD = 'standard'; + public const MP4_SUPPORT_NONE = 'none'; @@ -336,30 +365,33 @@ public function getMp4SupportAllowableValues() */ public function __construct(array $data = null) { - $this->container['id'] = isset($data['id']) ? $data['id'] : null; - $this->container['created_at'] = isset($data['created_at']) ? $data['created_at'] : null; - $this->container['deleted_at'] = isset($data['deleted_at']) ? $data['deleted_at'] : null; - $this->container['status'] = isset($data['status']) ? $data['status'] : null; - $this->container['duration'] = isset($data['duration']) ? $data['duration'] : null; - $this->container['max_stored_resolution'] = isset($data['max_stored_resolution']) ? $data['max_stored_resolution'] : null; - $this->container['max_stored_frame_rate'] = isset($data['max_stored_frame_rate']) ? $data['max_stored_frame_rate'] : null; - $this->container['aspect_ratio'] = isset($data['aspect_ratio']) ? $data['aspect_ratio'] : null; - $this->container['playback_ids'] = isset($data['playback_ids']) ? $data['playback_ids'] : null; - $this->container['tracks'] = isset($data['tracks']) ? $data['tracks'] : null; - $this->container['errors'] = isset($data['errors']) ? $data['errors'] : null; - $this->container['per_title_encode'] = isset($data['per_title_encode']) ? $data['per_title_encode'] : null; - $this->container['is_live'] = isset($data['is_live']) ? $data['is_live'] : null; - $this->container['passthrough'] = isset($data['passthrough']) ? $data['passthrough'] : null; - $this->container['live_stream_id'] = isset($data['live_stream_id']) ? $data['live_stream_id'] : null; - $this->container['master'] = isset($data['master']) ? $data['master'] : null; - $this->container['master_access'] = isset($data['master_access']) ? $data['master_access'] : 'none'; - $this->container['mp4_support'] = isset($data['mp4_support']) ? $data['mp4_support'] : 'none'; - $this->container['source_asset_id'] = isset($data['source_asset_id']) ? $data['source_asset_id'] : null; - $this->container['normalize_audio'] = isset($data['normalize_audio']) ? $data['normalize_audio'] : false; - $this->container['static_renditions'] = isset($data['static_renditions']) ? $data['static_renditions'] : null; - $this->container['recording_times'] = isset($data['recording_times']) ? $data['recording_times'] : null; - $this->container['non_standard_input_reasons'] = isset($data['non_standard_input_reasons']) ? $data['non_standard_input_reasons'] : null; - $this->container['test'] = isset($data['test']) ? $data['test'] : 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->container['id'] = $data['id'] ?? null; + $this->container['created_at'] = $data['created_at'] ?? null; + $this->container['deleted_at'] = $data['deleted_at'] ?? null; + $this->container['status'] = $data['status'] ?? null; + $this->container['duration'] = $data['duration'] ?? null; + $this->container['max_stored_resolution'] = $data['max_stored_resolution'] ?? null; + $this->container['max_stored_frame_rate'] = $data['max_stored_frame_rate'] ?? null; + $this->container['aspect_ratio'] = $data['aspect_ratio'] ?? null; + $this->container['playback_ids'] = $data['playback_ids'] ?? null; + $this->container['tracks'] = $data['tracks'] ?? null; + $this->container['errors'] = $data['errors'] ?? null; + $this->container['per_title_encode'] = $data['per_title_encode'] ?? null; + $this->container['is_live'] = $data['is_live'] ?? null; + $this->container['passthrough'] = $data['passthrough'] ?? null; + $this->container['live_stream_id'] = $data['live_stream_id'] ?? null; + $this->container['master'] = $data['master'] ?? null; + $this->container['master_access'] = $data['master_access'] ?? self::MASTER_ACCESS_NONE; + $this->container['mp4_support'] = $data['mp4_support'] ?? self::MP4_SUPPORT_NONE; + $this->container['source_asset_id'] = $data['source_asset_id'] ?? null; + $this->container['normalize_audio'] = $data['normalize_audio'] ?? false; + $this->container['static_renditions'] = $data['static_renditions'] ?? null; + $this->container['recording_times'] = $data['recording_times'] ?? null; + $this->container['non_standard_input_reasons'] = $data['non_standard_input_reasons'] ?? null; + $this->container['test'] = $data['test'] ?? null; } /** @@ -374,7 +406,8 @@ public function listInvalidProperties() $allowedValues = $this->getStatusAllowableValues(); if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) { $invalidProperties[] = sprintf( - "invalid value for 'status', must be one of '%s'", + "invalid value '%s' for 'status', must be one of '%s'", + $this->container['status'], implode("', '", $allowedValues) ); } @@ -382,7 +415,8 @@ public function listInvalidProperties() $allowedValues = $this->getMaxStoredResolutionAllowableValues(); if (!is_null($this->container['max_stored_resolution']) && !in_array($this->container['max_stored_resolution'], $allowedValues, true)) { $invalidProperties[] = sprintf( - "invalid value for 'max_stored_resolution', must be one of '%s'", + "invalid value '%s' for 'max_stored_resolution', must be one of '%s'", + $this->container['max_stored_resolution'], implode("', '", $allowedValues) ); } @@ -390,7 +424,8 @@ public function listInvalidProperties() $allowedValues = $this->getMasterAccessAllowableValues(); if (!is_null($this->container['master_access']) && !in_array($this->container['master_access'], $allowedValues, true)) { $invalidProperties[] = sprintf( - "invalid value for 'master_access', must be one of '%s'", + "invalid value '%s' for 'master_access', must be one of '%s'", + $this->container['master_access'], implode("', '", $allowedValues) ); } @@ -398,7 +433,8 @@ public function listInvalidProperties() $allowedValues = $this->getMp4SupportAllowableValues(); if (!is_null($this->container['mp4_support']) && !in_array($this->container['mp4_support'], $allowedValues, true)) { $invalidProperties[] = sprintf( - "invalid value for 'mp4_support', must be one of '%s'", + "invalid value '%s' for 'mp4_support', must be one of '%s'", + $this->container['mp4_support'], implode("', '", $allowedValues) ); } @@ -433,7 +469,7 @@ public function getId() * * @param string|null $id Unique identifier for the Asset. * - * @return $this + * @return self */ public function setId($id) { @@ -457,7 +493,7 @@ public function getCreatedAt() * * @param string|null $created_at Time at which the object was created. Measured in seconds since the Unix epoch. * - * @return $this + * @return self */ public function setCreatedAt($created_at) { @@ -481,7 +517,7 @@ public function getDeletedAt() * * @param string|null $deleted_at deleted_at * - * @return $this + * @return self */ public function setDeletedAt($deleted_at) { @@ -505,7 +541,7 @@ public function getStatus() * * @param string|null $status The status of the asset. * - * @return $this + * @return self */ public function setStatus($status) { @@ -513,7 +549,8 @@ public function setStatus($status) if (!is_null($status) && !in_array($status, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( - "Invalid value for 'status', must be one of '%s'", + "Invalid value '%s' for 'status', must be one of '%s'", + $status, implode("', '", $allowedValues) ) ); @@ -538,7 +575,7 @@ public function getDuration() * * @param double|null $duration The duration of the asset in seconds (max duration for a single asset is 24 hours). * - * @return $this + * @return self */ public function setDuration($duration) { @@ -562,7 +599,7 @@ public function getMaxStoredResolution() * * @param string|null $max_stored_resolution The maximum resolution that has been stored for the asset. The asset may be delivered at lower resolutions depending on the device and bandwidth, however it cannot be delivered at a higher value than is stored. * - * @return $this + * @return self */ public function setMaxStoredResolution($max_stored_resolution) { @@ -570,7 +607,8 @@ public function setMaxStoredResolution($max_stored_resolution) if (!is_null($max_stored_resolution) && !in_array($max_stored_resolution, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( - "Invalid value for 'max_stored_resolution', must be one of '%s'", + "Invalid value '%s' for 'max_stored_resolution', must be one of '%s'", + $max_stored_resolution, implode("', '", $allowedValues) ) ); @@ -595,7 +633,7 @@ public function getMaxStoredFrameRate() * * @param double|null $max_stored_frame_rate The maximum frame rate that has been stored for the asset. The asset may be delivered at lower frame rates depending on the device and bandwidth, however it cannot be delivered at a higher value than is stored. This field may return -1 if the frame rate of the input cannot be reliably determined. * - * @return $this + * @return self */ public function setMaxStoredFrameRate($max_stored_frame_rate) { @@ -619,7 +657,7 @@ public function getAspectRatio() * * @param string|null $aspect_ratio The aspect ratio of the asset in the form of `width:height`, for example `16:9`. * - * @return $this + * @return self */ public function setAspectRatio($aspect_ratio) { @@ -643,7 +681,7 @@ public function getPlaybackIds() * * @param \MuxPhp\Models\PlaybackID[]|null $playback_ids playback_ids * - * @return $this + * @return self */ public function setPlaybackIds($playback_ids) { @@ -667,7 +705,7 @@ public function getTracks() * * @param \MuxPhp\Models\Track[]|null $tracks tracks * - * @return $this + * @return self */ public function setTracks($tracks) { @@ -691,7 +729,7 @@ public function getErrors() * * @param \MuxPhp\Models\AssetErrors|null $errors errors * - * @return $this + * @return self */ public function setErrors($errors) { @@ -715,7 +753,7 @@ public function getPerTitleEncode() * * @param bool|null $per_title_encode per_title_encode * - * @return $this + * @return self */ public function setPerTitleEncode($per_title_encode) { @@ -739,7 +777,7 @@ public function getIsLive() * * @param bool|null $is_live Whether the asset is created from a live stream and the live stream is currently `active` and not in `idle` state. * - * @return $this + * @return self */ public function setIsLive($is_live) { @@ -763,7 +801,7 @@ public function getPassthrough() * * @param string|null $passthrough Arbitrary metadata set for the asset. Max 255 characters. * - * @return $this + * @return self */ public function setPassthrough($passthrough) { @@ -787,7 +825,7 @@ public function getLiveStreamId() * * @param string|null $live_stream_id Unique identifier for the live stream. This is an optional parameter added when the asset is created from a live stream. * - * @return $this + * @return self */ public function setLiveStreamId($live_stream_id) { @@ -811,7 +849,7 @@ public function getMaster() * * @param \MuxPhp\Models\AssetMaster|null $master master * - * @return $this + * @return self */ public function setMaster($master) { @@ -835,7 +873,7 @@ public function getMasterAccess() * * @param string|null $master_access master_access * - * @return $this + * @return self */ public function setMasterAccess($master_access) { @@ -843,7 +881,8 @@ public function setMasterAccess($master_access) if (!is_null($master_access) && !in_array($master_access, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( - "Invalid value for 'master_access', must be one of '%s'", + "Invalid value '%s' for 'master_access', must be one of '%s'", + $master_access, implode("', '", $allowedValues) ) ); @@ -868,7 +907,7 @@ public function getMp4Support() * * @param string|null $mp4_support mp4_support * - * @return $this + * @return self */ public function setMp4Support($mp4_support) { @@ -876,7 +915,8 @@ public function setMp4Support($mp4_support) if (!is_null($mp4_support) && !in_array($mp4_support, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( - "Invalid value for 'mp4_support', must be one of '%s'", + "Invalid value '%s' for 'mp4_support', must be one of '%s'", + $mp4_support, implode("', '", $allowedValues) ) ); @@ -901,7 +941,7 @@ public function getSourceAssetId() * * @param string|null $source_asset_id Asset Identifier of the video used as the source for creating the clip. * - * @return $this + * @return self */ public function setSourceAssetId($source_asset_id) { @@ -925,7 +965,7 @@ public function getNormalizeAudio() * * @param bool|null $normalize_audio Normalize the audio track loudness level. This parameter is only applicable to on-demand (not live) assets. * - * @return $this + * @return self */ public function setNormalizeAudio($normalize_audio) { @@ -949,7 +989,7 @@ public function getStaticRenditions() * * @param \MuxPhp\Models\AssetStaticRenditions|null $static_renditions static_renditions * - * @return $this + * @return self */ public function setStaticRenditions($static_renditions) { @@ -973,7 +1013,7 @@ public function getRecordingTimes() * * @param \MuxPhp\Models\AssetRecordingTimes[]|null $recording_times An array of individual live stream recording sessions. A recording session is created on each encoder connection during the live stream * - * @return $this + * @return self */ public function setRecordingTimes($recording_times) { @@ -997,7 +1037,7 @@ public function getNonStandardInputReasons() * * @param \MuxPhp\Models\AssetNonStandardInputReasons|null $non_standard_input_reasons non_standard_input_reasons * - * @return $this + * @return self */ public function setNonStandardInputReasons($non_standard_input_reasons) { @@ -1021,7 +1061,7 @@ public function getTest() * * @param bool|null $test Indicates this asset is a test asset if the value is `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 assets are watermarked with the Mux logo, limited to 10 seconds, and deleted after 24 hrs. * - * @return $this + * @return self */ public function setTest($test) { @@ -1046,18 +1086,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -1082,6 +1122,18 @@ public function offsetUnset($offset) 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. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -1094,6 +1146,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/MuxPhp/Models/AssetErrors.php b/MuxPhp/Models/AssetErrors.php index a3fe76d..cd6d781 100644 --- a/MuxPhp/Models/AssetErrors.php +++ b/MuxPhp/Models/AssetErrors.php @@ -1,8 +1,30 @@ + * @template TKey int|null + * @template TValue mixed|null */ -class AssetErrors implements ModelInterface, ArrayAccess +class AssetErrors implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'Asset_errors'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'type' => 'string', 'messages' => 'string[]' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'type' => null, 'messages' => null @@ -158,8 +187,11 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['type'] = isset($data['type']) ? $data['type'] : null; - $this->container['messages'] = isset($data['messages']) ? $data['messages'] : 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->container['type'] = $data['type'] ?? null; + $this->container['messages'] = $data['messages'] ?? null; } /** @@ -201,7 +233,7 @@ public function getType() * * @param string|null $type The type of error that occurred for this asset. * - * @return $this + * @return self */ public function setType($type) { @@ -225,7 +257,7 @@ public function getMessages() * * @param string[]|null $messages Error messages with more details. * - * @return $this + * @return self */ public function setMessages($messages) { @@ -250,18 +282,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -286,6 +318,18 @@ public function offsetUnset($offset) 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. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -298,6 +342,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/MuxPhp/Models/AssetMaster.php b/MuxPhp/Models/AssetMaster.php index e03ca3c..b482322 100644 --- a/MuxPhp/Models/AssetMaster.php +++ b/MuxPhp/Models/AssetMaster.php @@ -1,8 +1,30 @@ + * @template TKey int|null + * @template TValue mixed|null */ -class AssetMaster implements ModelInterface, ArrayAccess +class AssetMaster implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'Asset_master'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'status' => 'string', 'url' => 'string' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'status' => null, 'url' => null @@ -140,9 +169,9 @@ public function getModelName() return self::$openAPIModelName; } - const STATUS_READY = 'ready'; - const STATUS_PREPARING = 'preparing'; - const STATUS_ERRORED = 'errored'; + public const STATUS_READY = 'ready'; + public const STATUS_PREPARING = 'preparing'; + public const STATUS_ERRORED = 'errored'; @@ -176,8 +205,11 @@ public function getStatusAllowableValues() */ public function __construct(array $data = null) { - $this->container['status'] = isset($data['status']) ? $data['status'] : null; - $this->container['url'] = isset($data['url']) ? $data['url'] : 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->container['status'] = $data['status'] ?? null; + $this->container['url'] = $data['url'] ?? null; } /** @@ -192,7 +224,8 @@ public function listInvalidProperties() $allowedValues = $this->getStatusAllowableValues(); if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) { $invalidProperties[] = sprintf( - "invalid value for 'status', must be one of '%s'", + "invalid value '%s' for 'status', must be one of '%s'", + $this->container['status'], implode("', '", $allowedValues) ); } @@ -227,7 +260,7 @@ public function getStatus() * * @param string|null $status status * - * @return $this + * @return self */ public function setStatus($status) { @@ -235,7 +268,8 @@ public function setStatus($status) if (!is_null($status) && !in_array($status, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( - "Invalid value for 'status', must be one of '%s'", + "Invalid value '%s' for 'status', must be one of '%s'", + $status, implode("', '", $allowedValues) ) ); @@ -260,7 +294,7 @@ public function getUrl() * * @param string|null $url url * - * @return $this + * @return self */ public function setUrl($url) { @@ -285,18 +319,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -321,6 +355,18 @@ public function offsetUnset($offset) 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. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -333,6 +379,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/MuxPhp/Models/AssetNonStandardInputReasons.php b/MuxPhp/Models/AssetNonStandardInputReasons.php index 703adf2..07dddf9 100644 --- a/MuxPhp/Models/AssetNonStandardInputReasons.php +++ b/MuxPhp/Models/AssetNonStandardInputReasons.php @@ -1,8 +1,30 @@ + * @template TKey int|null + * @template TValue mixed|null */ -class AssetNonStandardInputReasons implements ModelInterface, ArrayAccess +class AssetNonStandardInputReasons implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'Asset_non_standard_input_reasons'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'video_codec' => 'string', 'audio_codec' => 'string', @@ -45,10 +72,12 @@ class AssetNonStandardInputReasons implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'video_codec' => null, 'audio_codec' => null, @@ -174,10 +203,10 @@ public function getModelName() return self::$openAPIModelName; } - const VIDEO_GOP_SIZE_HIGH = 'high'; - const VIDEO_EDIT_LIST_NON_STANDARD = 'non-standard'; - const AUDIO_EDIT_LIST_NON_STANDARD = 'non-standard'; - const UNEXPECTED_MEDIA_FILE_PARAMETERS_NON_STANDARD = 'non-standard'; + public const VIDEO_GOP_SIZE_HIGH = 'high'; + public const VIDEO_EDIT_LIST_NON_STANDARD = 'non-standard'; + public const AUDIO_EDIT_LIST_NON_STANDARD = 'non-standard'; + public const UNEXPECTED_MEDIA_FILE_PARAMETERS_NON_STANDARD = 'non-standard'; @@ -245,15 +274,18 @@ public function getUnexpectedMediaFileParametersAllowableValues() */ public function __construct(array $data = null) { - $this->container['video_codec'] = isset($data['video_codec']) ? $data['video_codec'] : null; - $this->container['audio_codec'] = isset($data['audio_codec']) ? $data['audio_codec'] : null; - $this->container['video_gop_size'] = isset($data['video_gop_size']) ? $data['video_gop_size'] : null; - $this->container['video_frame_rate'] = isset($data['video_frame_rate']) ? $data['video_frame_rate'] : null; - $this->container['video_resolution'] = isset($data['video_resolution']) ? $data['video_resolution'] : null; - $this->container['pixel_aspect_ratio'] = isset($data['pixel_aspect_ratio']) ? $data['pixel_aspect_ratio'] : null; - $this->container['video_edit_list'] = isset($data['video_edit_list']) ? $data['video_edit_list'] : null; - $this->container['audio_edit_list'] = isset($data['audio_edit_list']) ? $data['audio_edit_list'] : null; - $this->container['unexpected_media_file_parameters'] = isset($data['unexpected_media_file_parameters']) ? $data['unexpected_media_file_parameters'] : 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->container['video_codec'] = $data['video_codec'] ?? null; + $this->container['audio_codec'] = $data['audio_codec'] ?? null; + $this->container['video_gop_size'] = $data['video_gop_size'] ?? null; + $this->container['video_frame_rate'] = $data['video_frame_rate'] ?? null; + $this->container['video_resolution'] = $data['video_resolution'] ?? null; + $this->container['pixel_aspect_ratio'] = $data['pixel_aspect_ratio'] ?? null; + $this->container['video_edit_list'] = $data['video_edit_list'] ?? null; + $this->container['audio_edit_list'] = $data['audio_edit_list'] ?? null; + $this->container['unexpected_media_file_parameters'] = $data['unexpected_media_file_parameters'] ?? null; } /** @@ -268,7 +300,8 @@ public function listInvalidProperties() $allowedValues = $this->getVideoGopSizeAllowableValues(); if (!is_null($this->container['video_gop_size']) && !in_array($this->container['video_gop_size'], $allowedValues, true)) { $invalidProperties[] = sprintf( - "invalid value for 'video_gop_size', must be one of '%s'", + "invalid value '%s' for 'video_gop_size', must be one of '%s'", + $this->container['video_gop_size'], implode("', '", $allowedValues) ); } @@ -276,7 +309,8 @@ public function listInvalidProperties() $allowedValues = $this->getVideoEditListAllowableValues(); if (!is_null($this->container['video_edit_list']) && !in_array($this->container['video_edit_list'], $allowedValues, true)) { $invalidProperties[] = sprintf( - "invalid value for 'video_edit_list', must be one of '%s'", + "invalid value '%s' for 'video_edit_list', must be one of '%s'", + $this->container['video_edit_list'], implode("', '", $allowedValues) ); } @@ -284,7 +318,8 @@ public function listInvalidProperties() $allowedValues = $this->getAudioEditListAllowableValues(); if (!is_null($this->container['audio_edit_list']) && !in_array($this->container['audio_edit_list'], $allowedValues, true)) { $invalidProperties[] = sprintf( - "invalid value for 'audio_edit_list', must be one of '%s'", + "invalid value '%s' for 'audio_edit_list', must be one of '%s'", + $this->container['audio_edit_list'], implode("', '", $allowedValues) ); } @@ -292,7 +327,8 @@ public function listInvalidProperties() $allowedValues = $this->getUnexpectedMediaFileParametersAllowableValues(); if (!is_null($this->container['unexpected_media_file_parameters']) && !in_array($this->container['unexpected_media_file_parameters'], $allowedValues, true)) { $invalidProperties[] = sprintf( - "invalid value for 'unexpected_media_file_parameters', must be one of '%s'", + "invalid value '%s' for 'unexpected_media_file_parameters', must be one of '%s'", + $this->container['unexpected_media_file_parameters'], implode("', '", $allowedValues) ); } @@ -327,7 +363,7 @@ public function getVideoCodec() * * @param string|null $video_codec The video codec used on the input file. * - * @return $this + * @return self */ public function setVideoCodec($video_codec) { @@ -351,7 +387,7 @@ public function getAudioCodec() * * @param string|null $audio_codec The audio codec used on the input file. * - * @return $this + * @return self */ public function setAudioCodec($audio_codec) { @@ -375,7 +411,7 @@ public function getVideoGopSize() * * @param string|null $video_gop_size The video key frame Interval (also called as Group of Picture or GOP) of the input file. * - * @return $this + * @return self */ public function setVideoGopSize($video_gop_size) { @@ -383,7 +419,8 @@ public function setVideoGopSize($video_gop_size) if (!is_null($video_gop_size) && !in_array($video_gop_size, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( - "Invalid value for 'video_gop_size', must be one of '%s'", + "Invalid value '%s' for 'video_gop_size', must be one of '%s'", + $video_gop_size, implode("', '", $allowedValues) ) ); @@ -408,7 +445,7 @@ public function getVideoFrameRate() * * @param string|null $video_frame_rate The video frame rate of the input file. * - * @return $this + * @return self */ public function setVideoFrameRate($video_frame_rate) { @@ -432,7 +469,7 @@ public function getVideoResolution() * * @param string|null $video_resolution The video resolution of the input file. * - * @return $this + * @return self */ public function setVideoResolution($video_resolution) { @@ -456,7 +493,7 @@ public function getPixelAspectRatio() * * @param string|null $pixel_aspect_ratio The video pixel aspect ratio of the input file. * - * @return $this + * @return self */ public function setPixelAspectRatio($pixel_aspect_ratio) { @@ -480,7 +517,7 @@ public function getVideoEditList() * * @param string|null $video_edit_list Video Edit List reason indicates that the input file's video track contains a complex Edit Decision List. * - * @return $this + * @return self */ public function setVideoEditList($video_edit_list) { @@ -488,7 +525,8 @@ public function setVideoEditList($video_edit_list) if (!is_null($video_edit_list) && !in_array($video_edit_list, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( - "Invalid value for 'video_edit_list', must be one of '%s'", + "Invalid value '%s' for 'video_edit_list', must be one of '%s'", + $video_edit_list, implode("', '", $allowedValues) ) ); @@ -513,7 +551,7 @@ public function getAudioEditList() * * @param string|null $audio_edit_list Audio Edit List reason indicates that the input file's audio track contains a complex Edit Decision List. * - * @return $this + * @return self */ public function setAudioEditList($audio_edit_list) { @@ -521,7 +559,8 @@ public function setAudioEditList($audio_edit_list) if (!is_null($audio_edit_list) && !in_array($audio_edit_list, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( - "Invalid value for 'audio_edit_list', must be one of '%s'", + "Invalid value '%s' for 'audio_edit_list', must be one of '%s'", + $audio_edit_list, implode("', '", $allowedValues) ) ); @@ -546,7 +585,7 @@ public function getUnexpectedMediaFileParameters() * * @param string|null $unexpected_media_file_parameters A catch-all reason when the input file in created with non-standard encoding parameters. * - * @return $this + * @return self */ public function setUnexpectedMediaFileParameters($unexpected_media_file_parameters) { @@ -554,7 +593,8 @@ public function setUnexpectedMediaFileParameters($unexpected_media_file_paramete if (!is_null($unexpected_media_file_parameters) && !in_array($unexpected_media_file_parameters, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( - "Invalid value for 'unexpected_media_file_parameters', must be one of '%s'", + "Invalid value '%s' for 'unexpected_media_file_parameters', must be one of '%s'", + $unexpected_media_file_parameters, implode("', '", $allowedValues) ) ); @@ -580,18 +620,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -616,6 +656,18 @@ public function offsetUnset($offset) 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. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -628,6 +680,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/MuxPhp/Models/AssetRecordingTimes.php b/MuxPhp/Models/AssetRecordingTimes.php index 824f69e..2a6e2b5 100644 --- a/MuxPhp/Models/AssetRecordingTimes.php +++ b/MuxPhp/Models/AssetRecordingTimes.php @@ -1,8 +1,30 @@ + * @template TKey int|null + * @template TValue mixed|null */ -class AssetRecordingTimes implements ModelInterface, ArrayAccess +class AssetRecordingTimes implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'Asset_recording_times'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'started_at' => '\DateTime', 'duration' => 'double' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'started_at' => 'date-time', 'duration' => 'double' @@ -158,8 +187,11 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['started_at'] = isset($data['started_at']) ? $data['started_at'] : null; - $this->container['duration'] = isset($data['duration']) ? $data['duration'] : 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->container['started_at'] = $data['started_at'] ?? null; + $this->container['duration'] = $data['duration'] ?? null; } /** @@ -201,7 +233,7 @@ public function getStartedAt() * * @param \DateTime|null $started_at The time at which the recording for the live stream started. The time value is Unix epoch time represented in ISO 8601 format. * - * @return $this + * @return self */ public function setStartedAt($started_at) { @@ -225,7 +257,7 @@ public function getDuration() * * @param double|null $duration The duration of the live stream recorded. The time value is in seconds. * - * @return $this + * @return self */ public function setDuration($duration) { @@ -250,18 +282,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -286,6 +318,18 @@ public function offsetUnset($offset) 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. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -298,6 +342,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/MuxPhp/Models/AssetResponse.php b/MuxPhp/Models/AssetResponse.php index 185f6d2..7205218 100644 --- a/MuxPhp/Models/AssetResponse.php +++ b/MuxPhp/Models/AssetResponse.php @@ -1,8 +1,30 @@ + * @template TKey int|null + * @template TValue mixed|null */ -class AssetResponse implements ModelInterface, ArrayAccess +class AssetResponse implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'AssetResponse'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'data' => '\MuxPhp\Models\Asset' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'data' => null ]; @@ -153,7 +182,10 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['data'] = isset($data['data']) ? $data['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->container['data'] = $data['data'] ?? null; } /** @@ -195,7 +227,7 @@ public function getData() * * @param \MuxPhp\Models\Asset|null $data data * - * @return $this + * @return self */ public function setData($data) { @@ -220,18 +252,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -256,6 +288,18 @@ public function offsetUnset($offset) 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. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -268,6 +312,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/MuxPhp/Models/AssetStaticRenditions.php b/MuxPhp/Models/AssetStaticRenditions.php index 5703001..b52f3d1 100644 --- a/MuxPhp/Models/AssetStaticRenditions.php +++ b/MuxPhp/Models/AssetStaticRenditions.php @@ -1,8 +1,30 @@ + * @template TKey int|null + * @template TValue mixed|null */ -class AssetStaticRenditions implements ModelInterface, ArrayAccess +class AssetStaticRenditions implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'Asset_static_renditions'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'status' => 'string', 'files' => '\MuxPhp\Models\AssetStaticRenditionsFiles[]' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'status' => null, 'files' => null @@ -139,10 +168,10 @@ public function getModelName() return self::$openAPIModelName; } - const STATUS_READY = 'ready'; - const STATUS_PREPARING = 'preparing'; - const STATUS_DISABLED = 'disabled'; - const STATUS_ERRORED = 'errored'; + public const STATUS_READY = 'ready'; + public const STATUS_PREPARING = 'preparing'; + public const STATUS_DISABLED = 'disabled'; + public const STATUS_ERRORED = 'errored'; @@ -177,8 +206,11 @@ public function getStatusAllowableValues() */ public function __construct(array $data = null) { - $this->container['status'] = isset($data['status']) ? $data['status'] : 'disabled'; - $this->container['files'] = isset($data['files']) ? $data['files'] : 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->container['status'] = $data['status'] ?? self::STATUS_DISABLED; + $this->container['files'] = $data['files'] ?? null; } /** @@ -193,7 +225,8 @@ public function listInvalidProperties() $allowedValues = $this->getStatusAllowableValues(); if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) { $invalidProperties[] = sprintf( - "invalid value for 'status', must be one of '%s'", + "invalid value '%s' for 'status', must be one of '%s'", + $this->container['status'], implode("', '", $allowedValues) ); } @@ -228,7 +261,7 @@ public function getStatus() * * @param string|null $status Indicates the status of downloadable MP4 versions of this asset. * - * @return $this + * @return self */ public function setStatus($status) { @@ -236,7 +269,8 @@ public function setStatus($status) if (!is_null($status) && !in_array($status, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( - "Invalid value for 'status', must be one of '%s'", + "Invalid value '%s' for 'status', must be one of '%s'", + $status, implode("', '", $allowedValues) ) ); @@ -261,7 +295,7 @@ public function getFiles() * * @param \MuxPhp\Models\AssetStaticRenditionsFiles[]|null $files files * - * @return $this + * @return self */ public function setFiles($files) { @@ -286,18 +320,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -322,6 +356,18 @@ public function offsetUnset($offset) 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. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -334,6 +380,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/MuxPhp/Models/AssetStaticRenditionsFiles.php b/MuxPhp/Models/AssetStaticRenditionsFiles.php index 8bbc540..bfa05a7 100644 --- a/MuxPhp/Models/AssetStaticRenditionsFiles.php +++ b/MuxPhp/Models/AssetStaticRenditionsFiles.php @@ -1,8 +1,30 @@ + * @template TKey int|null + * @template TValue mixed|null */ -class AssetStaticRenditionsFiles implements ModelInterface, ArrayAccess +class AssetStaticRenditionsFiles implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'Asset_static_renditions_files'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'name' => 'string', 'ext' => 'string', @@ -42,10 +69,12 @@ class AssetStaticRenditionsFiles implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var 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, @@ -159,12 +188,12 @@ public function getModelName() return self::$openAPIModelName; } - const NAME_LOWMP4 = 'low.mp4'; - const NAME_MEDIUMMP4 = 'medium.mp4'; - const NAME_HIGHMP4 = 'high.mp4'; - const NAME_AUDIOM4A = 'audio.m4a'; - const EXT_MP4 = 'mp4'; - const EXT_M4A = 'm4a'; + public const NAME_LOW_MP4 = 'low.mp4'; + public const NAME_MEDIUM_MP4 = 'medium.mp4'; + public const NAME_HIGH_MP4 = 'high.mp4'; + public const NAME_AUDIO_M4A = 'audio.m4a'; + public const EXT_MP4 = 'mp4'; + public const EXT_M4A = 'm4a'; @@ -176,10 +205,10 @@ public function getModelName() public function getNameAllowableValues() { return [ - self::NAME_LOWMP4, - self::NAME_MEDIUMMP4, - self::NAME_HIGHMP4, - self::NAME_AUDIOM4A, + self::NAME_LOW_MP4, + self::NAME_MEDIUM_MP4, + self::NAME_HIGH_MP4, + self::NAME_AUDIO_M4A, ]; } @@ -212,12 +241,15 @@ public function getExtAllowableValues() */ public function __construct(array $data = null) { - $this->container['name'] = isset($data['name']) ? $data['name'] : null; - $this->container['ext'] = isset($data['ext']) ? $data['ext'] : null; - $this->container['height'] = isset($data['height']) ? $data['height'] : null; - $this->container['width'] = isset($data['width']) ? $data['width'] : null; - $this->container['bitrate'] = isset($data['bitrate']) ? $data['bitrate'] : null; - $this->container['filesize'] = isset($data['filesize']) ? $data['filesize'] : 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->container['name'] = $data['name'] ?? null; + $this->container['ext'] = $data['ext'] ?? null; + $this->container['height'] = $data['height'] ?? null; + $this->container['width'] = $data['width'] ?? null; + $this->container['bitrate'] = $data['bitrate'] ?? null; + $this->container['filesize'] = $data['filesize'] ?? null; } /** @@ -232,7 +264,8 @@ public function listInvalidProperties() $allowedValues = $this->getNameAllowableValues(); if (!is_null($this->container['name']) && !in_array($this->container['name'], $allowedValues, true)) { $invalidProperties[] = sprintf( - "invalid value for 'name', must be one of '%s'", + "invalid value '%s' for 'name', must be one of '%s'", + $this->container['name'], implode("', '", $allowedValues) ); } @@ -240,7 +273,8 @@ public function listInvalidProperties() $allowedValues = $this->getExtAllowableValues(); if (!is_null($this->container['ext']) && !in_array($this->container['ext'], $allowedValues, true)) { $invalidProperties[] = sprintf( - "invalid value for 'ext', must be one of '%s'", + "invalid value '%s' for 'ext', must be one of '%s'", + $this->container['ext'], implode("', '", $allowedValues) ); } @@ -275,7 +309,7 @@ public function getName() * * @param string|null $name name * - * @return $this + * @return self */ public function setName($name) { @@ -283,7 +317,8 @@ public function setName($name) if (!is_null($name) && !in_array($name, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( - "Invalid value for 'name', must be one of '%s'", + "Invalid value '%s' for 'name', must be one of '%s'", + $name, implode("', '", $allowedValues) ) ); @@ -308,7 +343,7 @@ public function getExt() * * @param string|null $ext Extension of the static rendition file * - * @return $this + * @return self */ public function setExt($ext) { @@ -316,7 +351,8 @@ public function setExt($ext) if (!is_null($ext) && !in_array($ext, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( - "Invalid value for 'ext', must be one of '%s'", + "Invalid value '%s' for 'ext', must be one of '%s'", + $ext, implode("', '", $allowedValues) ) ); @@ -341,7 +377,7 @@ public function getHeight() * * @param int|null $height The height of the static rendition's file in pixels * - * @return $this + * @return self */ public function setHeight($height) { @@ -365,7 +401,7 @@ public function getWidth() * * @param int|null $width The width of the static rendition's file in pixels * - * @return $this + * @return self */ public function setWidth($width) { @@ -389,7 +425,7 @@ public function getBitrate() * * @param int|null $bitrate The bitrate in bits per second * - * @return $this + * @return self */ public function setBitrate($bitrate) { @@ -413,7 +449,7 @@ public function getFilesize() * * @param string|null $filesize filesize * - * @return $this + * @return self */ public function setFilesize($filesize) { @@ -438,18 +474,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -474,6 +510,18 @@ public function offsetUnset($offset) 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. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -486,6 +534,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/MuxPhp/Models/BreakdownValue.php b/MuxPhp/Models/BreakdownValue.php index e089772..3ef7542 100644 --- a/MuxPhp/Models/BreakdownValue.php +++ b/MuxPhp/Models/BreakdownValue.php @@ -1,8 +1,30 @@ + * @template TKey int|null + * @template TValue mixed|null */ -class BreakdownValue implements ModelInterface, ArrayAccess +class BreakdownValue implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'BreakdownValue'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'views' => 'int', 'value' => 'double', @@ -41,10 +68,12 @@ class BreakdownValue implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'views' => 'int64', 'value' => 'double', @@ -173,11 +202,14 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['views'] = isset($data['views']) ? $data['views'] : null; - $this->container['value'] = isset($data['value']) ? $data['value'] : null; - $this->container['total_watch_time'] = isset($data['total_watch_time']) ? $data['total_watch_time'] : null; - $this->container['negative_impact'] = isset($data['negative_impact']) ? $data['negative_impact'] : null; - $this->container['field'] = isset($data['field']) ? $data['field'] : 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->container['views'] = $data['views'] ?? null; + $this->container['value'] = $data['value'] ?? null; + $this->container['total_watch_time'] = $data['total_watch_time'] ?? null; + $this->container['negative_impact'] = $data['negative_impact'] ?? null; + $this->container['field'] = $data['field'] ?? null; } /** @@ -219,7 +251,7 @@ public function getViews() * * @param int|null $views views * - * @return $this + * @return self */ public function setViews($views) { @@ -243,7 +275,7 @@ public function getValue() * * @param double|null $value value * - * @return $this + * @return self */ public function setValue($value) { @@ -267,7 +299,7 @@ public function getTotalWatchTime() * * @param int|null $total_watch_time total_watch_time * - * @return $this + * @return self */ public function setTotalWatchTime($total_watch_time) { @@ -291,7 +323,7 @@ public function getNegativeImpact() * * @param int|null $negative_impact negative_impact * - * @return $this + * @return self */ public function setNegativeImpact($negative_impact) { @@ -315,7 +347,7 @@ public function getField() * * @param string|null $field field * - * @return $this + * @return self */ public function setField($field) { @@ -340,18 +372,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -376,6 +408,18 @@ public function offsetUnset($offset) 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. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -388,6 +432,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/MuxPhp/Models/CreateAssetRequest.php b/MuxPhp/Models/CreateAssetRequest.php index 7887b0c..ffcef28 100644 --- a/MuxPhp/Models/CreateAssetRequest.php +++ b/MuxPhp/Models/CreateAssetRequest.php @@ -1,8 +1,30 @@ + * @template TKey int|null + * @template TValue mixed|null */ -class CreateAssetRequest implements ModelInterface, ArrayAccess +class CreateAssetRequest implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'CreateAssetRequest'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'input' => '\MuxPhp\Models\InputSettings[]', 'playback_policy' => '\MuxPhp\Models\PlaybackPolicy[]', @@ -44,10 +71,12 @@ class CreateAssetRequest implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'input' => null, 'playback_policy' => null, @@ -169,10 +198,10 @@ public function getModelName() return self::$openAPIModelName; } - const MP4_SUPPORT_NONE = 'none'; - const MP4_SUPPORT_STANDARD = 'standard'; - const MASTER_ACCESS_NONE = 'none'; - const MASTER_ACCESS_TEMPORARY = 'temporary'; + public const MP4_SUPPORT_NONE = 'none'; + public const MP4_SUPPORT_STANDARD = 'standard'; + public const MASTER_ACCESS_NONE = 'none'; + public const MASTER_ACCESS_TEMPORARY = 'temporary'; @@ -218,14 +247,17 @@ public function getMasterAccessAllowableValues() */ public function __construct(array $data = null) { - $this->container['input'] = isset($data['input']) ? $data['input'] : null; - $this->container['playback_policy'] = isset($data['playback_policy']) ? $data['playback_policy'] : null; - $this->container['per_title_encode'] = isset($data['per_title_encode']) ? $data['per_title_encode'] : null; - $this->container['passthrough'] = isset($data['passthrough']) ? $data['passthrough'] : null; - $this->container['mp4_support'] = isset($data['mp4_support']) ? $data['mp4_support'] : null; - $this->container['normalize_audio'] = isset($data['normalize_audio']) ? $data['normalize_audio'] : false; - $this->container['master_access'] = isset($data['master_access']) ? $data['master_access'] : null; - $this->container['test'] = isset($data['test']) ? $data['test'] : 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->container['input'] = $data['input'] ?? null; + $this->container['playback_policy'] = $data['playback_policy'] ?? null; + $this->container['per_title_encode'] = $data['per_title_encode'] ?? null; + $this->container['passthrough'] = $data['passthrough'] ?? null; + $this->container['mp4_support'] = $data['mp4_support'] ?? null; + $this->container['normalize_audio'] = $data['normalize_audio'] ?? false; + $this->container['master_access'] = $data['master_access'] ?? null; + $this->container['test'] = $data['test'] ?? null; } /** @@ -240,7 +272,8 @@ public function listInvalidProperties() $allowedValues = $this->getMp4SupportAllowableValues(); if (!is_null($this->container['mp4_support']) && !in_array($this->container['mp4_support'], $allowedValues, true)) { $invalidProperties[] = sprintf( - "invalid value for 'mp4_support', must be one of '%s'", + "invalid value '%s' for 'mp4_support', must be one of '%s'", + $this->container['mp4_support'], implode("', '", $allowedValues) ); } @@ -248,7 +281,8 @@ public function listInvalidProperties() $allowedValues = $this->getMasterAccessAllowableValues(); if (!is_null($this->container['master_access']) && !in_array($this->container['master_access'], $allowedValues, true)) { $invalidProperties[] = sprintf( - "invalid value for 'master_access', must be one of '%s'", + "invalid value '%s' for 'master_access', must be one of '%s'", + $this->container['master_access'], implode("', '", $allowedValues) ); } @@ -283,7 +317,7 @@ public function getInput() * * @param \MuxPhp\Models\InputSettings[]|null $input An array of objects that each describe an input file to be used to create the asset. As a shortcut, input can also be a string URL for a file when only one input file is used. See `input[].url` for requirements. * - * @return $this + * @return self */ public function setInput($input) { @@ -307,7 +341,7 @@ public function getPlaybackPolicy() * * @param \MuxPhp\Models\PlaybackPolicy[]|null $playback_policy An array of playback policy names that you want applied to this asset and available through `playback_ids`. Options include: `\"public\"` (anyone with the playback URL can stream the asset). And `\"signed\"` (an additional access token is required to play the asset). If no playback_policy is set, the asset will have no playback IDs and will therefore not be playable. For simplicity, a single string name can be used in place of the array in the case of only one playback policy. * - * @return $this + * @return self */ public function setPlaybackPolicy($playback_policy) { @@ -331,7 +365,7 @@ public function getPerTitleEncode() * * @param bool|null $per_title_encode per_title_encode * - * @return $this + * @return self */ public function setPerTitleEncode($per_title_encode) { @@ -355,7 +389,7 @@ public function getPassthrough() * * @param string|null $passthrough Arbitrary 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**. * - * @return $this + * @return self */ public function setPassthrough($passthrough) { @@ -379,7 +413,7 @@ public function getMp4Support() * * @param string|null $mp4_support Specify what level (if any) of support for mp4 playback. 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 vidoes guide](/guides/video/download-your-videos) for more information. * - * @return $this + * @return self */ public function setMp4Support($mp4_support) { @@ -387,7 +421,8 @@ public function setMp4Support($mp4_support) if (!is_null($mp4_support) && !in_array($mp4_support, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( - "Invalid value for 'mp4_support', must be one of '%s'", + "Invalid value '%s' for 'mp4_support', must be one of '%s'", + $mp4_support, implode("', '", $allowedValues) ) ); @@ -412,7 +447,7 @@ public function getNormalizeAudio() * * @param bool|null $normalize_audio Normalize the audio track loudness level. This parameter is only applicable to on-demand (not live) assets. * - * @return $this + * @return self */ public function setNormalizeAudio($normalize_audio) { @@ -436,7 +471,7 @@ public function getMasterAccess() * * @param string|null $master_access 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 vidoes guide](/guides/video/download-your-videos) for more information. * - * @return $this + * @return self */ public function setMasterAccess($master_access) { @@ -444,7 +479,8 @@ public function setMasterAccess($master_access) if (!is_null($master_access) && !in_array($master_access, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( - "Invalid value for 'master_access', must be one of '%s'", + "Invalid value '%s' for 'master_access', must be one of '%s'", + $master_access, implode("', '", $allowedValues) ) ); @@ -469,7 +505,7 @@ public function getTest() * * @param bool|null $test 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. * - * @return $this + * @return self */ public function setTest($test) { @@ -494,18 +530,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -530,6 +566,18 @@ public function offsetUnset($offset) 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. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -542,6 +590,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/MuxPhp/Models/CreateLiveStreamRequest.php b/MuxPhp/Models/CreateLiveStreamRequest.php index 654f134..bc41e3b 100644 --- a/MuxPhp/Models/CreateLiveStreamRequest.php +++ b/MuxPhp/Models/CreateLiveStreamRequest.php @@ -1,8 +1,30 @@ + * @template TKey int|null + * @template TValue mixed|null */ -class CreateLiveStreamRequest implements ModelInterface, ArrayAccess +class CreateLiveStreamRequest implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'CreateLiveStreamRequest'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'playback_policy' => '\MuxPhp\Models\PlaybackPolicy[]', 'new_asset_settings' => '\MuxPhp\Models\CreateAssetRequest', @@ -43,10 +70,12 @@ class CreateLiveStreamRequest implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'playback_policy' => null, 'new_asset_settings' => null, @@ -183,13 +212,16 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['playback_policy'] = isset($data['playback_policy']) ? $data['playback_policy'] : null; - $this->container['new_asset_settings'] = isset($data['new_asset_settings']) ? $data['new_asset_settings'] : null; - $this->container['reconnect_window'] = isset($data['reconnect_window']) ? $data['reconnect_window'] : null; - $this->container['passthrough'] = isset($data['passthrough']) ? $data['passthrough'] : null; - $this->container['reduced_latency'] = isset($data['reduced_latency']) ? $data['reduced_latency'] : null; - $this->container['test'] = isset($data['test']) ? $data['test'] : null; - $this->container['simulcast_targets'] = isset($data['simulcast_targets']) ? $data['simulcast_targets'] : 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->container['playback_policy'] = $data['playback_policy'] ?? null; + $this->container['new_asset_settings'] = $data['new_asset_settings'] ?? null; + $this->container['reconnect_window'] = $data['reconnect_window'] ?? null; + $this->container['passthrough'] = $data['passthrough'] ?? null; + $this->container['reduced_latency'] = $data['reduced_latency'] ?? null; + $this->container['test'] = $data['test'] ?? null; + $this->container['simulcast_targets'] = $data['simulcast_targets'] ?? null; } /** @@ -239,7 +271,7 @@ public function getPlaybackPolicy() * * @param \MuxPhp\Models\PlaybackPolicy[]|null $playback_policy playback_policy * - * @return $this + * @return self */ public function setPlaybackPolicy($playback_policy) { @@ -263,7 +295,7 @@ public function getNewAssetSettings() * * @param \MuxPhp\Models\CreateAssetRequest|null $new_asset_settings new_asset_settings * - * @return $this + * @return self */ public function setNewAssetSettings($new_asset_settings) { @@ -287,7 +319,7 @@ public function getReconnectWindow() * * @param float|null $reconnect_window When live streaming software disconnects from Mux, either intentionally or due to a drop in the network, the Reconnect Window is the time in seconds that Mux should wait for the streaming software to reconnect before considering the live stream finished and completing the recorded asset. Defaults to 60 seconds on the API if not specified. * - * @return $this + * @return self */ public function setReconnectWindow($reconnect_window) { @@ -319,7 +351,7 @@ public function getPassthrough() * * @param string|null $passthrough passthrough * - * @return $this + * @return self */ public function setPassthrough($passthrough) { @@ -343,7 +375,7 @@ public function getReducedLatency() * * @param bool|null $reduced_latency Latency is the time from when the streamer does something in real life to when you see it happen in the player. Set this if you want lower latency for your live stream. Note: Reconnect windows are incompatible with Reduced Latency and will always be set to zero (0) seconds. Read more here: https://mux.com/blog/reduced-latency-for-mux-live-streaming-now-available/ * - * @return $this + * @return self */ public function setReducedLatency($reduced_latency) { @@ -367,7 +399,7 @@ public function getTest() * * @param bool|null $test test * - * @return $this + * @return self */ public function setTest($test) { @@ -391,7 +423,7 @@ public function getSimulcastTargets() * * @param \MuxPhp\Models\CreateSimulcastTargetRequest[]|null $simulcast_targets simulcast_targets * - * @return $this + * @return self */ public function setSimulcastTargets($simulcast_targets) { @@ -416,18 +448,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -452,6 +484,18 @@ public function offsetUnset($offset) 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. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -464,6 +508,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/MuxPhp/Models/CreatePlaybackIDRequest.php b/MuxPhp/Models/CreatePlaybackIDRequest.php index 8c70339..e0dfa39 100644 --- a/MuxPhp/Models/CreatePlaybackIDRequest.php +++ b/MuxPhp/Models/CreatePlaybackIDRequest.php @@ -1,8 +1,30 @@ + * @template TKey int|null + * @template TValue mixed|null */ -class CreatePlaybackIDRequest implements ModelInterface, ArrayAccess +class CreatePlaybackIDRequest implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'CreatePlaybackIDRequest'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'policy' => '\MuxPhp\Models\PlaybackPolicy' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'policy' => null ]; @@ -153,7 +182,10 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['policy'] = isset($data['policy']) ? $data['policy'] : 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->container['policy'] = $data['policy'] ?? null; } /** @@ -195,7 +227,7 @@ public function getPolicy() * * @param \MuxPhp\Models\PlaybackPolicy|null $policy policy * - * @return $this + * @return self */ public function setPolicy($policy) { @@ -220,18 +252,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -256,6 +288,18 @@ public function offsetUnset($offset) 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. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -268,6 +312,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/MuxPhp/Models/CreatePlaybackIDResponse.php b/MuxPhp/Models/CreatePlaybackIDResponse.php index ecce97b..530b956 100644 --- a/MuxPhp/Models/CreatePlaybackIDResponse.php +++ b/MuxPhp/Models/CreatePlaybackIDResponse.php @@ -1,8 +1,30 @@ + * @template TKey int|null + * @template TValue mixed|null */ -class CreatePlaybackIDResponse implements ModelInterface, ArrayAccess +class CreatePlaybackIDResponse implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'CreatePlaybackIDResponse'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'data' => '\MuxPhp\Models\PlaybackID' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'data' => null ]; @@ -153,7 +182,10 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['data'] = isset($data['data']) ? $data['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->container['data'] = $data['data'] ?? null; } /** @@ -195,7 +227,7 @@ public function getData() * * @param \MuxPhp\Models\PlaybackID|null $data data * - * @return $this + * @return self */ public function setData($data) { @@ -220,18 +252,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -256,6 +288,18 @@ public function offsetUnset($offset) 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. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -268,6 +312,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/MuxPhp/Models/CreateSimulcastTargetRequest.php b/MuxPhp/Models/CreateSimulcastTargetRequest.php index de0e07a..9438a1a 100644 --- a/MuxPhp/Models/CreateSimulcastTargetRequest.php +++ b/MuxPhp/Models/CreateSimulcastTargetRequest.php @@ -1,8 +1,30 @@ + * @template TKey int|null + * @template TValue mixed|null */ -class CreateSimulcastTargetRequest implements ModelInterface, ArrayAccess +class CreateSimulcastTargetRequest implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'CreateSimulcastTargetRequest'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'passthrough' => 'string', 'stream_key' => 'string', @@ -39,10 +66,12 @@ class CreateSimulcastTargetRequest implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'passthrough' => null, 'stream_key' => null, @@ -163,9 +192,12 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['passthrough'] = isset($data['passthrough']) ? $data['passthrough'] : null; - $this->container['stream_key'] = isset($data['stream_key']) ? $data['stream_key'] : null; - $this->container['url'] = isset($data['url']) ? $data['url'] : 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->container['passthrough'] = $data['passthrough'] ?? null; + $this->container['stream_key'] = $data['stream_key'] ?? null; + $this->container['url'] = $data['url'] ?? null; } /** @@ -210,7 +242,7 @@ public function getPassthrough() * * @param string|null $passthrough Arbitrary metadata set by you when creating a simulcast target. * - * @return $this + * @return self */ public function setPassthrough($passthrough) { @@ -234,7 +266,7 @@ public function getStreamKey() * * @param string|null $stream_key Stream Key represents a stream identifier on the third party live streaming service to send the parent live stream to. * - * @return $this + * @return self */ public function setStreamKey($stream_key) { @@ -258,7 +290,7 @@ public function getUrl() * * @param string $url RTMP hostname including application name for the third party live streaming service. Example: 'rtmp://live.example.com/app'. * - * @return $this + * @return self */ public function setUrl($url) { @@ -283,18 +315,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -319,6 +351,18 @@ public function offsetUnset($offset) 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. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -331,6 +375,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/MuxPhp/Models/CreateTrackRequest.php b/MuxPhp/Models/CreateTrackRequest.php index effbbe9..84e8bf3 100644 --- a/MuxPhp/Models/CreateTrackRequest.php +++ b/MuxPhp/Models/CreateTrackRequest.php @@ -1,8 +1,30 @@ + * @template TKey int|null + * @template TValue mixed|null */ -class CreateTrackRequest implements ModelInterface, ArrayAccess +class CreateTrackRequest implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'CreateTrackRequest'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'url' => 'string', 'type' => 'string', @@ -43,10 +70,12 @@ class CreateTrackRequest implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'url' => null, 'type' => null, @@ -164,8 +193,8 @@ public function getModelName() return self::$openAPIModelName; } - const TYPE_TEXT = 'text'; - const TEXT_TYPE_SUBTITLES = 'subtitles'; + public const TYPE_TEXT = 'text'; + public const TEXT_TYPE_SUBTITLES = 'subtitles'; @@ -209,13 +238,16 @@ public function getTextTypeAllowableValues() */ public function __construct(array $data = null) { - $this->container['url'] = isset($data['url']) ? $data['url'] : null; - $this->container['type'] = isset($data['type']) ? $data['type'] : null; - $this->container['text_type'] = isset($data['text_type']) ? $data['text_type'] : null; - $this->container['language_code'] = isset($data['language_code']) ? $data['language_code'] : null; - $this->container['name'] = isset($data['name']) ? $data['name'] : null; - $this->container['closed_captions'] = isset($data['closed_captions']) ? $data['closed_captions'] : null; - $this->container['passthrough'] = isset($data['passthrough']) ? $data['passthrough'] : 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->container['url'] = $data['url'] ?? null; + $this->container['type'] = $data['type'] ?? null; + $this->container['text_type'] = $data['text_type'] ?? null; + $this->container['language_code'] = $data['language_code'] ?? null; + $this->container['name'] = $data['name'] ?? null; + $this->container['closed_captions'] = $data['closed_captions'] ?? null; + $this->container['passthrough'] = $data['passthrough'] ?? null; } /** @@ -236,7 +268,8 @@ public function listInvalidProperties() $allowedValues = $this->getTypeAllowableValues(); if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { $invalidProperties[] = sprintf( - "invalid value for 'type', must be one of '%s'", + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], implode("', '", $allowedValues) ); } @@ -247,7 +280,8 @@ public function listInvalidProperties() $allowedValues = $this->getTextTypeAllowableValues(); if (!is_null($this->container['text_type']) && !in_array($this->container['text_type'], $allowedValues, true)) { $invalidProperties[] = sprintf( - "invalid value for 'text_type', must be one of '%s'", + "invalid value '%s' for 'text_type', must be one of '%s'", + $this->container['text_type'], implode("', '", $allowedValues) ); } @@ -285,7 +319,7 @@ public function getUrl() * * @param string $url url * - * @return $this + * @return self */ public function setUrl($url) { @@ -309,7 +343,7 @@ public function getType() * * @param string $type type * - * @return $this + * @return self */ public function setType($type) { @@ -317,7 +351,8 @@ public function setType($type) if (!in_array($type, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( - "Invalid value for 'type', must be one of '%s'", + "Invalid value '%s' for 'type', must be one of '%s'", + $type, implode("', '", $allowedValues) ) ); @@ -342,7 +377,7 @@ public function getTextType() * * @param string $text_type text_type * - * @return $this + * @return self */ public function setTextType($text_type) { @@ -350,7 +385,8 @@ public function setTextType($text_type) if (!in_array($text_type, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( - "Invalid value for 'text_type', must be one of '%s'", + "Invalid value '%s' for 'text_type', must be one of '%s'", + $text_type, implode("', '", $allowedValues) ) ); @@ -375,7 +411,7 @@ public function getLanguageCode() * * @param string $language_code The language code value must be a valid BCP 47 specification compliant value. For example, en for English or en-US for the US version of English. * - * @return $this + * @return self */ public function setLanguageCode($language_code) { @@ -399,7 +435,7 @@ public function getName() * * @param string|null $name The name of the track containing a human-readable description. This value must be unqiue across all the text type and subtitles text type tracks. HLS manifest will associate subtitle text track with this value. For example, set the value to \"English\" for subtitles text track with language_code as en-US. If this parameter is not included, Mux will auto-populate based on the language_code value. * - * @return $this + * @return self */ public function setName($name) { @@ -423,7 +459,7 @@ public function getClosedCaptions() * * @param bool|null $closed_captions Indicates the track provides Subtitles for the Deaf or Hard-of-hearing (SDH). * - * @return $this + * @return self */ public function setClosedCaptions($closed_captions) { @@ -447,7 +483,7 @@ public function getPassthrough() * * @param string|null $passthrough Arbitrary metadata set for the track either when creating the asset or track. * - * @return $this + * @return self */ public function setPassthrough($passthrough) { @@ -472,18 +508,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -508,6 +544,18 @@ public function offsetUnset($offset) 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. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -520,6 +568,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/MuxPhp/Models/CreateTrackResponse.php b/MuxPhp/Models/CreateTrackResponse.php index 3b5b4fd..3bd56e1 100644 --- a/MuxPhp/Models/CreateTrackResponse.php +++ b/MuxPhp/Models/CreateTrackResponse.php @@ -1,8 +1,30 @@ + * @template TKey int|null + * @template TValue mixed|null */ -class CreateTrackResponse implements ModelInterface, ArrayAccess +class CreateTrackResponse implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'CreateTrackResponse'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'data' => '\MuxPhp\Models\Track' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'data' => null ]; @@ -153,7 +182,10 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['data'] = isset($data['data']) ? $data['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->container['data'] = $data['data'] ?? null; } /** @@ -195,7 +227,7 @@ public function getData() * * @param \MuxPhp\Models\Track|null $data data * - * @return $this + * @return self */ public function setData($data) { @@ -220,18 +252,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -256,6 +288,18 @@ public function offsetUnset($offset) 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. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -268,6 +312,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/MuxPhp/Models/CreateUploadRequest.php b/MuxPhp/Models/CreateUploadRequest.php index 43601f7..74616cc 100644 --- a/MuxPhp/Models/CreateUploadRequest.php +++ b/MuxPhp/Models/CreateUploadRequest.php @@ -1,8 +1,30 @@ + * @template TKey int|null + * @template TValue mixed|null */ -class CreateUploadRequest implements ModelInterface, ArrayAccess +class CreateUploadRequest implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'CreateUploadRequest'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'timeout' => 'int', 'cors_origin' => 'string', @@ -40,10 +67,12 @@ class CreateUploadRequest implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'timeout' => 'int32', 'cors_origin' => null, @@ -168,10 +197,13 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['timeout'] = isset($data['timeout']) ? $data['timeout'] : 3600; - $this->container['cors_origin'] = isset($data['cors_origin']) ? $data['cors_origin'] : null; - $this->container['new_asset_settings'] = isset($data['new_asset_settings']) ? $data['new_asset_settings'] : null; - $this->container['test'] = isset($data['test']) ? $data['test'] : 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->container['timeout'] = $data['timeout'] ?? 3600; + $this->container['cors_origin'] = $data['cors_origin'] ?? null; + $this->container['new_asset_settings'] = $data['new_asset_settings'] ?? null; + $this->container['test'] = $data['test'] ?? null; } /** @@ -224,7 +256,7 @@ public function getTimeout() * * @param int|null $timeout Max time in seconds for the signed upload URL to be valid. If a successful upload has not occurred before the timeout limit, the direct upload is marked `timed_out` * - * @return $this + * @return self */ public function setTimeout($timeout) { @@ -256,7 +288,7 @@ public function getCorsOrigin() * * @param string|null $cors_origin If the upload URL will be used in a browser, you must specify the origin in order for the signed URL to have the correct CORS headers. * - * @return $this + * @return self */ public function setCorsOrigin($cors_origin) { @@ -280,7 +312,7 @@ public function getNewAssetSettings() * * @param \MuxPhp\Models\CreateAssetRequest $new_asset_settings new_asset_settings * - * @return $this + * @return self */ public function setNewAssetSettings($new_asset_settings) { @@ -304,7 +336,7 @@ public function getTest() * * @param bool|null $test test * - * @return $this + * @return self */ public function setTest($test) { @@ -329,18 +361,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -365,6 +397,18 @@ public function offsetUnset($offset) 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. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -377,6 +421,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/MuxPhp/Models/DeliveryReport.php b/MuxPhp/Models/DeliveryReport.php index a8ddc12..a6f911c 100644 --- a/MuxPhp/Models/DeliveryReport.php +++ b/MuxPhp/Models/DeliveryReport.php @@ -1,8 +1,30 @@ + * @template TKey int|null + * @template TValue mixed|null */ -class DeliveryReport implements ModelInterface, ArrayAccess +class DeliveryReport implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'DeliveryReport'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'live_stream_id' => 'string', 'asset_id' => 'string', @@ -43,10 +70,12 @@ class DeliveryReport implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'live_stream_id' => null, 'asset_id' => null, @@ -183,13 +212,16 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['live_stream_id'] = isset($data['live_stream_id']) ? $data['live_stream_id'] : null; - $this->container['asset_id'] = isset($data['asset_id']) ? $data['asset_id'] : null; - $this->container['passthrough'] = isset($data['passthrough']) ? $data['passthrough'] : null; - $this->container['created_at'] = isset($data['created_at']) ? $data['created_at'] : null; - $this->container['asset_state'] = isset($data['asset_state']) ? $data['asset_state'] : null; - $this->container['asset_duration'] = isset($data['asset_duration']) ? $data['asset_duration'] : null; - $this->container['delivered_seconds'] = isset($data['delivered_seconds']) ? $data['delivered_seconds'] : 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->container['live_stream_id'] = $data['live_stream_id'] ?? null; + $this->container['asset_id'] = $data['asset_id'] ?? null; + $this->container['passthrough'] = $data['passthrough'] ?? null; + $this->container['created_at'] = $data['created_at'] ?? null; + $this->container['asset_state'] = $data['asset_state'] ?? null; + $this->container['asset_duration'] = $data['asset_duration'] ?? null; + $this->container['delivered_seconds'] = $data['delivered_seconds'] ?? null; } /** @@ -231,7 +263,7 @@ public function getLiveStreamId() * * @param string|null $live_stream_id live_stream_id * - * @return $this + * @return self */ public function setLiveStreamId($live_stream_id) { @@ -255,7 +287,7 @@ public function getAssetId() * * @param string|null $asset_id asset_id * - * @return $this + * @return self */ public function setAssetId($asset_id) { @@ -279,7 +311,7 @@ public function getPassthrough() * * @param string|null $passthrough passthrough * - * @return $this + * @return self */ public function setPassthrough($passthrough) { @@ -303,7 +335,7 @@ public function getCreatedAt() * * @param string|null $created_at created_at * - * @return $this + * @return self */ public function setCreatedAt($created_at) { @@ -327,7 +359,7 @@ public function getAssetState() * * @param string|null $asset_state asset_state * - * @return $this + * @return self */ public function setAssetState($asset_state) { @@ -351,7 +383,7 @@ public function getAssetDuration() * * @param double|null $asset_duration asset_duration * - * @return $this + * @return self */ public function setAssetDuration($asset_duration) { @@ -375,7 +407,7 @@ public function getDeliveredSeconds() * * @param double|null $delivered_seconds delivered_seconds * - * @return $this + * @return self */ public function setDeliveredSeconds($delivered_seconds) { @@ -400,18 +432,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -436,6 +468,18 @@ public function offsetUnset($offset) 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. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -448,6 +492,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/MuxPhp/Models/DimensionValue.php b/MuxPhp/Models/DimensionValue.php index 21c649f..39139e1 100644 --- a/MuxPhp/Models/DimensionValue.php +++ b/MuxPhp/Models/DimensionValue.php @@ -1,8 +1,30 @@ + * @template TKey int|null + * @template TValue mixed|null */ -class DimensionValue implements ModelInterface, ArrayAccess +class DimensionValue implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'DimensionValue'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'value' => 'string', 'total_count' => 'int' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'value' => null, 'total_count' => 'int64' @@ -158,8 +187,11 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['value'] = isset($data['value']) ? $data['value'] : null; - $this->container['total_count'] = isset($data['total_count']) ? $data['total_count'] : 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->container['value'] = $data['value'] ?? null; + $this->container['total_count'] = $data['total_count'] ?? null; } /** @@ -201,7 +233,7 @@ public function getValue() * * @param string|null $value value * - * @return $this + * @return self */ public function setValue($value) { @@ -225,7 +257,7 @@ public function getTotalCount() * * @param int|null $total_count total_count * - * @return $this + * @return self */ public function setTotalCount($total_count) { @@ -250,18 +282,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -286,6 +318,18 @@ public function offsetUnset($offset) 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. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -298,6 +342,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/MuxPhp/Models/DisableLiveStreamResponse.php b/MuxPhp/Models/DisableLiveStreamResponse.php index 3e6dcc0..f6081e5 100644 --- a/MuxPhp/Models/DisableLiveStreamResponse.php +++ b/MuxPhp/Models/DisableLiveStreamResponse.php @@ -1,8 +1,30 @@ + * @template TKey int|null + * @template TValue mixed|null */ -class DisableLiveStreamResponse implements ModelInterface, ArrayAccess +class DisableLiveStreamResponse implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'DisableLiveStreamResponse'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'data' => 'object' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'data' => null ]; @@ -153,7 +182,10 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['data'] = isset($data['data']) ? $data['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->container['data'] = $data['data'] ?? null; } /** @@ -195,7 +227,7 @@ public function getData() * * @param object|null $data data * - * @return $this + * @return self */ public function setData($data) { @@ -220,18 +252,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -256,6 +288,18 @@ public function offsetUnset($offset) 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. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -268,6 +312,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/MuxPhp/Models/EnableLiveStreamResponse.php b/MuxPhp/Models/EnableLiveStreamResponse.php index 4a50a49..bb65af7 100644 --- a/MuxPhp/Models/EnableLiveStreamResponse.php +++ b/MuxPhp/Models/EnableLiveStreamResponse.php @@ -1,8 +1,30 @@ + * @template TKey int|null + * @template TValue mixed|null */ -class EnableLiveStreamResponse implements ModelInterface, ArrayAccess +class EnableLiveStreamResponse implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'EnableLiveStreamResponse'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'data' => 'object' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'data' => null ]; @@ -153,7 +182,10 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['data'] = isset($data['data']) ? $data['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->container['data'] = $data['data'] ?? null; } /** @@ -195,7 +227,7 @@ public function getData() * * @param object|null $data data * - * @return $this + * @return self */ public function setData($data) { @@ -220,18 +252,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -256,6 +288,18 @@ public function offsetUnset($offset) 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. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -268,6 +312,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/MuxPhp/Models/Error.php b/MuxPhp/Models/Error.php index 97a9d91..6c18021 100644 --- a/MuxPhp/Models/Error.php +++ b/MuxPhp/Models/Error.php @@ -1,8 +1,30 @@ + * @template TKey int|null + * @template TValue mixed|null */ -class Error implements ModelInterface, ArrayAccess +class Error implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'Error'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'id' => 'int', 'percentage' => 'double', @@ -44,10 +71,12 @@ class Error implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'id' => 'int64', 'percentage' => 'double', @@ -188,14 +217,17 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['id'] = isset($data['id']) ? $data['id'] : null; - $this->container['percentage'] = isset($data['percentage']) ? $data['percentage'] : null; - $this->container['notes'] = isset($data['notes']) ? $data['notes'] : null; - $this->container['message'] = isset($data['message']) ? $data['message'] : null; - $this->container['last_seen'] = isset($data['last_seen']) ? $data['last_seen'] : null; - $this->container['description'] = isset($data['description']) ? $data['description'] : null; - $this->container['count'] = isset($data['count']) ? $data['count'] : null; - $this->container['code'] = isset($data['code']) ? $data['code'] : 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->container['id'] = $data['id'] ?? null; + $this->container['percentage'] = $data['percentage'] ?? null; + $this->container['notes'] = $data['notes'] ?? null; + $this->container['message'] = $data['message'] ?? null; + $this->container['last_seen'] = $data['last_seen'] ?? null; + $this->container['description'] = $data['description'] ?? null; + $this->container['count'] = $data['count'] ?? null; + $this->container['code'] = $data['code'] ?? null; } /** @@ -237,7 +269,7 @@ public function getId() * * @param int|null $id id * - * @return $this + * @return self */ public function setId($id) { @@ -261,7 +293,7 @@ public function getPercentage() * * @param double|null $percentage percentage * - * @return $this + * @return self */ public function setPercentage($percentage) { @@ -285,7 +317,7 @@ public function getNotes() * * @param string|null $notes notes * - * @return $this + * @return self */ public function setNotes($notes) { @@ -309,7 +341,7 @@ public function getMessage() * * @param string|null $message message * - * @return $this + * @return self */ public function setMessage($message) { @@ -333,7 +365,7 @@ public function getLastSeen() * * @param string|null $last_seen last_seen * - * @return $this + * @return self */ public function setLastSeen($last_seen) { @@ -357,7 +389,7 @@ public function getDescription() * * @param string|null $description description * - * @return $this + * @return self */ public function setDescription($description) { @@ -381,7 +413,7 @@ public function getCount() * * @param int|null $count count * - * @return $this + * @return self */ public function setCount($count) { @@ -405,7 +437,7 @@ public function getCode() * * @param int|null $code code * - * @return $this + * @return self */ public function setCode($code) { @@ -430,18 +462,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -466,6 +498,18 @@ public function offsetUnset($offset) 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. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -478,6 +522,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/MuxPhp/Models/FilterValue.php b/MuxPhp/Models/FilterValue.php index cfed331..060773a 100644 --- a/MuxPhp/Models/FilterValue.php +++ b/MuxPhp/Models/FilterValue.php @@ -1,8 +1,30 @@ + * @template TKey int|null + * @template TValue mixed|null */ -class FilterValue implements ModelInterface, ArrayAccess +class FilterValue implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'FilterValue'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'value' => 'string', 'total_count' => 'int' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'value' => null, 'total_count' => 'int64' @@ -158,8 +187,11 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['value'] = isset($data['value']) ? $data['value'] : null; - $this->container['total_count'] = isset($data['total_count']) ? $data['total_count'] : 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->container['value'] = $data['value'] ?? null; + $this->container['total_count'] = $data['total_count'] ?? null; } /** @@ -201,7 +233,7 @@ public function getValue() * * @param string|null $value value * - * @return $this + * @return self */ public function setValue($value) { @@ -225,7 +257,7 @@ public function getTotalCount() * * @param int|null $total_count total_count * - * @return $this + * @return self */ public function setTotalCount($total_count) { @@ -250,18 +282,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -286,6 +318,18 @@ public function offsetUnset($offset) 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. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -298,6 +342,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/MuxPhp/Models/GetAssetInputInfoResponse.php b/MuxPhp/Models/GetAssetInputInfoResponse.php index c1cddf8..0fa19d2 100644 --- a/MuxPhp/Models/GetAssetInputInfoResponse.php +++ b/MuxPhp/Models/GetAssetInputInfoResponse.php @@ -1,8 +1,30 @@ + * @template TKey int|null + * @template TValue mixed|null */ -class GetAssetInputInfoResponse implements ModelInterface, ArrayAccess +class GetAssetInputInfoResponse implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'GetAssetInputInfoResponse'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'data' => '\MuxPhp\Models\InputInfo[]' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'data' => null ]; @@ -153,7 +182,10 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['data'] = isset($data['data']) ? $data['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->container['data'] = $data['data'] ?? null; } /** @@ -195,7 +227,7 @@ public function getData() * * @param \MuxPhp\Models\InputInfo[]|null $data data * - * @return $this + * @return self */ public function setData($data) { @@ -220,18 +252,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -256,6 +288,18 @@ public function offsetUnset($offset) 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. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -268,6 +312,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/MuxPhp/Models/GetAssetOrLiveStreamIdResponse.php b/MuxPhp/Models/GetAssetOrLiveStreamIdResponse.php index 4294e2d..69b8c2a 100644 --- a/MuxPhp/Models/GetAssetOrLiveStreamIdResponse.php +++ b/MuxPhp/Models/GetAssetOrLiveStreamIdResponse.php @@ -1,8 +1,30 @@ + * @template TKey int|null + * @template TValue mixed|null */ -class GetAssetOrLiveStreamIdResponse implements ModelInterface, ArrayAccess +class GetAssetOrLiveStreamIdResponse implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'GetAssetOrLiveStreamIdResponse'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'data' => '\MuxPhp\Models\GetAssetOrLiveStreamIdResponseData' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'data' => null ]; @@ -153,7 +182,10 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['data'] = isset($data['data']) ? $data['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->container['data'] = $data['data'] ?? null; } /** @@ -195,7 +227,7 @@ public function getData() * * @param \MuxPhp\Models\GetAssetOrLiveStreamIdResponseData|null $data data * - * @return $this + * @return self */ public function setData($data) { @@ -220,18 +252,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -256,6 +288,18 @@ public function offsetUnset($offset) 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. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -268,6 +312,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/MuxPhp/Models/GetAssetOrLiveStreamIdResponseData.php b/MuxPhp/Models/GetAssetOrLiveStreamIdResponseData.php index 0c773c5..920aa14 100644 --- a/MuxPhp/Models/GetAssetOrLiveStreamIdResponseData.php +++ b/MuxPhp/Models/GetAssetOrLiveStreamIdResponseData.php @@ -1,8 +1,30 @@ + * @template TKey int|null + * @template TValue mixed|null */ -class GetAssetOrLiveStreamIdResponseData implements ModelInterface, ArrayAccess +class GetAssetOrLiveStreamIdResponseData implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'GetAssetOrLiveStreamIdResponse_data'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'id' => 'string', 'policy' => '\MuxPhp\Models\PlaybackPolicy', @@ -39,10 +66,12 @@ class GetAssetOrLiveStreamIdResponseData implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'id' => null, 'policy' => null, @@ -163,9 +192,12 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['id'] = isset($data['id']) ? $data['id'] : null; - $this->container['policy'] = isset($data['policy']) ? $data['policy'] : null; - $this->container['object'] = isset($data['object']) ? $data['object'] : 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->container['id'] = $data['id'] ?? null; + $this->container['policy'] = $data['policy'] ?? null; + $this->container['object'] = $data['object'] ?? null; } /** @@ -207,7 +239,7 @@ public function getId() * * @param string|null $id The Playback ID used to retrieve the corresponding asset or the live stream ID * - * @return $this + * @return self */ public function setId($id) { @@ -231,7 +263,7 @@ public function getPolicy() * * @param \MuxPhp\Models\PlaybackPolicy|null $policy policy * - * @return $this + * @return self */ public function setPolicy($policy) { @@ -255,7 +287,7 @@ public function getObject() * * @param \MuxPhp\Models\GetAssetOrLiveStreamIdResponseDataObject|null $object object * - * @return $this + * @return self */ public function setObject($object) { @@ -280,18 +312,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -316,6 +348,18 @@ public function offsetUnset($offset) 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. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -328,6 +372,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/MuxPhp/Models/GetAssetOrLiveStreamIdResponseDataObject.php b/MuxPhp/Models/GetAssetOrLiveStreamIdResponseDataObject.php index b02ed6e..3392fce 100644 --- a/MuxPhp/Models/GetAssetOrLiveStreamIdResponseDataObject.php +++ b/MuxPhp/Models/GetAssetOrLiveStreamIdResponseDataObject.php @@ -1,8 +1,30 @@ + * @template TKey int|null + * @template TValue mixed|null */ -class GetAssetOrLiveStreamIdResponseDataObject implements ModelInterface, ArrayAccess +class GetAssetOrLiveStreamIdResponseDataObject implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'GetAssetOrLiveStreamIdResponse_data_object'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'id' => 'string', 'type' => 'string' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'id' => null, 'type' => null @@ -140,8 +169,8 @@ public function getModelName() return self::$openAPIModelName; } - const TYPE_ASSET = 'asset'; - const TYPE_LIVE_STREAM = 'live_stream'; + public const TYPE_ASSET = 'asset'; + public const TYPE_LIVE_STREAM = 'live_stream'; @@ -174,8 +203,11 @@ public function getTypeAllowableValues() */ public function __construct(array $data = null) { - $this->container['id'] = isset($data['id']) ? $data['id'] : null; - $this->container['type'] = isset($data['type']) ? $data['type'] : 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->container['id'] = $data['id'] ?? null; + $this->container['type'] = $data['type'] ?? null; } /** @@ -190,7 +222,8 @@ public function listInvalidProperties() $allowedValues = $this->getTypeAllowableValues(); if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { $invalidProperties[] = sprintf( - "invalid value for 'type', must be one of '%s'", + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], implode("', '", $allowedValues) ); } @@ -225,7 +258,7 @@ public function getId() * * @param string|null $id The identifier of the object. * - * @return $this + * @return self */ public function setId($id) { @@ -249,7 +282,7 @@ public function getType() * * @param string|null $type Identifies the object type associated with the playback ID. * - * @return $this + * @return self */ public function setType($type) { @@ -257,7 +290,8 @@ public function setType($type) if (!is_null($type) && !in_array($type, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( - "Invalid value for 'type', must be one of '%s'", + "Invalid value '%s' for 'type', must be one of '%s'", + $type, implode("', '", $allowedValues) ) ); @@ -283,18 +317,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -319,6 +353,18 @@ public function offsetUnset($offset) 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. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -331,6 +377,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/MuxPhp/Models/GetAssetPlaybackIDResponse.php b/MuxPhp/Models/GetAssetPlaybackIDResponse.php index 9cf6a8b..487fec7 100644 --- a/MuxPhp/Models/GetAssetPlaybackIDResponse.php +++ b/MuxPhp/Models/GetAssetPlaybackIDResponse.php @@ -1,8 +1,30 @@ + * @template TKey int|null + * @template TValue mixed|null */ -class GetAssetPlaybackIDResponse implements ModelInterface, ArrayAccess +class GetAssetPlaybackIDResponse implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'GetAssetPlaybackIDResponse'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'data' => '\MuxPhp\Models\PlaybackID' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'data' => null ]; @@ -153,7 +182,10 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['data'] = isset($data['data']) ? $data['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->container['data'] = $data['data'] ?? null; } /** @@ -195,7 +227,7 @@ public function getData() * * @param \MuxPhp\Models\PlaybackID|null $data data * - * @return $this + * @return self */ public function setData($data) { @@ -220,18 +252,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -256,6 +288,18 @@ public function offsetUnset($offset) 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. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -268,6 +312,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/MuxPhp/Models/GetMetricTimeseriesDataResponse.php b/MuxPhp/Models/GetMetricTimeseriesDataResponse.php index 3d8a6af..2457c92 100644 --- a/MuxPhp/Models/GetMetricTimeseriesDataResponse.php +++ b/MuxPhp/Models/GetMetricTimeseriesDataResponse.php @@ -1,8 +1,30 @@ + * @template TKey int|null + * @template TValue mixed|null */ -class GetMetricTimeseriesDataResponse implements ModelInterface, ArrayAccess +class GetMetricTimeseriesDataResponse implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'GetMetricTimeseriesDataResponse'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'data' => 'string[][]', 'total_row_count' => 'int', @@ -39,10 +66,12 @@ class GetMetricTimeseriesDataResponse implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'data' => null, 'total_row_count' => 'int64', @@ -163,9 +192,12 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['data'] = isset($data['data']) ? $data['data'] : null; - $this->container['total_row_count'] = isset($data['total_row_count']) ? $data['total_row_count'] : null; - $this->container['timeframe'] = isset($data['timeframe']) ? $data['timeframe'] : 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->container['data'] = $data['data'] ?? null; + $this->container['total_row_count'] = $data['total_row_count'] ?? null; + $this->container['timeframe'] = $data['timeframe'] ?? null; } /** @@ -207,7 +239,7 @@ public function getData() * * @param string[][]|null $data data * - * @return $this + * @return self */ public function setData($data) { @@ -231,7 +263,7 @@ public function getTotalRowCount() * * @param int|null $total_row_count total_row_count * - * @return $this + * @return self */ public function setTotalRowCount($total_row_count) { @@ -255,7 +287,7 @@ public function getTimeframe() * * @param int[]|null $timeframe timeframe * - * @return $this + * @return self */ public function setTimeframe($timeframe) { @@ -280,18 +312,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -316,6 +348,18 @@ public function offsetUnset($offset) 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. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -328,6 +372,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/MuxPhp/Models/GetOverallValuesResponse.php b/MuxPhp/Models/GetOverallValuesResponse.php index 61cdf4e..7b22c0f 100644 --- a/MuxPhp/Models/GetOverallValuesResponse.php +++ b/MuxPhp/Models/GetOverallValuesResponse.php @@ -1,8 +1,30 @@ + * @template TKey int|null + * @template TValue mixed|null */ -class GetOverallValuesResponse implements ModelInterface, ArrayAccess +class GetOverallValuesResponse implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'GetOverallValuesResponse'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'data' => '\MuxPhp\Models\OverallValues', 'total_row_count' => 'int', @@ -39,10 +66,12 @@ class GetOverallValuesResponse implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'data' => null, 'total_row_count' => 'int64', @@ -163,9 +192,12 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['data'] = isset($data['data']) ? $data['data'] : null; - $this->container['total_row_count'] = isset($data['total_row_count']) ? $data['total_row_count'] : null; - $this->container['timeframe'] = isset($data['timeframe']) ? $data['timeframe'] : 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->container['data'] = $data['data'] ?? null; + $this->container['total_row_count'] = $data['total_row_count'] ?? null; + $this->container['timeframe'] = $data['timeframe'] ?? null; } /** @@ -207,7 +239,7 @@ public function getData() * * @param \MuxPhp\Models\OverallValues|null $data data * - * @return $this + * @return self */ public function setData($data) { @@ -231,7 +263,7 @@ public function getTotalRowCount() * * @param int|null $total_row_count total_row_count * - * @return $this + * @return self */ public function setTotalRowCount($total_row_count) { @@ -255,7 +287,7 @@ public function getTimeframe() * * @param int[]|null $timeframe timeframe * - * @return $this + * @return self */ public function setTimeframe($timeframe) { @@ -280,18 +312,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -316,6 +348,18 @@ public function offsetUnset($offset) 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. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -328,6 +372,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/MuxPhp/Models/GetRealTimeBreakdownResponse.php b/MuxPhp/Models/GetRealTimeBreakdownResponse.php index b18d0ac..cbb483f 100644 --- a/MuxPhp/Models/GetRealTimeBreakdownResponse.php +++ b/MuxPhp/Models/GetRealTimeBreakdownResponse.php @@ -1,8 +1,30 @@ + * @template TKey int|null + * @template TValue mixed|null */ -class GetRealTimeBreakdownResponse implements ModelInterface, ArrayAccess +class GetRealTimeBreakdownResponse implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'GetRealTimeBreakdownResponse'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'data' => '\MuxPhp\Models\RealTimeBreakdownValue[]', 'total_row_count' => 'int', @@ -39,10 +66,12 @@ class GetRealTimeBreakdownResponse implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'data' => null, 'total_row_count' => 'int64', @@ -163,9 +192,12 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['data'] = isset($data['data']) ? $data['data'] : null; - $this->container['total_row_count'] = isset($data['total_row_count']) ? $data['total_row_count'] : null; - $this->container['timeframe'] = isset($data['timeframe']) ? $data['timeframe'] : 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->container['data'] = $data['data'] ?? null; + $this->container['total_row_count'] = $data['total_row_count'] ?? null; + $this->container['timeframe'] = $data['timeframe'] ?? null; } /** @@ -207,7 +239,7 @@ public function getData() * * @param \MuxPhp\Models\RealTimeBreakdownValue[]|null $data data * - * @return $this + * @return self */ public function setData($data) { @@ -231,7 +263,7 @@ public function getTotalRowCount() * * @param int|null $total_row_count total_row_count * - * @return $this + * @return self */ public function setTotalRowCount($total_row_count) { @@ -255,7 +287,7 @@ public function getTimeframe() * * @param int[]|null $timeframe timeframe * - * @return $this + * @return self */ public function setTimeframe($timeframe) { @@ -280,18 +312,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -316,6 +348,18 @@ public function offsetUnset($offset) 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. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -328,6 +372,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/MuxPhp/Models/GetRealTimeHistogramTimeseriesResponse.php b/MuxPhp/Models/GetRealTimeHistogramTimeseriesResponse.php index 433d8b0..cd30bcb 100644 --- a/MuxPhp/Models/GetRealTimeHistogramTimeseriesResponse.php +++ b/MuxPhp/Models/GetRealTimeHistogramTimeseriesResponse.php @@ -1,8 +1,30 @@ + * @template TKey int|null + * @template TValue mixed|null */ -class GetRealTimeHistogramTimeseriesResponse implements ModelInterface, ArrayAccess +class GetRealTimeHistogramTimeseriesResponse implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'GetRealTimeHistogramTimeseriesResponse'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'meta' => '\MuxPhp\Models\GetRealTimeHistogramTimeseriesResponseMeta', 'data' => '\MuxPhp\Models\RealTimeHistogramTimeseriesDatapoint[]', @@ -40,10 +67,12 @@ class GetRealTimeHistogramTimeseriesResponse implements ModelInterface, ArrayAcc ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'meta' => null, 'data' => null, @@ -168,10 +197,13 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['meta'] = isset($data['meta']) ? $data['meta'] : null; - $this->container['data'] = isset($data['data']) ? $data['data'] : null; - $this->container['total_row_count'] = isset($data['total_row_count']) ? $data['total_row_count'] : null; - $this->container['timeframe'] = isset($data['timeframe']) ? $data['timeframe'] : 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->container['meta'] = $data['meta'] ?? null; + $this->container['data'] = $data['data'] ?? null; + $this->container['total_row_count'] = $data['total_row_count'] ?? null; + $this->container['timeframe'] = $data['timeframe'] ?? null; } /** @@ -213,7 +245,7 @@ public function getMeta() * * @param \MuxPhp\Models\GetRealTimeHistogramTimeseriesResponseMeta|null $meta meta * - * @return $this + * @return self */ public function setMeta($meta) { @@ -237,7 +269,7 @@ public function getData() * * @param \MuxPhp\Models\RealTimeHistogramTimeseriesDatapoint[]|null $data data * - * @return $this + * @return self */ public function setData($data) { @@ -261,7 +293,7 @@ public function getTotalRowCount() * * @param int|null $total_row_count total_row_count * - * @return $this + * @return self */ public function setTotalRowCount($total_row_count) { @@ -285,7 +317,7 @@ public function getTimeframe() * * @param int[]|null $timeframe timeframe * - * @return $this + * @return self */ public function setTimeframe($timeframe) { @@ -310,18 +342,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -346,6 +378,18 @@ public function offsetUnset($offset) 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. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -358,6 +402,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/MuxPhp/Models/GetRealTimeHistogramTimeseriesResponseMeta.php b/MuxPhp/Models/GetRealTimeHistogramTimeseriesResponseMeta.php index a097773..3cbd621 100644 --- a/MuxPhp/Models/GetRealTimeHistogramTimeseriesResponseMeta.php +++ b/MuxPhp/Models/GetRealTimeHistogramTimeseriesResponseMeta.php @@ -1,8 +1,30 @@ + * @template TKey int|null + * @template TValue mixed|null */ -class GetRealTimeHistogramTimeseriesResponseMeta implements ModelInterface, ArrayAccess +class GetRealTimeHistogramTimeseriesResponseMeta implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'GetRealTimeHistogramTimeseriesResponse_meta'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'buckets' => '\MuxPhp\Models\RealTimeHistogramTimeseriesBucket[]' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'buckets' => null ]; @@ -153,7 +182,10 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['buckets'] = isset($data['buckets']) ? $data['buckets'] : 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->container['buckets'] = $data['buckets'] ?? null; } /** @@ -195,7 +227,7 @@ public function getBuckets() * * @param \MuxPhp\Models\RealTimeHistogramTimeseriesBucket[]|null $buckets buckets * - * @return $this + * @return self */ public function setBuckets($buckets) { @@ -220,18 +252,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -256,6 +288,18 @@ public function offsetUnset($offset) 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. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -268,6 +312,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/MuxPhp/Models/GetRealTimeTimeseriesResponse.php b/MuxPhp/Models/GetRealTimeTimeseriesResponse.php index 415c826..dd24a09 100644 --- a/MuxPhp/Models/GetRealTimeTimeseriesResponse.php +++ b/MuxPhp/Models/GetRealTimeTimeseriesResponse.php @@ -1,8 +1,30 @@ + * @template TKey int|null + * @template TValue mixed|null */ -class GetRealTimeTimeseriesResponse implements ModelInterface, ArrayAccess +class GetRealTimeTimeseriesResponse implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'GetRealTimeTimeseriesResponse'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'data' => '\MuxPhp\Models\RealTimeTimeseriesDatapoint[]', 'total_row_count' => 'int', @@ -39,10 +66,12 @@ class GetRealTimeTimeseriesResponse implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'data' => null, 'total_row_count' => 'int64', @@ -163,9 +192,12 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['data'] = isset($data['data']) ? $data['data'] : null; - $this->container['total_row_count'] = isset($data['total_row_count']) ? $data['total_row_count'] : null; - $this->container['timeframe'] = isset($data['timeframe']) ? $data['timeframe'] : 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->container['data'] = $data['data'] ?? null; + $this->container['total_row_count'] = $data['total_row_count'] ?? null; + $this->container['timeframe'] = $data['timeframe'] ?? null; } /** @@ -207,7 +239,7 @@ public function getData() * * @param \MuxPhp\Models\RealTimeTimeseriesDatapoint[]|null $data data * - * @return $this + * @return self */ public function setData($data) { @@ -231,7 +263,7 @@ public function getTotalRowCount() * * @param int|null $total_row_count total_row_count * - * @return $this + * @return self */ public function setTotalRowCount($total_row_count) { @@ -255,7 +287,7 @@ public function getTimeframe() * * @param int[]|null $timeframe timeframe * - * @return $this + * @return self */ public function setTimeframe($timeframe) { @@ -280,18 +312,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -316,6 +348,18 @@ public function offsetUnset($offset) 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. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -328,6 +372,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/MuxPhp/Models/Incident.php b/MuxPhp/Models/Incident.php index 252f66f..c91f8e2 100644 --- a/MuxPhp/Models/Incident.php +++ b/MuxPhp/Models/Incident.php @@ -1,8 +1,30 @@ + * @template TKey int|null + * @template TValue mixed|null */ -class Incident implements ModelInterface, ArrayAccess +class Incident implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'Incident'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'threshold' => 'double', 'status' => 'string', @@ -57,10 +84,12 @@ class Incident implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'threshold' => 'double', 'status' => null, @@ -253,27 +282,30 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['threshold'] = isset($data['threshold']) ? $data['threshold'] : null; - $this->container['status'] = isset($data['status']) ? $data['status'] : null; - $this->container['started_at'] = isset($data['started_at']) ? $data['started_at'] : null; - $this->container['severity'] = isset($data['severity']) ? $data['severity'] : null; - $this->container['sample_size_unit'] = isset($data['sample_size_unit']) ? $data['sample_size_unit'] : null; - $this->container['sample_size'] = isset($data['sample_size']) ? $data['sample_size'] : null; - $this->container['resolved_at'] = isset($data['resolved_at']) ? $data['resolved_at'] : null; - $this->container['notifications'] = isset($data['notifications']) ? $data['notifications'] : null; - $this->container['notification_rules'] = isset($data['notification_rules']) ? $data['notification_rules'] : null; - $this->container['measurement'] = isset($data['measurement']) ? $data['measurement'] : null; - $this->container['measured_value_on_close'] = isset($data['measured_value_on_close']) ? $data['measured_value_on_close'] : null; - $this->container['measured_value'] = isset($data['measured_value']) ? $data['measured_value'] : null; - $this->container['incident_key'] = isset($data['incident_key']) ? $data['incident_key'] : null; - $this->container['impact'] = isset($data['impact']) ? $data['impact'] : null; - $this->container['id'] = isset($data['id']) ? $data['id'] : null; - $this->container['error_description'] = isset($data['error_description']) ? $data['error_description'] : null; - $this->container['description'] = isset($data['description']) ? $data['description'] : null; - $this->container['breakdowns'] = isset($data['breakdowns']) ? $data['breakdowns'] : null; - $this->container['affected_views_per_hour_on_open'] = isset($data['affected_views_per_hour_on_open']) ? $data['affected_views_per_hour_on_open'] : null; - $this->container['affected_views_per_hour'] = isset($data['affected_views_per_hour']) ? $data['affected_views_per_hour'] : null; - $this->container['affected_views'] = isset($data['affected_views']) ? $data['affected_views'] : 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->container['threshold'] = $data['threshold'] ?? null; + $this->container['status'] = $data['status'] ?? null; + $this->container['started_at'] = $data['started_at'] ?? null; + $this->container['severity'] = $data['severity'] ?? null; + $this->container['sample_size_unit'] = $data['sample_size_unit'] ?? null; + $this->container['sample_size'] = $data['sample_size'] ?? null; + $this->container['resolved_at'] = $data['resolved_at'] ?? null; + $this->container['notifications'] = $data['notifications'] ?? null; + $this->container['notification_rules'] = $data['notification_rules'] ?? null; + $this->container['measurement'] = $data['measurement'] ?? null; + $this->container['measured_value_on_close'] = $data['measured_value_on_close'] ?? null; + $this->container['measured_value'] = $data['measured_value'] ?? null; + $this->container['incident_key'] = $data['incident_key'] ?? null; + $this->container['impact'] = $data['impact'] ?? null; + $this->container['id'] = $data['id'] ?? null; + $this->container['error_description'] = $data['error_description'] ?? null; + $this->container['description'] = $data['description'] ?? null; + $this->container['breakdowns'] = $data['breakdowns'] ?? null; + $this->container['affected_views_per_hour_on_open'] = $data['affected_views_per_hour_on_open'] ?? null; + $this->container['affected_views_per_hour'] = $data['affected_views_per_hour'] ?? null; + $this->container['affected_views'] = $data['affected_views'] ?? null; } /** @@ -315,7 +347,7 @@ public function getThreshold() * * @param double|null $threshold threshold * - * @return $this + * @return self */ public function setThreshold($threshold) { @@ -339,7 +371,7 @@ public function getStatus() * * @param string|null $status status * - * @return $this + * @return self */ public function setStatus($status) { @@ -363,7 +395,7 @@ public function getStartedAt() * * @param string|null $started_at started_at * - * @return $this + * @return self */ public function setStartedAt($started_at) { @@ -387,7 +419,7 @@ public function getSeverity() * * @param string|null $severity severity * - * @return $this + * @return self */ public function setSeverity($severity) { @@ -411,7 +443,7 @@ public function getSampleSizeUnit() * * @param string|null $sample_size_unit sample_size_unit * - * @return $this + * @return self */ public function setSampleSizeUnit($sample_size_unit) { @@ -435,7 +467,7 @@ public function getSampleSize() * * @param int|null $sample_size sample_size * - * @return $this + * @return self */ public function setSampleSize($sample_size) { @@ -459,7 +491,7 @@ public function getResolvedAt() * * @param string|null $resolved_at resolved_at * - * @return $this + * @return self */ public function setResolvedAt($resolved_at) { @@ -483,7 +515,7 @@ public function getNotifications() * * @param \MuxPhp\Models\IncidentNotification[]|null $notifications notifications * - * @return $this + * @return self */ public function setNotifications($notifications) { @@ -507,7 +539,7 @@ public function getNotificationRules() * * @param \MuxPhp\Models\IncidentNotificationRule[]|null $notification_rules notification_rules * - * @return $this + * @return self */ public function setNotificationRules($notification_rules) { @@ -531,7 +563,7 @@ public function getMeasurement() * * @param string|null $measurement measurement * - * @return $this + * @return self */ public function setMeasurement($measurement) { @@ -555,7 +587,7 @@ public function getMeasuredValueOnClose() * * @param double|null $measured_value_on_close measured_value_on_close * - * @return $this + * @return self */ public function setMeasuredValueOnClose($measured_value_on_close) { @@ -579,7 +611,7 @@ public function getMeasuredValue() * * @param double|null $measured_value measured_value * - * @return $this + * @return self */ public function setMeasuredValue($measured_value) { @@ -603,7 +635,7 @@ public function getIncidentKey() * * @param string|null $incident_key incident_key * - * @return $this + * @return self */ public function setIncidentKey($incident_key) { @@ -627,7 +659,7 @@ public function getImpact() * * @param string|null $impact impact * - * @return $this + * @return self */ public function setImpact($impact) { @@ -651,7 +683,7 @@ public function getId() * * @param string|null $id id * - * @return $this + * @return self */ public function setId($id) { @@ -675,7 +707,7 @@ public function getErrorDescription() * * @param string|null $error_description error_description * - * @return $this + * @return self */ public function setErrorDescription($error_description) { @@ -699,7 +731,7 @@ public function getDescription() * * @param string|null $description description * - * @return $this + * @return self */ public function setDescription($description) { @@ -723,7 +755,7 @@ public function getBreakdowns() * * @param \MuxPhp\Models\IncidentBreakdown[]|null $breakdowns breakdowns * - * @return $this + * @return self */ public function setBreakdowns($breakdowns) { @@ -747,7 +779,7 @@ public function getAffectedViewsPerHourOnOpen() * * @param int|null $affected_views_per_hour_on_open affected_views_per_hour_on_open * - * @return $this + * @return self */ public function setAffectedViewsPerHourOnOpen($affected_views_per_hour_on_open) { @@ -771,7 +803,7 @@ public function getAffectedViewsPerHour() * * @param int|null $affected_views_per_hour affected_views_per_hour * - * @return $this + * @return self */ public function setAffectedViewsPerHour($affected_views_per_hour) { @@ -795,7 +827,7 @@ public function getAffectedViews() * * @param int|null $affected_views affected_views * - * @return $this + * @return self */ public function setAffectedViews($affected_views) { @@ -820,18 +852,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -856,6 +888,18 @@ public function offsetUnset($offset) 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. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -868,6 +912,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/MuxPhp/Models/IncidentBreakdown.php b/MuxPhp/Models/IncidentBreakdown.php index 45b7889..f77de18 100644 --- a/MuxPhp/Models/IncidentBreakdown.php +++ b/MuxPhp/Models/IncidentBreakdown.php @@ -1,8 +1,30 @@ + * @template TKey int|null + * @template TValue mixed|null */ -class IncidentBreakdown implements ModelInterface, ArrayAccess +class IncidentBreakdown implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'IncidentBreakdown'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'value' => 'string', 'name' => 'string', @@ -39,10 +66,12 @@ class IncidentBreakdown implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'value' => null, 'name' => null, @@ -163,9 +192,12 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['value'] = isset($data['value']) ? $data['value'] : null; - $this->container['name'] = isset($data['name']) ? $data['name'] : null; - $this->container['id'] = isset($data['id']) ? $data['id'] : 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->container['value'] = $data['value'] ?? null; + $this->container['name'] = $data['name'] ?? null; + $this->container['id'] = $data['id'] ?? null; } /** @@ -207,7 +239,7 @@ public function getValue() * * @param string|null $value value * - * @return $this + * @return self */ public function setValue($value) { @@ -231,7 +263,7 @@ public function getName() * * @param string|null $name name * - * @return $this + * @return self */ public function setName($name) { @@ -255,7 +287,7 @@ public function getId() * * @param string|null $id id * - * @return $this + * @return self */ public function setId($id) { @@ -280,18 +312,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -316,6 +348,18 @@ public function offsetUnset($offset) 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. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -328,6 +372,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/MuxPhp/Models/IncidentNotification.php b/MuxPhp/Models/IncidentNotification.php index 81079fb..5626483 100644 --- a/MuxPhp/Models/IncidentNotification.php +++ b/MuxPhp/Models/IncidentNotification.php @@ -1,8 +1,30 @@ + * @template TKey int|null + * @template TValue mixed|null */ -class IncidentNotification implements ModelInterface, ArrayAccess +class IncidentNotification implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'IncidentNotification'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'queued_at' => 'string', 'id' => 'int', @@ -39,10 +66,12 @@ class IncidentNotification implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'queued_at' => null, 'id' => 'int64', @@ -163,9 +192,12 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['queued_at'] = isset($data['queued_at']) ? $data['queued_at'] : null; - $this->container['id'] = isset($data['id']) ? $data['id'] : null; - $this->container['attempted_at'] = isset($data['attempted_at']) ? $data['attempted_at'] : 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->container['queued_at'] = $data['queued_at'] ?? null; + $this->container['id'] = $data['id'] ?? null; + $this->container['attempted_at'] = $data['attempted_at'] ?? null; } /** @@ -207,7 +239,7 @@ public function getQueuedAt() * * @param string|null $queued_at queued_at * - * @return $this + * @return self */ public function setQueuedAt($queued_at) { @@ -231,7 +263,7 @@ public function getId() * * @param int|null $id id * - * @return $this + * @return self */ public function setId($id) { @@ -255,7 +287,7 @@ public function getAttemptedAt() * * @param string|null $attempted_at attempted_at * - * @return $this + * @return self */ public function setAttemptedAt($attempted_at) { @@ -280,18 +312,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -316,6 +348,18 @@ public function offsetUnset($offset) 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. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -328,6 +372,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/MuxPhp/Models/IncidentNotificationRule.php b/MuxPhp/Models/IncidentNotificationRule.php index dcbc88a..1e88e94 100644 --- a/MuxPhp/Models/IncidentNotificationRule.php +++ b/MuxPhp/Models/IncidentNotificationRule.php @@ -1,8 +1,30 @@ + * @template TKey int|null + * @template TValue mixed|null */ -class IncidentNotificationRule implements ModelInterface, ArrayAccess +class IncidentNotificationRule implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'IncidentNotificationRule'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'status' => 'string', 'rules' => '\MuxPhp\Models\NotificationRule[]', @@ -41,10 +68,12 @@ class IncidentNotificationRule implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'status' => null, 'rules' => null, @@ -173,11 +202,14 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['status'] = isset($data['status']) ? $data['status'] : null; - $this->container['rules'] = isset($data['rules']) ? $data['rules'] : null; - $this->container['property_id'] = isset($data['property_id']) ? $data['property_id'] : null; - $this->container['id'] = isset($data['id']) ? $data['id'] : null; - $this->container['action'] = isset($data['action']) ? $data['action'] : 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->container['status'] = $data['status'] ?? null; + $this->container['rules'] = $data['rules'] ?? null; + $this->container['property_id'] = $data['property_id'] ?? null; + $this->container['id'] = $data['id'] ?? null; + $this->container['action'] = $data['action'] ?? null; } /** @@ -219,7 +251,7 @@ public function getStatus() * * @param string|null $status status * - * @return $this + * @return self */ public function setStatus($status) { @@ -243,7 +275,7 @@ public function getRules() * * @param \MuxPhp\Models\NotificationRule[]|null $rules rules * - * @return $this + * @return self */ public function setRules($rules) { @@ -267,7 +299,7 @@ public function getPropertyId() * * @param string|null $property_id property_id * - * @return $this + * @return self */ public function setPropertyId($property_id) { @@ -291,7 +323,7 @@ public function getId() * * @param string|null $id id * - * @return $this + * @return self */ public function setId($id) { @@ -315,7 +347,7 @@ public function getAction() * * @param string|null $action action * - * @return $this + * @return self */ public function setAction($action) { @@ -340,18 +372,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -376,6 +408,18 @@ public function offsetUnset($offset) 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. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -388,6 +432,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/MuxPhp/Models/IncidentResponse.php b/MuxPhp/Models/IncidentResponse.php index 9370a03..f1de21e 100644 --- a/MuxPhp/Models/IncidentResponse.php +++ b/MuxPhp/Models/IncidentResponse.php @@ -1,8 +1,30 @@ + * @template TKey int|null + * @template TValue mixed|null */ -class IncidentResponse implements ModelInterface, ArrayAccess +class IncidentResponse implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'IncidentResponse'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'data' => '\MuxPhp\Models\Incident', 'timeframe' => 'int[]' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'data' => null, 'timeframe' => 'int64' @@ -158,8 +187,11 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['data'] = isset($data['data']) ? $data['data'] : null; - $this->container['timeframe'] = isset($data['timeframe']) ? $data['timeframe'] : 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->container['data'] = $data['data'] ?? null; + $this->container['timeframe'] = $data['timeframe'] ?? null; } /** @@ -201,7 +233,7 @@ public function getData() * * @param \MuxPhp\Models\Incident|null $data data * - * @return $this + * @return self */ public function setData($data) { @@ -225,7 +257,7 @@ public function getTimeframe() * * @param int[]|null $timeframe timeframe * - * @return $this + * @return self */ public function setTimeframe($timeframe) { @@ -250,18 +282,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -286,6 +318,18 @@ public function offsetUnset($offset) 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. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -298,6 +342,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/MuxPhp/Models/InputFile.php b/MuxPhp/Models/InputFile.php index 441b9fd..77808e7 100644 --- a/MuxPhp/Models/InputFile.php +++ b/MuxPhp/Models/InputFile.php @@ -1,8 +1,30 @@ + * @template TKey int|null + * @template TValue mixed|null */ -class InputFile implements ModelInterface, ArrayAccess +class InputFile implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'InputFile'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'container_format' => 'string', 'tracks' => '\MuxPhp\Models\InputTrack[]' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'container_format' => null, 'tracks' => null @@ -158,8 +187,11 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['container_format'] = isset($data['container_format']) ? $data['container_format'] : null; - $this->container['tracks'] = isset($data['tracks']) ? $data['tracks'] : 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->container['container_format'] = $data['container_format'] ?? null; + $this->container['tracks'] = $data['tracks'] ?? null; } /** @@ -201,7 +233,7 @@ public function getContainerFormat() * * @param string|null $container_format container_format * - * @return $this + * @return self */ public function setContainerFormat($container_format) { @@ -225,7 +257,7 @@ public function getTracks() * * @param \MuxPhp\Models\InputTrack[]|null $tracks tracks * - * @return $this + * @return self */ public function setTracks($tracks) { @@ -250,18 +282,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -286,6 +318,18 @@ public function offsetUnset($offset) 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. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -298,6 +342,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/MuxPhp/Models/InputInfo.php b/MuxPhp/Models/InputInfo.php index 2af199f..936b85d 100644 --- a/MuxPhp/Models/InputInfo.php +++ b/MuxPhp/Models/InputInfo.php @@ -1,8 +1,30 @@ + * @template TKey int|null + * @template TValue mixed|null */ -class InputInfo implements ModelInterface, ArrayAccess +class InputInfo implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'InputInfo'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'settings' => '\MuxPhp\Models\InputSettings', 'file' => '\MuxPhp\Models\InputFile' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'settings' => null, 'file' => null @@ -158,8 +187,11 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['settings'] = isset($data['settings']) ? $data['settings'] : null; - $this->container['file'] = isset($data['file']) ? $data['file'] : 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->container['settings'] = $data['settings'] ?? null; + $this->container['file'] = $data['file'] ?? null; } /** @@ -201,7 +233,7 @@ public function getSettings() * * @param \MuxPhp\Models\InputSettings|null $settings settings * - * @return $this + * @return self */ public function setSettings($settings) { @@ -225,7 +257,7 @@ public function getFile() * * @param \MuxPhp\Models\InputFile|null $file file * - * @return $this + * @return self */ public function setFile($file) { @@ -250,18 +282,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -286,6 +318,18 @@ public function offsetUnset($offset) 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. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -298,6 +342,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/MuxPhp/Models/InputSettings.php b/MuxPhp/Models/InputSettings.php index e657aff..842d4a7 100644 --- a/MuxPhp/Models/InputSettings.php +++ b/MuxPhp/Models/InputSettings.php @@ -1,8 +1,30 @@ + * @template TKey int|null + * @template TValue mixed|null */ -class InputSettings implements ModelInterface, ArrayAccess +class InputSettings implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'InputSettings'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'url' => 'string', 'overlay_settings' => '\MuxPhp\Models\InputSettingsOverlaySettings', @@ -47,10 +74,12 @@ class InputSettings implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'url' => null, 'overlay_settings' => null, @@ -180,10 +209,10 @@ public function getModelName() return self::$openAPIModelName; } - const TYPE_VIDEO = 'video'; - const TYPE_AUDIO = 'audio'; - const TYPE_TEXT = 'text'; - const TEXT_TYPE_SUBTITLES = 'subtitles'; + public const TYPE_VIDEO = 'video'; + public const TYPE_AUDIO = 'audio'; + public const TYPE_TEXT = 'text'; + public const TEXT_TYPE_SUBTITLES = 'subtitles'; @@ -229,16 +258,19 @@ public function getTextTypeAllowableValues() */ public function __construct(array $data = null) { - $this->container['url'] = isset($data['url']) ? $data['url'] : null; - $this->container['overlay_settings'] = isset($data['overlay_settings']) ? $data['overlay_settings'] : null; - $this->container['start_time'] = isset($data['start_time']) ? $data['start_time'] : null; - $this->container['end_time'] = isset($data['end_time']) ? $data['end_time'] : null; - $this->container['type'] = isset($data['type']) ? $data['type'] : null; - $this->container['text_type'] = isset($data['text_type']) ? $data['text_type'] : null; - $this->container['language_code'] = isset($data['language_code']) ? $data['language_code'] : null; - $this->container['name'] = isset($data['name']) ? $data['name'] : null; - $this->container['closed_captions'] = isset($data['closed_captions']) ? $data['closed_captions'] : null; - $this->container['passthrough'] = isset($data['passthrough']) ? $data['passthrough'] : 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->container['url'] = $data['url'] ?? null; + $this->container['overlay_settings'] = $data['overlay_settings'] ?? null; + $this->container['start_time'] = $data['start_time'] ?? null; + $this->container['end_time'] = $data['end_time'] ?? null; + $this->container['type'] = $data['type'] ?? null; + $this->container['text_type'] = $data['text_type'] ?? null; + $this->container['language_code'] = $data['language_code'] ?? null; + $this->container['name'] = $data['name'] ?? null; + $this->container['closed_captions'] = $data['closed_captions'] ?? null; + $this->container['passthrough'] = $data['passthrough'] ?? null; } /** @@ -253,7 +285,8 @@ public function listInvalidProperties() $allowedValues = $this->getTypeAllowableValues(); if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { $invalidProperties[] = sprintf( - "invalid value for 'type', must be one of '%s'", + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], implode("', '", $allowedValues) ); } @@ -261,7 +294,8 @@ public function listInvalidProperties() $allowedValues = $this->getTextTypeAllowableValues(); if (!is_null($this->container['text_type']) && !in_array($this->container['text_type'], $allowedValues, true)) { $invalidProperties[] = sprintf( - "invalid value for 'text_type', must be one of '%s'", + "invalid value '%s' for 'text_type', must be one of '%s'", + $this->container['text_type'], implode("', '", $allowedValues) ); } @@ -296,7 +330,7 @@ public function getUrl() * * @param string|null $url The web address of the file that Mux should download and use. * For subtitles text tracks, the url is the location of subtitle/captions file. Mux supports [SubRip Text (SRT)](https://en.wikipedia.org/wiki/SubRip) and [Web Video Text Tracks](https://www.w3.org/TR/webvtt1/) format for ingesting Subtitles and Closed Captions. * For Watermarking or Overlay, the url is the location of the watermark image. * When creating clips from existing Mux assets, the url is defined with `mux://assets/{asset_id}` template where `asset_id` is the Asset Identifier for creating the clip from. * - * @return $this + * @return self */ public function setUrl($url) { @@ -320,7 +354,7 @@ public function getOverlaySettings() * * @param \MuxPhp\Models\InputSettingsOverlaySettings|null $overlay_settings overlay_settings * - * @return $this + * @return self */ public function setOverlaySettings($overlay_settings) { @@ -344,7 +378,7 @@ public function getStartTime() * * @param double|null $start_time The time offset in seconds from the beginning of the video indicating the clip's starting marker. The default value is 0 when not included. * - * @return $this + * @return self */ public function setStartTime($start_time) { @@ -368,7 +402,7 @@ public function getEndTime() * * @param double|null $end_time The time offset in seconds from the beginning of the video, indicating the clip's ending marker. The default value is the duration of the video when not included. * - * @return $this + * @return self */ public function setEndTime($end_time) { @@ -392,7 +426,7 @@ public function getType() * * @param string|null $type This parameter is required for the `text` track type. * - * @return $this + * @return self */ public function setType($type) { @@ -400,7 +434,8 @@ public function setType($type) if (!is_null($type) && !in_array($type, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( - "Invalid value for 'type', must be one of '%s'", + "Invalid value '%s' for 'type', must be one of '%s'", + $type, implode("', '", $allowedValues) ) ); @@ -425,7 +460,7 @@ public function getTextType() * * @param string|null $text_type Type of text track. This parameter only supports subtitles value. For more information on Subtitles / Closed Captions, [see this blog post](https://mux.com/blog/subtitles-captions-webvtt-hls-and-those-magic-flags/). This parameter is required for `text` track type. * - * @return $this + * @return self */ public function setTextType($text_type) { @@ -433,7 +468,8 @@ public function setTextType($text_type) if (!is_null($text_type) && !in_array($text_type, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( - "Invalid value for 'text_type', must be one of '%s'", + "Invalid value '%s' for 'text_type', must be one of '%s'", + $text_type, implode("', '", $allowedValues) ) ); @@ -458,7 +494,7 @@ public function getLanguageCode() * * @param string|null $language_code 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 type and subtitles text type track. * - * @return $this + * @return self */ public function setLanguageCode($language_code) { @@ -482,7 +518,7 @@ public function getName() * * @param string|null $name The name of the track containing a human-readable description. This value must be unique across all text type and subtitles `text` type tracks. The hls manifest will associate a subtitle text track with this value. For example, the value should be \"English\" for subtitles text track with language_code as en. This optional parameter should be used only for `text` type and subtitles `text` type track. If this parameter is not included, Mux will auto-populate based on the `input[].language_code` value. * - * @return $this + * @return self */ public function setName($name) { @@ -506,7 +542,7 @@ public function getClosedCaptions() * * @param bool|null $closed_captions Indicates the track provides Subtitles for the Deaf or Hard-of-hearing (SDH). This optional parameter should be used for `text` type and subtitles `text` type tracks. * - * @return $this + * @return self */ public function setClosedCaptions($closed_captions) { @@ -530,7 +566,7 @@ public function getPassthrough() * * @param string|null $passthrough This optional parameter should be used for `text` type and subtitles `text` type tracks. * - * @return $this + * @return self */ public function setPassthrough($passthrough) { @@ -555,18 +591,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -591,6 +627,18 @@ public function offsetUnset($offset) 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. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -603,6 +651,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/MuxPhp/Models/InputSettingsOverlaySettings.php b/MuxPhp/Models/InputSettingsOverlaySettings.php index 3c98c3f..3a256fa 100644 --- a/MuxPhp/Models/InputSettingsOverlaySettings.php +++ b/MuxPhp/Models/InputSettingsOverlaySettings.php @@ -1,8 +1,30 @@ + * @template TKey int|null + * @template TValue mixed|null */ -class InputSettingsOverlaySettings implements ModelInterface, ArrayAccess +class InputSettingsOverlaySettings implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'InputSettings_overlay_settings'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'vertical_align' => 'string', 'vertical_margin' => 'string', @@ -44,10 +71,12 @@ class InputSettingsOverlaySettings implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'vertical_align' => null, 'vertical_margin' => null, @@ -165,12 +194,12 @@ public function getModelName() return self::$openAPIModelName; } - const VERTICAL_ALIGN_TOP = 'top'; - const VERTICAL_ALIGN_MIDDLE = 'middle'; - const VERTICAL_ALIGN_BOTTOM = 'bottom'; - const HORIZONTAL_ALIGN_LEFT = 'left'; - const HORIZONTAL_ALIGN_CENTER = 'center'; - const HORIZONTAL_ALIGN_RIGHT = 'right'; + public const VERTICAL_ALIGN_TOP = 'top'; + public const VERTICAL_ALIGN_MIDDLE = 'middle'; + public const VERTICAL_ALIGN_BOTTOM = 'bottom'; + public const HORIZONTAL_ALIGN_LEFT = 'left'; + public const HORIZONTAL_ALIGN_CENTER = 'center'; + public const HORIZONTAL_ALIGN_RIGHT = 'right'; @@ -218,13 +247,16 @@ public function getHorizontalAlignAllowableValues() */ public function __construct(array $data = null) { - $this->container['vertical_align'] = isset($data['vertical_align']) ? $data['vertical_align'] : null; - $this->container['vertical_margin'] = isset($data['vertical_margin']) ? $data['vertical_margin'] : null; - $this->container['horizontal_align'] = isset($data['horizontal_align']) ? $data['horizontal_align'] : null; - $this->container['horizontal_margin'] = isset($data['horizontal_margin']) ? $data['horizontal_margin'] : null; - $this->container['width'] = isset($data['width']) ? $data['width'] : null; - $this->container['height'] = isset($data['height']) ? $data['height'] : null; - $this->container['opacity'] = isset($data['opacity']) ? $data['opacity'] : 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->container['vertical_align'] = $data['vertical_align'] ?? null; + $this->container['vertical_margin'] = $data['vertical_margin'] ?? null; + $this->container['horizontal_align'] = $data['horizontal_align'] ?? null; + $this->container['horizontal_margin'] = $data['horizontal_margin'] ?? null; + $this->container['width'] = $data['width'] ?? null; + $this->container['height'] = $data['height'] ?? null; + $this->container['opacity'] = $data['opacity'] ?? null; } /** @@ -239,7 +271,8 @@ public function listInvalidProperties() $allowedValues = $this->getVerticalAlignAllowableValues(); if (!is_null($this->container['vertical_align']) && !in_array($this->container['vertical_align'], $allowedValues, true)) { $invalidProperties[] = sprintf( - "invalid value for 'vertical_align', must be one of '%s'", + "invalid value '%s' for 'vertical_align', must be one of '%s'", + $this->container['vertical_align'], implode("', '", $allowedValues) ); } @@ -247,7 +280,8 @@ public function listInvalidProperties() $allowedValues = $this->getHorizontalAlignAllowableValues(); if (!is_null($this->container['horizontal_align']) && !in_array($this->container['horizontal_align'], $allowedValues, true)) { $invalidProperties[] = sprintf( - "invalid value for 'horizontal_align', must be one of '%s'", + "invalid value '%s' for 'horizontal_align', must be one of '%s'", + $this->container['horizontal_align'], implode("', '", $allowedValues) ); } @@ -282,7 +316,7 @@ public function getVerticalAlign() * * @param string|null $vertical_align Where the vertical positioning of the overlay/watermark should begin from. Defaults to `\"top\"` * - * @return $this + * @return self */ public function setVerticalAlign($vertical_align) { @@ -290,7 +324,8 @@ public function setVerticalAlign($vertical_align) if (!is_null($vertical_align) && !in_array($vertical_align, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( - "Invalid value for 'vertical_align', must be one of '%s'", + "Invalid value '%s' for 'vertical_align', must be one of '%s'", + $vertical_align, implode("', '", $allowedValues) ) ); @@ -315,7 +350,7 @@ public function getVerticalMargin() * * @param string|null $vertical_margin The distance from the vertical_align starting point and the image's closest edge. Can be expressed as a percent (\"10%\") or as a pixel value (\"100px\"). Negative values will move the overlay offscreen. In the case of 'middle', a positive value will shift the overlay towards the bottom and and a negative value will shift it towards the top. * - * @return $this + * @return self */ public function setVerticalMargin($vertical_margin) { @@ -339,7 +374,7 @@ public function getHorizontalAlign() * * @param string|null $horizontal_align Where the horizontal positioning of the overlay/watermark should begin from. * - * @return $this + * @return self */ public function setHorizontalAlign($horizontal_align) { @@ -347,7 +382,8 @@ public function setHorizontalAlign($horizontal_align) if (!is_null($horizontal_align) && !in_array($horizontal_align, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( - "Invalid value for 'horizontal_align', must be one of '%s'", + "Invalid value '%s' for 'horizontal_align', must be one of '%s'", + $horizontal_align, implode("', '", $allowedValues) ) ); @@ -372,7 +408,7 @@ public function getHorizontalMargin() * * @param string|null $horizontal_margin The distance from the horizontal_align starting point and the image's closest edge. Can be expressed as a percent (\"10%\") or as a pixel value (\"100px\"). Negative values will move the overlay offscreen. In the case of 'center', a positive value will shift the image towards the right and and a negative value will shift it towards the left. * - * @return $this + * @return self */ public function setHorizontalMargin($horizontal_margin) { @@ -396,7 +432,7 @@ public function getWidth() * * @param string|null $width How wide the overlay should appear. Can be expressed as a percent (\"10%\") or as a pixel value (\"100px\"). If both width and height are left blank the width will be the true pixels of the image, applied as if the video has been scaled to fit a 1920x1080 frame. If height is supplied with no width, the width will scale proportionally to the height. * - * @return $this + * @return self */ public function setWidth($width) { @@ -420,7 +456,7 @@ public function getHeight() * * @param string|null $height How tall the overlay should appear. Can be expressed as a percent (\"10%\") or as a pixel value (\"100px\"). If both width and height are left blank the height will be the true pixels of the image, applied as if the video has been scaled to fit a 1920x1080 frame. If width is supplied with no height, the height will scale proportionally to the width. * - * @return $this + * @return self */ public function setHeight($height) { @@ -444,7 +480,7 @@ public function getOpacity() * * @param string|null $opacity How opaque the overlay should appear, expressed as a percent. (Default 100%) * - * @return $this + * @return self */ public function setOpacity($opacity) { @@ -469,18 +505,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -505,6 +541,18 @@ public function offsetUnset($offset) 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. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -517,6 +565,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/MuxPhp/Models/InputTrack.php b/MuxPhp/Models/InputTrack.php index f79aa06..b7ab001 100644 --- a/MuxPhp/Models/InputTrack.php +++ b/MuxPhp/Models/InputTrack.php @@ -1,8 +1,30 @@ + * @template TKey int|null + * @template TValue mixed|null */ -class InputTrack implements ModelInterface, ArrayAccess +class InputTrack implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'InputTrack'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'type' => 'string', 'duration' => 'double', @@ -45,10 +72,12 @@ class InputTrack implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'type' => null, 'duration' => 'double', @@ -193,15 +222,18 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['type'] = isset($data['type']) ? $data['type'] : null; - $this->container['duration'] = isset($data['duration']) ? $data['duration'] : null; - $this->container['encoding'] = isset($data['encoding']) ? $data['encoding'] : null; - $this->container['width'] = isset($data['width']) ? $data['width'] : null; - $this->container['height'] = isset($data['height']) ? $data['height'] : null; - $this->container['frame_rate'] = isset($data['frame_rate']) ? $data['frame_rate'] : null; - $this->container['sample_rate'] = isset($data['sample_rate']) ? $data['sample_rate'] : null; - $this->container['sample_size'] = isset($data['sample_size']) ? $data['sample_size'] : null; - $this->container['channels'] = isset($data['channels']) ? $data['channels'] : 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->container['type'] = $data['type'] ?? null; + $this->container['duration'] = $data['duration'] ?? null; + $this->container['encoding'] = $data['encoding'] ?? null; + $this->container['width'] = $data['width'] ?? null; + $this->container['height'] = $data['height'] ?? null; + $this->container['frame_rate'] = $data['frame_rate'] ?? null; + $this->container['sample_rate'] = $data['sample_rate'] ?? null; + $this->container['sample_size'] = $data['sample_size'] ?? null; + $this->container['channels'] = $data['channels'] ?? null; } /** @@ -243,7 +275,7 @@ public function getType() * * @param string|null $type type * - * @return $this + * @return self */ public function setType($type) { @@ -267,7 +299,7 @@ public function getDuration() * * @param double|null $duration duration * - * @return $this + * @return self */ public function setDuration($duration) { @@ -291,7 +323,7 @@ public function getEncoding() * * @param string|null $encoding encoding * - * @return $this + * @return self */ public function setEncoding($encoding) { @@ -315,7 +347,7 @@ public function getWidth() * * @param int|null $width width * - * @return $this + * @return self */ public function setWidth($width) { @@ -339,7 +371,7 @@ public function getHeight() * * @param int|null $height height * - * @return $this + * @return self */ public function setHeight($height) { @@ -363,7 +395,7 @@ public function getFrameRate() * * @param double|null $frame_rate frame_rate * - * @return $this + * @return self */ public function setFrameRate($frame_rate) { @@ -387,7 +419,7 @@ public function getSampleRate() * * @param int|null $sample_rate sample_rate * - * @return $this + * @return self */ public function setSampleRate($sample_rate) { @@ -411,7 +443,7 @@ public function getSampleSize() * * @param int|null $sample_size sample_size * - * @return $this + * @return self */ public function setSampleSize($sample_size) { @@ -435,7 +467,7 @@ public function getChannels() * * @param int|null $channels channels * - * @return $this + * @return self */ public function setChannels($channels) { @@ -460,18 +492,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -496,6 +528,18 @@ public function offsetUnset($offset) 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. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -508,6 +552,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/MuxPhp/Models/Insight.php b/MuxPhp/Models/Insight.php index 4fff8ae..f6fb03c 100644 --- a/MuxPhp/Models/Insight.php +++ b/MuxPhp/Models/Insight.php @@ -1,8 +1,30 @@ + * @template TKey int|null + * @template TValue mixed|null */ -class Insight implements ModelInterface, ArrayAccess +class Insight implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'Insight'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'total_watch_time' => 'int', 'total_views' => 'int', @@ -42,10 +69,12 @@ class Insight implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'total_watch_time' => 'int64', 'total_views' => 'int64', @@ -178,12 +207,15 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['total_watch_time'] = isset($data['total_watch_time']) ? $data['total_watch_time'] : null; - $this->container['total_views'] = isset($data['total_views']) ? $data['total_views'] : null; - $this->container['negative_impact_score'] = isset($data['negative_impact_score']) ? $data['negative_impact_score'] : null; - $this->container['metric'] = isset($data['metric']) ? $data['metric'] : null; - $this->container['filter_value'] = isset($data['filter_value']) ? $data['filter_value'] : null; - $this->container['filter_column'] = isset($data['filter_column']) ? $data['filter_column'] : 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->container['total_watch_time'] = $data['total_watch_time'] ?? null; + $this->container['total_views'] = $data['total_views'] ?? null; + $this->container['negative_impact_score'] = $data['negative_impact_score'] ?? null; + $this->container['metric'] = $data['metric'] ?? null; + $this->container['filter_value'] = $data['filter_value'] ?? null; + $this->container['filter_column'] = $data['filter_column'] ?? null; } /** @@ -225,7 +257,7 @@ public function getTotalWatchTime() * * @param int|null $total_watch_time total_watch_time * - * @return $this + * @return self */ public function setTotalWatchTime($total_watch_time) { @@ -249,7 +281,7 @@ public function getTotalViews() * * @param int|null $total_views total_views * - * @return $this + * @return self */ public function setTotalViews($total_views) { @@ -273,7 +305,7 @@ public function getNegativeImpactScore() * * @param float|null $negative_impact_score negative_impact_score * - * @return $this + * @return self */ public function setNegativeImpactScore($negative_impact_score) { @@ -297,7 +329,7 @@ public function getMetric() * * @param double|null $metric metric * - * @return $this + * @return self */ public function setMetric($metric) { @@ -321,7 +353,7 @@ public function getFilterValue() * * @param string|null $filter_value filter_value * - * @return $this + * @return self */ public function setFilterValue($filter_value) { @@ -345,7 +377,7 @@ public function getFilterColumn() * * @param string|null $filter_column filter_column * - * @return $this + * @return self */ public function setFilterColumn($filter_column) { @@ -370,18 +402,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -406,6 +438,18 @@ public function offsetUnset($offset) 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. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -418,6 +462,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/MuxPhp/Models/ListAllMetricValuesResponse.php b/MuxPhp/Models/ListAllMetricValuesResponse.php index 9371d67..e98515d 100644 --- a/MuxPhp/Models/ListAllMetricValuesResponse.php +++ b/MuxPhp/Models/ListAllMetricValuesResponse.php @@ -1,8 +1,30 @@ + * @template TKey int|null + * @template TValue mixed|null */ -class ListAllMetricValuesResponse implements ModelInterface, ArrayAccess +class ListAllMetricValuesResponse implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'ListAllMetricValuesResponse'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'data' => '\MuxPhp\Models\Score[]', 'total_row_count' => 'int', @@ -39,10 +66,12 @@ class ListAllMetricValuesResponse implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'data' => null, 'total_row_count' => 'int64', @@ -163,9 +192,12 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['data'] = isset($data['data']) ? $data['data'] : null; - $this->container['total_row_count'] = isset($data['total_row_count']) ? $data['total_row_count'] : null; - $this->container['timeframe'] = isset($data['timeframe']) ? $data['timeframe'] : 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->container['data'] = $data['data'] ?? null; + $this->container['total_row_count'] = $data['total_row_count'] ?? null; + $this->container['timeframe'] = $data['timeframe'] ?? null; } /** @@ -207,7 +239,7 @@ public function getData() * * @param \MuxPhp\Models\Score[]|null $data data * - * @return $this + * @return self */ public function setData($data) { @@ -231,7 +263,7 @@ public function getTotalRowCount() * * @param int|null $total_row_count total_row_count * - * @return $this + * @return self */ public function setTotalRowCount($total_row_count) { @@ -255,7 +287,7 @@ public function getTimeframe() * * @param int[]|null $timeframe timeframe * - * @return $this + * @return self */ public function setTimeframe($timeframe) { @@ -280,18 +312,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -316,6 +348,18 @@ public function offsetUnset($offset) 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. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -328,6 +372,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/MuxPhp/Models/ListAssetsResponse.php b/MuxPhp/Models/ListAssetsResponse.php index 3829723..43c7933 100644 --- a/MuxPhp/Models/ListAssetsResponse.php +++ b/MuxPhp/Models/ListAssetsResponse.php @@ -1,8 +1,30 @@ + * @template TKey int|null + * @template TValue mixed|null */ -class ListAssetsResponse implements ModelInterface, ArrayAccess +class ListAssetsResponse implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'ListAssetsResponse'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'data' => '\MuxPhp\Models\Asset[]' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'data' => null ]; @@ -153,7 +182,10 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['data'] = isset($data['data']) ? $data['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->container['data'] = $data['data'] ?? null; } /** @@ -195,7 +227,7 @@ public function getData() * * @param \MuxPhp\Models\Asset[]|null $data data * - * @return $this + * @return self */ public function setData($data) { @@ -220,18 +252,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -256,6 +288,18 @@ public function offsetUnset($offset) 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. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -268,6 +312,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/MuxPhp/Models/ListBreakdownValuesResponse.php b/MuxPhp/Models/ListBreakdownValuesResponse.php index 5cd5924..ef24d0e 100644 --- a/MuxPhp/Models/ListBreakdownValuesResponse.php +++ b/MuxPhp/Models/ListBreakdownValuesResponse.php @@ -1,8 +1,30 @@ + * @template TKey int|null + * @template TValue mixed|null */ -class ListBreakdownValuesResponse implements ModelInterface, ArrayAccess +class ListBreakdownValuesResponse implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'ListBreakdownValuesResponse'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'data' => '\MuxPhp\Models\BreakdownValue[]', 'total_row_count' => 'int', @@ -39,10 +66,12 @@ class ListBreakdownValuesResponse implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'data' => null, 'total_row_count' => 'int64', @@ -163,9 +192,12 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['data'] = isset($data['data']) ? $data['data'] : null; - $this->container['total_row_count'] = isset($data['total_row_count']) ? $data['total_row_count'] : null; - $this->container['timeframe'] = isset($data['timeframe']) ? $data['timeframe'] : 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->container['data'] = $data['data'] ?? null; + $this->container['total_row_count'] = $data['total_row_count'] ?? null; + $this->container['timeframe'] = $data['timeframe'] ?? null; } /** @@ -207,7 +239,7 @@ public function getData() * * @param \MuxPhp\Models\BreakdownValue[]|null $data data * - * @return $this + * @return self */ public function setData($data) { @@ -231,7 +263,7 @@ public function getTotalRowCount() * * @param int|null $total_row_count total_row_count * - * @return $this + * @return self */ public function setTotalRowCount($total_row_count) { @@ -255,7 +287,7 @@ public function getTimeframe() * * @param int[]|null $timeframe timeframe * - * @return $this + * @return self */ public function setTimeframe($timeframe) { @@ -280,18 +312,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -316,6 +348,18 @@ public function offsetUnset($offset) 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. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -328,6 +372,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/MuxPhp/Models/ListDeliveryUsageResponse.php b/MuxPhp/Models/ListDeliveryUsageResponse.php index 5eb90fb..809a50f 100644 --- a/MuxPhp/Models/ListDeliveryUsageResponse.php +++ b/MuxPhp/Models/ListDeliveryUsageResponse.php @@ -1,8 +1,30 @@ + * @template TKey int|null + * @template TValue mixed|null */ -class ListDeliveryUsageResponse implements ModelInterface, ArrayAccess +class ListDeliveryUsageResponse implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'ListDeliveryUsageResponse'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'data' => '\MuxPhp\Models\DeliveryReport[]', 'total_row_count' => 'int', @@ -40,10 +67,12 @@ class ListDeliveryUsageResponse implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'data' => null, 'total_row_count' => 'int64', @@ -168,10 +197,13 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['data'] = isset($data['data']) ? $data['data'] : null; - $this->container['total_row_count'] = isset($data['total_row_count']) ? $data['total_row_count'] : null; - $this->container['timeframe'] = isset($data['timeframe']) ? $data['timeframe'] : null; - $this->container['limit'] = isset($data['limit']) ? $data['limit'] : 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->container['data'] = $data['data'] ?? null; + $this->container['total_row_count'] = $data['total_row_count'] ?? null; + $this->container['timeframe'] = $data['timeframe'] ?? null; + $this->container['limit'] = $data['limit'] ?? null; } /** @@ -213,7 +245,7 @@ public function getData() * * @param \MuxPhp\Models\DeliveryReport[]|null $data data * - * @return $this + * @return self */ public function setData($data) { @@ -237,7 +269,7 @@ public function getTotalRowCount() * * @param int|null $total_row_count total_row_count * - * @return $this + * @return self */ public function setTotalRowCount($total_row_count) { @@ -261,7 +293,7 @@ public function getTimeframe() * * @param int[]|null $timeframe timeframe * - * @return $this + * @return self */ public function setTimeframe($timeframe) { @@ -285,7 +317,7 @@ public function getLimit() * * @param int|null $limit Number of assets returned in this response. Default value is 100. * - * @return $this + * @return self */ public function setLimit($limit) { @@ -310,18 +342,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -346,6 +378,18 @@ public function offsetUnset($offset) 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. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -358,6 +402,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/MuxPhp/Models/ListDimensionValuesResponse.php b/MuxPhp/Models/ListDimensionValuesResponse.php index fcb2e3c..6f12869 100644 --- a/MuxPhp/Models/ListDimensionValuesResponse.php +++ b/MuxPhp/Models/ListDimensionValuesResponse.php @@ -1,8 +1,30 @@ + * @template TKey int|null + * @template TValue mixed|null */ -class ListDimensionValuesResponse implements ModelInterface, ArrayAccess +class ListDimensionValuesResponse implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'ListDimensionValuesResponse'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'data' => '\MuxPhp\Models\DimensionValue[]', 'total_row_count' => 'int', @@ -39,10 +66,12 @@ class ListDimensionValuesResponse implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'data' => null, 'total_row_count' => 'int64', @@ -163,9 +192,12 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['data'] = isset($data['data']) ? $data['data'] : null; - $this->container['total_row_count'] = isset($data['total_row_count']) ? $data['total_row_count'] : null; - $this->container['timeframe'] = isset($data['timeframe']) ? $data['timeframe'] : 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->container['data'] = $data['data'] ?? null; + $this->container['total_row_count'] = $data['total_row_count'] ?? null; + $this->container['timeframe'] = $data['timeframe'] ?? null; } /** @@ -207,7 +239,7 @@ public function getData() * * @param \MuxPhp\Models\DimensionValue[]|null $data data * - * @return $this + * @return self */ public function setData($data) { @@ -231,7 +263,7 @@ public function getTotalRowCount() * * @param int|null $total_row_count total_row_count * - * @return $this + * @return self */ public function setTotalRowCount($total_row_count) { @@ -255,7 +287,7 @@ public function getTimeframe() * * @param int[]|null $timeframe timeframe * - * @return $this + * @return self */ public function setTimeframe($timeframe) { @@ -280,18 +312,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -316,6 +348,18 @@ public function offsetUnset($offset) 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. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -328,6 +372,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/MuxPhp/Models/ListDimensionsResponse.php b/MuxPhp/Models/ListDimensionsResponse.php index 1d64904..dedab51 100644 --- a/MuxPhp/Models/ListDimensionsResponse.php +++ b/MuxPhp/Models/ListDimensionsResponse.php @@ -1,8 +1,30 @@ + * @template TKey int|null + * @template TValue mixed|null */ -class ListDimensionsResponse implements ModelInterface, ArrayAccess +class ListDimensionsResponse implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'ListDimensionsResponse'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'data' => '\MuxPhp\Models\ListFiltersResponseData', 'total_row_count' => 'int', @@ -39,10 +66,12 @@ class ListDimensionsResponse implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'data' => null, 'total_row_count' => 'int64', @@ -163,9 +192,12 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['data'] = isset($data['data']) ? $data['data'] : null; - $this->container['total_row_count'] = isset($data['total_row_count']) ? $data['total_row_count'] : null; - $this->container['timeframe'] = isset($data['timeframe']) ? $data['timeframe'] : 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->container['data'] = $data['data'] ?? null; + $this->container['total_row_count'] = $data['total_row_count'] ?? null; + $this->container['timeframe'] = $data['timeframe'] ?? null; } /** @@ -207,7 +239,7 @@ public function getData() * * @param \MuxPhp\Models\ListFiltersResponseData|null $data data * - * @return $this + * @return self */ public function setData($data) { @@ -231,7 +263,7 @@ public function getTotalRowCount() * * @param int|null $total_row_count total_row_count * - * @return $this + * @return self */ public function setTotalRowCount($total_row_count) { @@ -255,7 +287,7 @@ public function getTimeframe() * * @param int[]|null $timeframe timeframe * - * @return $this + * @return self */ public function setTimeframe($timeframe) { @@ -280,18 +312,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -316,6 +348,18 @@ public function offsetUnset($offset) 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. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -328,6 +372,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/MuxPhp/Models/ListErrorsResponse.php b/MuxPhp/Models/ListErrorsResponse.php index 5d5646f..9f4a13b 100644 --- a/MuxPhp/Models/ListErrorsResponse.php +++ b/MuxPhp/Models/ListErrorsResponse.php @@ -1,8 +1,30 @@ + * @template TKey int|null + * @template TValue mixed|null */ -class ListErrorsResponse implements ModelInterface, ArrayAccess +class ListErrorsResponse implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'ListErrorsResponse'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'data' => '\MuxPhp\Models\Error[]', 'total_row_count' => 'int', @@ -39,10 +66,12 @@ class ListErrorsResponse implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'data' => null, 'total_row_count' => 'int64', @@ -163,9 +192,12 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['data'] = isset($data['data']) ? $data['data'] : null; - $this->container['total_row_count'] = isset($data['total_row_count']) ? $data['total_row_count'] : null; - $this->container['timeframe'] = isset($data['timeframe']) ? $data['timeframe'] : 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->container['data'] = $data['data'] ?? null; + $this->container['total_row_count'] = $data['total_row_count'] ?? null; + $this->container['timeframe'] = $data['timeframe'] ?? null; } /** @@ -207,7 +239,7 @@ public function getData() * * @param \MuxPhp\Models\Error[]|null $data data * - * @return $this + * @return self */ public function setData($data) { @@ -231,7 +263,7 @@ public function getTotalRowCount() * * @param int|null $total_row_count total_row_count * - * @return $this + * @return self */ public function setTotalRowCount($total_row_count) { @@ -255,7 +287,7 @@ public function getTimeframe() * * @param int[]|null $timeframe timeframe * - * @return $this + * @return self */ public function setTimeframe($timeframe) { @@ -280,18 +312,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -316,6 +348,18 @@ public function offsetUnset($offset) 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. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -328,6 +372,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/MuxPhp/Models/ListExportsResponse.php b/MuxPhp/Models/ListExportsResponse.php index 8255bdc..889b56e 100644 --- a/MuxPhp/Models/ListExportsResponse.php +++ b/MuxPhp/Models/ListExportsResponse.php @@ -1,8 +1,30 @@ + * @template TKey int|null + * @template TValue mixed|null */ -class ListExportsResponse implements ModelInterface, ArrayAccess +class ListExportsResponse implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'ListExportsResponse'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'data' => 'string[]', 'total_row_count' => 'int', @@ -39,10 +66,12 @@ class ListExportsResponse implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'data' => null, 'total_row_count' => 'int64', @@ -163,9 +192,12 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['data'] = isset($data['data']) ? $data['data'] : null; - $this->container['total_row_count'] = isset($data['total_row_count']) ? $data['total_row_count'] : null; - $this->container['timeframe'] = isset($data['timeframe']) ? $data['timeframe'] : 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->container['data'] = $data['data'] ?? null; + $this->container['total_row_count'] = $data['total_row_count'] ?? null; + $this->container['timeframe'] = $data['timeframe'] ?? null; } /** @@ -207,7 +239,7 @@ public function getData() * * @param string[]|null $data data * - * @return $this + * @return self */ public function setData($data) { @@ -231,7 +263,7 @@ public function getTotalRowCount() * * @param int|null $total_row_count total_row_count * - * @return $this + * @return self */ public function setTotalRowCount($total_row_count) { @@ -255,7 +287,7 @@ public function getTimeframe() * * @param int[]|null $timeframe timeframe * - * @return $this + * @return self */ public function setTimeframe($timeframe) { @@ -280,18 +312,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -316,6 +348,18 @@ public function offsetUnset($offset) 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. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -328,6 +372,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/MuxPhp/Models/ListFilterValuesResponse.php b/MuxPhp/Models/ListFilterValuesResponse.php index 45a5dfc..4f14ea4 100644 --- a/MuxPhp/Models/ListFilterValuesResponse.php +++ b/MuxPhp/Models/ListFilterValuesResponse.php @@ -1,8 +1,30 @@ + * @template TKey int|null + * @template TValue mixed|null */ -class ListFilterValuesResponse implements ModelInterface, ArrayAccess +class ListFilterValuesResponse implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'ListFilterValuesResponse'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'data' => '\MuxPhp\Models\FilterValue[]', 'total_row_count' => 'int', @@ -39,10 +66,12 @@ class ListFilterValuesResponse implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'data' => null, 'total_row_count' => 'int64', @@ -163,9 +192,12 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['data'] = isset($data['data']) ? $data['data'] : null; - $this->container['total_row_count'] = isset($data['total_row_count']) ? $data['total_row_count'] : null; - $this->container['timeframe'] = isset($data['timeframe']) ? $data['timeframe'] : 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->container['data'] = $data['data'] ?? null; + $this->container['total_row_count'] = $data['total_row_count'] ?? null; + $this->container['timeframe'] = $data['timeframe'] ?? null; } /** @@ -207,7 +239,7 @@ public function getData() * * @param \MuxPhp\Models\FilterValue[]|null $data data * - * @return $this + * @return self */ public function setData($data) { @@ -231,7 +263,7 @@ public function getTotalRowCount() * * @param int|null $total_row_count total_row_count * - * @return $this + * @return self */ public function setTotalRowCount($total_row_count) { @@ -255,7 +287,7 @@ public function getTimeframe() * * @param int[]|null $timeframe timeframe * - * @return $this + * @return self */ public function setTimeframe($timeframe) { @@ -280,18 +312,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -316,6 +348,18 @@ public function offsetUnset($offset) 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. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -328,6 +372,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/MuxPhp/Models/ListFiltersResponse.php b/MuxPhp/Models/ListFiltersResponse.php index 1271219..8ab34cb 100644 --- a/MuxPhp/Models/ListFiltersResponse.php +++ b/MuxPhp/Models/ListFiltersResponse.php @@ -1,8 +1,30 @@ + * @template TKey int|null + * @template TValue mixed|null */ -class ListFiltersResponse implements ModelInterface, ArrayAccess +class ListFiltersResponse implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'ListFiltersResponse'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'data' => '\MuxPhp\Models\ListFiltersResponseData', 'total_row_count' => 'int', @@ -39,10 +66,12 @@ class ListFiltersResponse implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'data' => null, 'total_row_count' => 'int64', @@ -163,9 +192,12 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['data'] = isset($data['data']) ? $data['data'] : null; - $this->container['total_row_count'] = isset($data['total_row_count']) ? $data['total_row_count'] : null; - $this->container['timeframe'] = isset($data['timeframe']) ? $data['timeframe'] : 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->container['data'] = $data['data'] ?? null; + $this->container['total_row_count'] = $data['total_row_count'] ?? null; + $this->container['timeframe'] = $data['timeframe'] ?? null; } /** @@ -207,7 +239,7 @@ public function getData() * * @param \MuxPhp\Models\ListFiltersResponseData|null $data data * - * @return $this + * @return self */ public function setData($data) { @@ -231,7 +263,7 @@ public function getTotalRowCount() * * @param int|null $total_row_count total_row_count * - * @return $this + * @return self */ public function setTotalRowCount($total_row_count) { @@ -255,7 +287,7 @@ public function getTimeframe() * * @param int[]|null $timeframe timeframe * - * @return $this + * @return self */ public function setTimeframe($timeframe) { @@ -280,18 +312,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -316,6 +348,18 @@ public function offsetUnset($offset) 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. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -328,6 +372,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/MuxPhp/Models/ListFiltersResponseData.php b/MuxPhp/Models/ListFiltersResponseData.php index 54fd0d1..3d89006 100644 --- a/MuxPhp/Models/ListFiltersResponseData.php +++ b/MuxPhp/Models/ListFiltersResponseData.php @@ -1,8 +1,30 @@ + * @template TKey int|null + * @template TValue mixed|null */ -class ListFiltersResponseData implements ModelInterface, ArrayAccess +class ListFiltersResponseData implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'ListFiltersResponse_data'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'basic' => 'string[]', 'advanced' => 'string[]' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'basic' => null, 'advanced' => null @@ -158,8 +187,11 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['basic'] = isset($data['basic']) ? $data['basic'] : null; - $this->container['advanced'] = isset($data['advanced']) ? $data['advanced'] : 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->container['basic'] = $data['basic'] ?? null; + $this->container['advanced'] = $data['advanced'] ?? null; } /** @@ -201,7 +233,7 @@ public function getBasic() * * @param string[]|null $basic basic * - * @return $this + * @return self */ public function setBasic($basic) { @@ -225,7 +257,7 @@ public function getAdvanced() * * @param string[]|null $advanced advanced * - * @return $this + * @return self */ public function setAdvanced($advanced) { @@ -250,18 +282,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -286,6 +318,18 @@ public function offsetUnset($offset) 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. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -298,6 +342,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/MuxPhp/Models/ListIncidentsResponse.php b/MuxPhp/Models/ListIncidentsResponse.php index a36d5d1..8fe1bdd 100644 --- a/MuxPhp/Models/ListIncidentsResponse.php +++ b/MuxPhp/Models/ListIncidentsResponse.php @@ -1,8 +1,30 @@ + * @template TKey int|null + * @template TValue mixed|null */ -class ListIncidentsResponse implements ModelInterface, ArrayAccess +class ListIncidentsResponse implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'ListIncidentsResponse'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'data' => '\MuxPhp\Models\Incident[]', 'total_row_count' => 'int', @@ -39,10 +66,12 @@ class ListIncidentsResponse implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'data' => null, 'total_row_count' => 'int64', @@ -163,9 +192,12 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['data'] = isset($data['data']) ? $data['data'] : null; - $this->container['total_row_count'] = isset($data['total_row_count']) ? $data['total_row_count'] : null; - $this->container['timeframe'] = isset($data['timeframe']) ? $data['timeframe'] : 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->container['data'] = $data['data'] ?? null; + $this->container['total_row_count'] = $data['total_row_count'] ?? null; + $this->container['timeframe'] = $data['timeframe'] ?? null; } /** @@ -207,7 +239,7 @@ public function getData() * * @param \MuxPhp\Models\Incident[]|null $data data * - * @return $this + * @return self */ public function setData($data) { @@ -231,7 +263,7 @@ public function getTotalRowCount() * * @param int|null $total_row_count total_row_count * - * @return $this + * @return self */ public function setTotalRowCount($total_row_count) { @@ -255,7 +287,7 @@ public function getTimeframe() * * @param int[]|null $timeframe timeframe * - * @return $this + * @return self */ public function setTimeframe($timeframe) { @@ -280,18 +312,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -316,6 +348,18 @@ public function offsetUnset($offset) 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. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -328,6 +372,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/MuxPhp/Models/ListInsightsResponse.php b/MuxPhp/Models/ListInsightsResponse.php index bff1dc1..6539113 100644 --- a/MuxPhp/Models/ListInsightsResponse.php +++ b/MuxPhp/Models/ListInsightsResponse.php @@ -1,8 +1,30 @@ + * @template TKey int|null + * @template TValue mixed|null */ -class ListInsightsResponse implements ModelInterface, ArrayAccess +class ListInsightsResponse implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'ListInsightsResponse'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'data' => '\MuxPhp\Models\Insight[]', 'total_row_count' => 'int', @@ -39,10 +66,12 @@ class ListInsightsResponse implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'data' => null, 'total_row_count' => 'int64', @@ -163,9 +192,12 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['data'] = isset($data['data']) ? $data['data'] : null; - $this->container['total_row_count'] = isset($data['total_row_count']) ? $data['total_row_count'] : null; - $this->container['timeframe'] = isset($data['timeframe']) ? $data['timeframe'] : 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->container['data'] = $data['data'] ?? null; + $this->container['total_row_count'] = $data['total_row_count'] ?? null; + $this->container['timeframe'] = $data['timeframe'] ?? null; } /** @@ -207,7 +239,7 @@ public function getData() * * @param \MuxPhp\Models\Insight[]|null $data data * - * @return $this + * @return self */ public function setData($data) { @@ -231,7 +263,7 @@ public function getTotalRowCount() * * @param int|null $total_row_count total_row_count * - * @return $this + * @return self */ public function setTotalRowCount($total_row_count) { @@ -255,7 +287,7 @@ public function getTimeframe() * * @param int[]|null $timeframe timeframe * - * @return $this + * @return self */ public function setTimeframe($timeframe) { @@ -280,18 +312,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -316,6 +348,18 @@ public function offsetUnset($offset) 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. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -328,6 +372,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/MuxPhp/Models/ListLiveStreamsResponse.php b/MuxPhp/Models/ListLiveStreamsResponse.php index 1c0f460..d82bdab 100644 --- a/MuxPhp/Models/ListLiveStreamsResponse.php +++ b/MuxPhp/Models/ListLiveStreamsResponse.php @@ -1,8 +1,30 @@ + * @template TKey int|null + * @template TValue mixed|null */ -class ListLiveStreamsResponse implements ModelInterface, ArrayAccess +class ListLiveStreamsResponse implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'ListLiveStreamsResponse'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'data' => '\MuxPhp\Models\LiveStream[]' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'data' => null ]; @@ -153,7 +182,10 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['data'] = isset($data['data']) ? $data['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->container['data'] = $data['data'] ?? null; } /** @@ -195,7 +227,7 @@ public function getData() * * @param \MuxPhp\Models\LiveStream[]|null $data data * - * @return $this + * @return self */ public function setData($data) { @@ -220,18 +252,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -256,6 +288,18 @@ public function offsetUnset($offset) 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. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -268,6 +312,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/MuxPhp/Models/ListRealTimeDimensionsResponse.php b/MuxPhp/Models/ListRealTimeDimensionsResponse.php index afcfc74..6322651 100644 --- a/MuxPhp/Models/ListRealTimeDimensionsResponse.php +++ b/MuxPhp/Models/ListRealTimeDimensionsResponse.php @@ -1,8 +1,30 @@ + * @template TKey int|null + * @template TValue mixed|null */ -class ListRealTimeDimensionsResponse implements ModelInterface, ArrayAccess +class ListRealTimeDimensionsResponse implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'ListRealTimeDimensionsResponse'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'data' => '\MuxPhp\Models\ListRealTimeDimensionsResponseData[]', 'total_row_count' => 'int', @@ -39,10 +66,12 @@ class ListRealTimeDimensionsResponse implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'data' => null, 'total_row_count' => 'int64', @@ -163,9 +192,12 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['data'] = isset($data['data']) ? $data['data'] : null; - $this->container['total_row_count'] = isset($data['total_row_count']) ? $data['total_row_count'] : null; - $this->container['timeframe'] = isset($data['timeframe']) ? $data['timeframe'] : 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->container['data'] = $data['data'] ?? null; + $this->container['total_row_count'] = $data['total_row_count'] ?? null; + $this->container['timeframe'] = $data['timeframe'] ?? null; } /** @@ -207,7 +239,7 @@ public function getData() * * @param \MuxPhp\Models\ListRealTimeDimensionsResponseData[]|null $data data * - * @return $this + * @return self */ public function setData($data) { @@ -231,7 +263,7 @@ public function getTotalRowCount() * * @param int|null $total_row_count total_row_count * - * @return $this + * @return self */ public function setTotalRowCount($total_row_count) { @@ -255,7 +287,7 @@ public function getTimeframe() * * @param int[]|null $timeframe timeframe * - * @return $this + * @return self */ public function setTimeframe($timeframe) { @@ -280,18 +312,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -316,6 +348,18 @@ public function offsetUnset($offset) 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. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -328,6 +372,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/MuxPhp/Models/ListRealTimeDimensionsResponseData.php b/MuxPhp/Models/ListRealTimeDimensionsResponseData.php index bfa6b81..aa09607 100644 --- a/MuxPhp/Models/ListRealTimeDimensionsResponseData.php +++ b/MuxPhp/Models/ListRealTimeDimensionsResponseData.php @@ -1,8 +1,30 @@ + * @template TKey int|null + * @template TValue mixed|null */ -class ListRealTimeDimensionsResponseData implements ModelInterface, ArrayAccess +class ListRealTimeDimensionsResponseData implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'ListRealTimeDimensionsResponse_data'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'name' => 'string', 'display_name' => 'string' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'name' => null, 'display_name' => null @@ -158,8 +187,11 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['name'] = isset($data['name']) ? $data['name'] : null; - $this->container['display_name'] = isset($data['display_name']) ? $data['display_name'] : 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->container['name'] = $data['name'] ?? null; + $this->container['display_name'] = $data['display_name'] ?? null; } /** @@ -201,7 +233,7 @@ public function getName() * * @param string|null $name name * - * @return $this + * @return self */ public function setName($name) { @@ -225,7 +257,7 @@ public function getDisplayName() * * @param string|null $display_name display_name * - * @return $this + * @return self */ public function setDisplayName($display_name) { @@ -250,18 +282,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -286,6 +318,18 @@ public function offsetUnset($offset) 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. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -298,6 +342,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/MuxPhp/Models/ListRealTimeMetricsResponse.php b/MuxPhp/Models/ListRealTimeMetricsResponse.php index 5d0524b..03a8e2d 100644 --- a/MuxPhp/Models/ListRealTimeMetricsResponse.php +++ b/MuxPhp/Models/ListRealTimeMetricsResponse.php @@ -1,8 +1,30 @@ + * @template TKey int|null + * @template TValue mixed|null */ -class ListRealTimeMetricsResponse implements ModelInterface, ArrayAccess +class ListRealTimeMetricsResponse implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'ListRealTimeMetricsResponse'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'data' => '\MuxPhp\Models\ListRealTimeDimensionsResponseData[]', 'total_row_count' => 'int', @@ -39,10 +66,12 @@ class ListRealTimeMetricsResponse implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'data' => null, 'total_row_count' => 'int64', @@ -163,9 +192,12 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['data'] = isset($data['data']) ? $data['data'] : null; - $this->container['total_row_count'] = isset($data['total_row_count']) ? $data['total_row_count'] : null; - $this->container['timeframe'] = isset($data['timeframe']) ? $data['timeframe'] : 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->container['data'] = $data['data'] ?? null; + $this->container['total_row_count'] = $data['total_row_count'] ?? null; + $this->container['timeframe'] = $data['timeframe'] ?? null; } /** @@ -207,7 +239,7 @@ public function getData() * * @param \MuxPhp\Models\ListRealTimeDimensionsResponseData[]|null $data data * - * @return $this + * @return self */ public function setData($data) { @@ -231,7 +263,7 @@ public function getTotalRowCount() * * @param int|null $total_row_count total_row_count * - * @return $this + * @return self */ public function setTotalRowCount($total_row_count) { @@ -255,7 +287,7 @@ public function getTimeframe() * * @param int[]|null $timeframe timeframe * - * @return $this + * @return self */ public function setTimeframe($timeframe) { @@ -280,18 +312,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -316,6 +348,18 @@ public function offsetUnset($offset) 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. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -328,6 +372,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/MuxPhp/Models/ListRelatedIncidentsResponse.php b/MuxPhp/Models/ListRelatedIncidentsResponse.php index f2ab57b..e01261c 100644 --- a/MuxPhp/Models/ListRelatedIncidentsResponse.php +++ b/MuxPhp/Models/ListRelatedIncidentsResponse.php @@ -1,8 +1,30 @@ + * @template TKey int|null + * @template TValue mixed|null */ -class ListRelatedIncidentsResponse implements ModelInterface, ArrayAccess +class ListRelatedIncidentsResponse implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'ListRelatedIncidentsResponse'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'data' => '\MuxPhp\Models\Incident[]', 'total_row_count' => 'int', @@ -39,10 +66,12 @@ class ListRelatedIncidentsResponse implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'data' => null, 'total_row_count' => 'int64', @@ -163,9 +192,12 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['data'] = isset($data['data']) ? $data['data'] : null; - $this->container['total_row_count'] = isset($data['total_row_count']) ? $data['total_row_count'] : null; - $this->container['timeframe'] = isset($data['timeframe']) ? $data['timeframe'] : 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->container['data'] = $data['data'] ?? null; + $this->container['total_row_count'] = $data['total_row_count'] ?? null; + $this->container['timeframe'] = $data['timeframe'] ?? null; } /** @@ -207,7 +239,7 @@ public function getData() * * @param \MuxPhp\Models\Incident[]|null $data data * - * @return $this + * @return self */ public function setData($data) { @@ -231,7 +263,7 @@ public function getTotalRowCount() * * @param int|null $total_row_count total_row_count * - * @return $this + * @return self */ public function setTotalRowCount($total_row_count) { @@ -255,7 +287,7 @@ public function getTimeframe() * * @param int[]|null $timeframe timeframe * - * @return $this + * @return self */ public function setTimeframe($timeframe) { @@ -280,18 +312,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -316,6 +348,18 @@ public function offsetUnset($offset) 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. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -328,6 +372,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/MuxPhp/Models/ListSigningKeysResponse.php b/MuxPhp/Models/ListSigningKeysResponse.php index 1f574bc..736225f 100644 --- a/MuxPhp/Models/ListSigningKeysResponse.php +++ b/MuxPhp/Models/ListSigningKeysResponse.php @@ -1,8 +1,30 @@ + * @template TKey int|null + * @template TValue mixed|null */ -class ListSigningKeysResponse implements ModelInterface, ArrayAccess +class ListSigningKeysResponse implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'ListSigningKeysResponse'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'data' => '\MuxPhp\Models\SigningKey[]' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'data' => null ]; @@ -153,7 +182,10 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['data'] = isset($data['data']) ? $data['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->container['data'] = $data['data'] ?? null; } /** @@ -195,7 +227,7 @@ public function getData() * * @param \MuxPhp\Models\SigningKey[]|null $data data * - * @return $this + * @return self */ public function setData($data) { @@ -220,18 +252,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -256,6 +288,18 @@ public function offsetUnset($offset) 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. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -268,6 +312,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/MuxPhp/Models/ListUploadsResponse.php b/MuxPhp/Models/ListUploadsResponse.php index 8b3a283..7a473b2 100644 --- a/MuxPhp/Models/ListUploadsResponse.php +++ b/MuxPhp/Models/ListUploadsResponse.php @@ -1,8 +1,30 @@ + * @template TKey int|null + * @template TValue mixed|null */ -class ListUploadsResponse implements ModelInterface, ArrayAccess +class ListUploadsResponse implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'ListUploadsResponse'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'data' => '\MuxPhp\Models\Upload[]' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'data' => null ]; @@ -153,7 +182,10 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['data'] = isset($data['data']) ? $data['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->container['data'] = $data['data'] ?? null; } /** @@ -195,7 +227,7 @@ public function getData() * * @param \MuxPhp\Models\Upload[]|null $data data * - * @return $this + * @return self */ public function setData($data) { @@ -220,18 +252,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -256,6 +288,18 @@ public function offsetUnset($offset) 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. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -268,6 +312,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/MuxPhp/Models/ListVideoViewsResponse.php b/MuxPhp/Models/ListVideoViewsResponse.php index 3faa089..f3bd044 100644 --- a/MuxPhp/Models/ListVideoViewsResponse.php +++ b/MuxPhp/Models/ListVideoViewsResponse.php @@ -1,8 +1,30 @@ + * @template TKey int|null + * @template TValue mixed|null */ -class ListVideoViewsResponse implements ModelInterface, ArrayAccess +class ListVideoViewsResponse implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'ListVideoViewsResponse'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'data' => '\MuxPhp\Models\AbridgedVideoView[]', 'total_row_count' => 'int', @@ -39,10 +66,12 @@ class ListVideoViewsResponse implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'data' => null, 'total_row_count' => 'int64', @@ -163,9 +192,12 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['data'] = isset($data['data']) ? $data['data'] : null; - $this->container['total_row_count'] = isset($data['total_row_count']) ? $data['total_row_count'] : null; - $this->container['timeframe'] = isset($data['timeframe']) ? $data['timeframe'] : 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->container['data'] = $data['data'] ?? null; + $this->container['total_row_count'] = $data['total_row_count'] ?? null; + $this->container['timeframe'] = $data['timeframe'] ?? null; } /** @@ -207,7 +239,7 @@ public function getData() * * @param \MuxPhp\Models\AbridgedVideoView[]|null $data data * - * @return $this + * @return self */ public function setData($data) { @@ -231,7 +263,7 @@ public function getTotalRowCount() * * @param int|null $total_row_count total_row_count * - * @return $this + * @return self */ public function setTotalRowCount($total_row_count) { @@ -255,7 +287,7 @@ public function getTimeframe() * * @param int[]|null $timeframe timeframe * - * @return $this + * @return self */ public function setTimeframe($timeframe) { @@ -280,18 +312,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -316,6 +348,18 @@ public function offsetUnset($offset) 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. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -328,6 +372,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/MuxPhp/Models/LiveStream.php b/MuxPhp/Models/LiveStream.php index 5cfed2b..26dee39 100644 --- a/MuxPhp/Models/LiveStream.php +++ b/MuxPhp/Models/LiveStream.php @@ -1,8 +1,30 @@ + * @template TKey int|null + * @template TValue mixed|null */ -class LiveStream implements ModelInterface, ArrayAccess +class LiveStream implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'LiveStream'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'id' => 'string', 'created_at' => 'string', @@ -49,10 +76,12 @@ class LiveStream implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'id' => null, 'created_at' => 'int64', @@ -213,19 +242,22 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['id'] = isset($data['id']) ? $data['id'] : null; - $this->container['created_at'] = isset($data['created_at']) ? $data['created_at'] : null; - $this->container['stream_key'] = isset($data['stream_key']) ? $data['stream_key'] : null; - $this->container['active_asset_id'] = isset($data['active_asset_id']) ? $data['active_asset_id'] : null; - $this->container['recent_asset_ids'] = isset($data['recent_asset_ids']) ? $data['recent_asset_ids'] : null; - $this->container['status'] = isset($data['status']) ? $data['status'] : null; - $this->container['playback_ids'] = isset($data['playback_ids']) ? $data['playback_ids'] : null; - $this->container['new_asset_settings'] = isset($data['new_asset_settings']) ? $data['new_asset_settings'] : null; - $this->container['passthrough'] = isset($data['passthrough']) ? $data['passthrough'] : null; - $this->container['reconnect_window'] = isset($data['reconnect_window']) ? $data['reconnect_window'] : null; - $this->container['reduced_latency'] = isset($data['reduced_latency']) ? $data['reduced_latency'] : null; - $this->container['simulcast_targets'] = isset($data['simulcast_targets']) ? $data['simulcast_targets'] : null; - $this->container['test'] = isset($data['test']) ? $data['test'] : 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->container['id'] = $data['id'] ?? null; + $this->container['created_at'] = $data['created_at'] ?? null; + $this->container['stream_key'] = $data['stream_key'] ?? null; + $this->container['active_asset_id'] = $data['active_asset_id'] ?? null; + $this->container['recent_asset_ids'] = $data['recent_asset_ids'] ?? null; + $this->container['status'] = $data['status'] ?? null; + $this->container['playback_ids'] = $data['playback_ids'] ?? null; + $this->container['new_asset_settings'] = $data['new_asset_settings'] ?? null; + $this->container['passthrough'] = $data['passthrough'] ?? null; + $this->container['reconnect_window'] = $data['reconnect_window'] ?? null; + $this->container['reduced_latency'] = $data['reduced_latency'] ?? null; + $this->container['simulcast_targets'] = $data['simulcast_targets'] ?? null; + $this->container['test'] = $data['test'] ?? null; } /** @@ -267,7 +299,7 @@ public function getId() * * @param string|null $id id * - * @return $this + * @return self */ public function setId($id) { @@ -291,7 +323,7 @@ public function getCreatedAt() * * @param string|null $created_at created_at * - * @return $this + * @return self */ public function setCreatedAt($created_at) { @@ -315,7 +347,7 @@ public function getStreamKey() * * @param string|null $stream_key stream_key * - * @return $this + * @return self */ public function setStreamKey($stream_key) { @@ -339,7 +371,7 @@ public function getActiveAssetId() * * @param string|null $active_asset_id active_asset_id * - * @return $this + * @return self */ public function setActiveAssetId($active_asset_id) { @@ -363,7 +395,7 @@ public function getRecentAssetIds() * * @param string[]|null $recent_asset_ids recent_asset_ids * - * @return $this + * @return self */ public function setRecentAssetIds($recent_asset_ids) { @@ -387,7 +419,7 @@ public function getStatus() * * @param string|null $status status * - * @return $this + * @return self */ public function setStatus($status) { @@ -411,7 +443,7 @@ public function getPlaybackIds() * * @param \MuxPhp\Models\PlaybackID[]|null $playback_ids playback_ids * - * @return $this + * @return self */ public function setPlaybackIds($playback_ids) { @@ -435,7 +467,7 @@ public function getNewAssetSettings() * * @param \MuxPhp\Models\CreateAssetRequest|null $new_asset_settings new_asset_settings * - * @return $this + * @return self */ public function setNewAssetSettings($new_asset_settings) { @@ -459,7 +491,7 @@ public function getPassthrough() * * @param string|null $passthrough passthrough * - * @return $this + * @return self */ public function setPassthrough($passthrough) { @@ -483,7 +515,7 @@ public function getReconnectWindow() * * @param float|null $reconnect_window reconnect_window * - * @return $this + * @return self */ public function setReconnectWindow($reconnect_window) { @@ -507,7 +539,7 @@ public function getReducedLatency() * * @param bool|null $reduced_latency reduced_latency * - * @return $this + * @return self */ public function setReducedLatency($reduced_latency) { @@ -531,7 +563,7 @@ public function getSimulcastTargets() * * @param \MuxPhp\Models\SimulcastTarget[]|null $simulcast_targets simulcast_targets * - * @return $this + * @return self */ public function setSimulcastTargets($simulcast_targets) { @@ -555,7 +587,7 @@ public function getTest() * * @param bool|null $test test * - * @return $this + * @return self */ public function setTest($test) { @@ -580,18 +612,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -616,6 +648,18 @@ public function offsetUnset($offset) 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. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -628,6 +672,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/MuxPhp/Models/LiveStreamResponse.php b/MuxPhp/Models/LiveStreamResponse.php index 26d0efa..1c7b0a1 100644 --- a/MuxPhp/Models/LiveStreamResponse.php +++ b/MuxPhp/Models/LiveStreamResponse.php @@ -1,8 +1,30 @@ + * @template TKey int|null + * @template TValue mixed|null */ -class LiveStreamResponse implements ModelInterface, ArrayAccess +class LiveStreamResponse implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'LiveStreamResponse'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'data' => '\MuxPhp\Models\LiveStream' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'data' => null ]; @@ -153,7 +182,10 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['data'] = isset($data['data']) ? $data['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->container['data'] = $data['data'] ?? null; } /** @@ -195,7 +227,7 @@ public function getData() * * @param \MuxPhp\Models\LiveStream|null $data data * - * @return $this + * @return self */ public function setData($data) { @@ -220,18 +252,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -256,6 +288,18 @@ public function offsetUnset($offset) 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. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -268,6 +312,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/MuxPhp/Models/Metric.php b/MuxPhp/Models/Metric.php index d169ed4..0622551 100644 --- a/MuxPhp/Models/Metric.php +++ b/MuxPhp/Models/Metric.php @@ -1,8 +1,30 @@ + * @template TKey int|null + * @template TValue mixed|null */ -class Metric implements ModelInterface, ArrayAccess +class Metric implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'Metric'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'value' => 'double', 'type' => 'string', @@ -41,10 +68,12 @@ class Metric implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'value' => 'double', 'type' => null, @@ -173,11 +202,14 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['value'] = isset($data['value']) ? $data['value'] : null; - $this->container['type'] = isset($data['type']) ? $data['type'] : null; - $this->container['name'] = isset($data['name']) ? $data['name'] : null; - $this->container['metric'] = isset($data['metric']) ? $data['metric'] : null; - $this->container['measurement'] = isset($data['measurement']) ? $data['measurement'] : 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->container['value'] = $data['value'] ?? null; + $this->container['type'] = $data['type'] ?? null; + $this->container['name'] = $data['name'] ?? null; + $this->container['metric'] = $data['metric'] ?? null; + $this->container['measurement'] = $data['measurement'] ?? null; } /** @@ -219,7 +251,7 @@ public function getValue() * * @param double|null $value value * - * @return $this + * @return self */ public function setValue($value) { @@ -243,7 +275,7 @@ public function getType() * * @param string|null $type type * - * @return $this + * @return self */ public function setType($type) { @@ -267,7 +299,7 @@ public function getName() * * @param string|null $name name * - * @return $this + * @return self */ public function setName($name) { @@ -291,7 +323,7 @@ public function getMetric() * * @param string|null $metric metric * - * @return $this + * @return self */ public function setMetric($metric) { @@ -315,7 +347,7 @@ public function getMeasurement() * * @param string|null $measurement measurement * - * @return $this + * @return self */ public function setMeasurement($measurement) { @@ -340,18 +372,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -376,6 +408,18 @@ public function offsetUnset($offset) 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. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -388,6 +432,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/MuxPhp/Models/ModelInterface.php b/MuxPhp/Models/ModelInterface.php index bb548ed..1dbafb4 100644 --- a/MuxPhp/Models/ModelInterface.php +++ b/MuxPhp/Models/ModelInterface.php @@ -1,8 +1,30 @@ + * @template TKey int|null + * @template TValue mixed|null */ -class NotificationRule implements ModelInterface, ArrayAccess +class NotificationRule implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'NotificationRule'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'value' => 'string', 'name' => 'string', @@ -39,10 +66,12 @@ class NotificationRule implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'value' => null, 'name' => null, @@ -163,9 +192,12 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['value'] = isset($data['value']) ? $data['value'] : null; - $this->container['name'] = isset($data['name']) ? $data['name'] : null; - $this->container['id'] = isset($data['id']) ? $data['id'] : 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->container['value'] = $data['value'] ?? null; + $this->container['name'] = $data['name'] ?? null; + $this->container['id'] = $data['id'] ?? null; } /** @@ -207,7 +239,7 @@ public function getValue() * * @param string|null $value value * - * @return $this + * @return self */ public function setValue($value) { @@ -231,7 +263,7 @@ public function getName() * * @param string|null $name name * - * @return $this + * @return self */ public function setName($name) { @@ -255,7 +287,7 @@ public function getId() * * @param string|null $id id * - * @return $this + * @return self */ public function setId($id) { @@ -280,18 +312,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -316,6 +348,18 @@ public function offsetUnset($offset) 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. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -328,6 +372,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/MuxPhp/Models/OverallValues.php b/MuxPhp/Models/OverallValues.php index 7a218d2..9d783c8 100644 --- a/MuxPhp/Models/OverallValues.php +++ b/MuxPhp/Models/OverallValues.php @@ -1,8 +1,30 @@ + * @template TKey int|null + * @template TValue mixed|null */ -class OverallValues implements ModelInterface, ArrayAccess +class OverallValues implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'OverallValues'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'value' => 'double', 'total_watch_time' => 'int', @@ -40,10 +67,12 @@ class OverallValues implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'value' => 'double', 'total_watch_time' => 'int64', @@ -168,10 +197,13 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['value'] = isset($data['value']) ? $data['value'] : null; - $this->container['total_watch_time'] = isset($data['total_watch_time']) ? $data['total_watch_time'] : null; - $this->container['total_views'] = isset($data['total_views']) ? $data['total_views'] : null; - $this->container['global_value'] = isset($data['global_value']) ? $data['global_value'] : 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->container['value'] = $data['value'] ?? null; + $this->container['total_watch_time'] = $data['total_watch_time'] ?? null; + $this->container['total_views'] = $data['total_views'] ?? null; + $this->container['global_value'] = $data['global_value'] ?? null; } /** @@ -213,7 +245,7 @@ public function getValue() * * @param double|null $value value * - * @return $this + * @return self */ public function setValue($value) { @@ -237,7 +269,7 @@ public function getTotalWatchTime() * * @param int|null $total_watch_time total_watch_time * - * @return $this + * @return self */ public function setTotalWatchTime($total_watch_time) { @@ -261,7 +293,7 @@ public function getTotalViews() * * @param int|null $total_views total_views * - * @return $this + * @return self */ public function setTotalViews($total_views) { @@ -285,7 +317,7 @@ public function getGlobalValue() * * @param double|null $global_value global_value * - * @return $this + * @return self */ public function setGlobalValue($global_value) { @@ -310,18 +342,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -346,6 +378,18 @@ public function offsetUnset($offset) 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. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -358,6 +402,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/MuxPhp/Models/PlaybackID.php b/MuxPhp/Models/PlaybackID.php index 2983c15..fa01c95 100644 --- a/MuxPhp/Models/PlaybackID.php +++ b/MuxPhp/Models/PlaybackID.php @@ -1,8 +1,30 @@ + * @template TKey int|null + * @template TValue mixed|null */ -class PlaybackID implements ModelInterface, ArrayAccess +class PlaybackID implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'PlaybackID'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'id' => 'string', 'policy' => '\MuxPhp\Models\PlaybackPolicy' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'id' => null, 'policy' => null @@ -158,8 +187,11 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['id'] = isset($data['id']) ? $data['id'] : null; - $this->container['policy'] = isset($data['policy']) ? $data['policy'] : 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->container['id'] = $data['id'] ?? null; + $this->container['policy'] = $data['policy'] ?? null; } /** @@ -201,7 +233,7 @@ public function getId() * * @param string|null $id Unique identifier for the PlaybackID * - * @return $this + * @return self */ public function setId($id) { @@ -225,7 +257,7 @@ public function getPolicy() * * @param \MuxPhp\Models\PlaybackPolicy|null $policy policy * - * @return $this + * @return self */ public function setPolicy($policy) { @@ -250,18 +282,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -286,6 +318,18 @@ public function offsetUnset($offset) 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. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -298,6 +342,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/MuxPhp/Models/PlaybackPolicy.php b/MuxPhp/Models/PlaybackPolicy.php index d30607f..a2d5461 100644 --- a/MuxPhp/Models/PlaybackPolicy.php +++ b/MuxPhp/Models/PlaybackPolicy.php @@ -1,8 +1,30 @@ + * @template TKey int|null + * @template TValue mixed|null */ -class RealTimeBreakdownValue implements ModelInterface, ArrayAccess +class RealTimeBreakdownValue implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'RealTimeBreakdownValue'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'value' => 'string', 'negative_impact' => 'int', @@ -41,10 +68,12 @@ class RealTimeBreakdownValue implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'value' => null, 'negative_impact' => 'int64', @@ -173,11 +202,14 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['value'] = isset($data['value']) ? $data['value'] : null; - $this->container['negative_impact'] = isset($data['negative_impact']) ? $data['negative_impact'] : null; - $this->container['metric_value'] = isset($data['metric_value']) ? $data['metric_value'] : null; - $this->container['display_value'] = isset($data['display_value']) ? $data['display_value'] : null; - $this->container['concurent_viewers'] = isset($data['concurent_viewers']) ? $data['concurent_viewers'] : 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->container['value'] = $data['value'] ?? null; + $this->container['negative_impact'] = $data['negative_impact'] ?? null; + $this->container['metric_value'] = $data['metric_value'] ?? null; + $this->container['display_value'] = $data['display_value'] ?? null; + $this->container['concurent_viewers'] = $data['concurent_viewers'] ?? null; } /** @@ -219,7 +251,7 @@ public function getValue() * * @param string|null $value value * - * @return $this + * @return self */ public function setValue($value) { @@ -243,7 +275,7 @@ public function getNegativeImpact() * * @param int|null $negative_impact negative_impact * - * @return $this + * @return self */ public function setNegativeImpact($negative_impact) { @@ -267,7 +299,7 @@ public function getMetricValue() * * @param double|null $metric_value metric_value * - * @return $this + * @return self */ public function setMetricValue($metric_value) { @@ -291,7 +323,7 @@ public function getDisplayValue() * * @param string|null $display_value display_value * - * @return $this + * @return self */ public function setDisplayValue($display_value) { @@ -315,7 +347,7 @@ public function getConcurentViewers() * * @param int|null $concurent_viewers concurent_viewers * - * @return $this + * @return self */ public function setConcurentViewers($concurent_viewers) { @@ -340,18 +372,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -376,6 +408,18 @@ public function offsetUnset($offset) 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. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -388,6 +432,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/MuxPhp/Models/RealTimeHistogramTimeseriesBucket.php b/MuxPhp/Models/RealTimeHistogramTimeseriesBucket.php index 195aacd..0634b8f 100644 --- a/MuxPhp/Models/RealTimeHistogramTimeseriesBucket.php +++ b/MuxPhp/Models/RealTimeHistogramTimeseriesBucket.php @@ -1,8 +1,30 @@ + * @template TKey int|null + * @template TValue mixed|null */ -class RealTimeHistogramTimeseriesBucket implements ModelInterface, ArrayAccess +class RealTimeHistogramTimeseriesBucket implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'RealTimeHistogramTimeseriesBucket'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'start' => 'int', 'end' => 'int' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'start' => 'int64', 'end' => 'int64' @@ -158,8 +187,11 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['start'] = isset($data['start']) ? $data['start'] : null; - $this->container['end'] = isset($data['end']) ? $data['end'] : 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->container['start'] = $data['start'] ?? null; + $this->container['end'] = $data['end'] ?? null; } /** @@ -201,7 +233,7 @@ public function getStart() * * @param int|null $start start * - * @return $this + * @return self */ public function setStart($start) { @@ -225,7 +257,7 @@ public function getEnd() * * @param int|null $end end * - * @return $this + * @return self */ public function setEnd($end) { @@ -250,18 +282,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -286,6 +318,18 @@ public function offsetUnset($offset) 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. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -298,6 +342,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/MuxPhp/Models/RealTimeHistogramTimeseriesBucketValues.php b/MuxPhp/Models/RealTimeHistogramTimeseriesBucketValues.php index 1ee53a8..4a4c61c 100644 --- a/MuxPhp/Models/RealTimeHistogramTimeseriesBucketValues.php +++ b/MuxPhp/Models/RealTimeHistogramTimeseriesBucketValues.php @@ -1,8 +1,30 @@ + * @template TKey int|null + * @template TValue mixed|null */ -class RealTimeHistogramTimeseriesBucketValues implements ModelInterface, ArrayAccess +class RealTimeHistogramTimeseriesBucketValues implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'RealTimeHistogramTimeseriesBucketValues'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'percentage' => 'double', 'count' => 'int' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'percentage' => 'double', 'count' => 'int64' @@ -158,8 +187,11 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['percentage'] = isset($data['percentage']) ? $data['percentage'] : null; - $this->container['count'] = isset($data['count']) ? $data['count'] : 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->container['percentage'] = $data['percentage'] ?? null; + $this->container['count'] = $data['count'] ?? null; } /** @@ -201,7 +233,7 @@ public function getPercentage() * * @param double|null $percentage percentage * - * @return $this + * @return self */ public function setPercentage($percentage) { @@ -225,7 +257,7 @@ public function getCount() * * @param int|null $count count * - * @return $this + * @return self */ public function setCount($count) { @@ -250,18 +282,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -286,6 +318,18 @@ public function offsetUnset($offset) 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. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -298,6 +342,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/MuxPhp/Models/RealTimeHistogramTimeseriesDatapoint.php b/MuxPhp/Models/RealTimeHistogramTimeseriesDatapoint.php index cb904d4..cb0f953 100644 --- a/MuxPhp/Models/RealTimeHistogramTimeseriesDatapoint.php +++ b/MuxPhp/Models/RealTimeHistogramTimeseriesDatapoint.php @@ -1,8 +1,30 @@ + * @template TKey int|null + * @template TValue mixed|null */ -class RealTimeHistogramTimeseriesDatapoint implements ModelInterface, ArrayAccess +class RealTimeHistogramTimeseriesDatapoint implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'RealTimeHistogramTimeseriesDatapoint'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'timestamp' => 'string', 'sum' => 'int', @@ -43,10 +70,12 @@ class RealTimeHistogramTimeseriesDatapoint implements ModelInterface, ArrayAcces ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'timestamp' => null, 'sum' => 'int64', @@ -183,13 +212,16 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['timestamp'] = isset($data['timestamp']) ? $data['timestamp'] : null; - $this->container['sum'] = isset($data['sum']) ? $data['sum'] : null; - $this->container['p95'] = isset($data['p95']) ? $data['p95'] : null; - $this->container['median'] = isset($data['median']) ? $data['median'] : null; - $this->container['max_percentage'] = isset($data['max_percentage']) ? $data['max_percentage'] : null; - $this->container['bucket_values'] = isset($data['bucket_values']) ? $data['bucket_values'] : null; - $this->container['average'] = isset($data['average']) ? $data['average'] : 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->container['timestamp'] = $data['timestamp'] ?? null; + $this->container['sum'] = $data['sum'] ?? null; + $this->container['p95'] = $data['p95'] ?? null; + $this->container['median'] = $data['median'] ?? null; + $this->container['max_percentage'] = $data['max_percentage'] ?? null; + $this->container['bucket_values'] = $data['bucket_values'] ?? null; + $this->container['average'] = $data['average'] ?? null; } /** @@ -231,7 +263,7 @@ public function getTimestamp() * * @param string|null $timestamp timestamp * - * @return $this + * @return self */ public function setTimestamp($timestamp) { @@ -255,7 +287,7 @@ public function getSum() * * @param int|null $sum sum * - * @return $this + * @return self */ public function setSum($sum) { @@ -279,7 +311,7 @@ public function getP95() * * @param double|null $p95 p95 * - * @return $this + * @return self */ public function setP95($p95) { @@ -303,7 +335,7 @@ public function getMedian() * * @param double|null $median median * - * @return $this + * @return self */ public function setMedian($median) { @@ -327,7 +359,7 @@ public function getMaxPercentage() * * @param double|null $max_percentage max_percentage * - * @return $this + * @return self */ public function setMaxPercentage($max_percentage) { @@ -351,7 +383,7 @@ public function getBucketValues() * * @param \MuxPhp\Models\RealTimeHistogramTimeseriesBucketValues[]|null $bucket_values bucket_values * - * @return $this + * @return self */ public function setBucketValues($bucket_values) { @@ -375,7 +407,7 @@ public function getAverage() * * @param double|null $average average * - * @return $this + * @return self */ public function setAverage($average) { @@ -400,18 +432,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -436,6 +468,18 @@ public function offsetUnset($offset) 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. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -448,6 +492,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/MuxPhp/Models/RealTimeTimeseriesDatapoint.php b/MuxPhp/Models/RealTimeTimeseriesDatapoint.php index 63264ed..215be1f 100644 --- a/MuxPhp/Models/RealTimeTimeseriesDatapoint.php +++ b/MuxPhp/Models/RealTimeTimeseriesDatapoint.php @@ -1,8 +1,30 @@ + * @template TKey int|null + * @template TValue mixed|null */ -class RealTimeTimeseriesDatapoint implements ModelInterface, ArrayAccess +class RealTimeTimeseriesDatapoint implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'RealTimeTimeseriesDatapoint'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'value' => 'double', 'date' => 'string', @@ -39,10 +66,12 @@ class RealTimeTimeseriesDatapoint implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'value' => 'double', 'date' => null, @@ -163,9 +192,12 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['value'] = isset($data['value']) ? $data['value'] : null; - $this->container['date'] = isset($data['date']) ? $data['date'] : null; - $this->container['concurent_viewers'] = isset($data['concurent_viewers']) ? $data['concurent_viewers'] : 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->container['value'] = $data['value'] ?? null; + $this->container['date'] = $data['date'] ?? null; + $this->container['concurent_viewers'] = $data['concurent_viewers'] ?? null; } /** @@ -207,7 +239,7 @@ public function getValue() * * @param double|null $value value * - * @return $this + * @return self */ public function setValue($value) { @@ -231,7 +263,7 @@ public function getDate() * * @param string|null $date date * - * @return $this + * @return self */ public function setDate($date) { @@ -255,7 +287,7 @@ public function getConcurentViewers() * * @param int|null $concurent_viewers concurent_viewers * - * @return $this + * @return self */ public function setConcurentViewers($concurent_viewers) { @@ -280,18 +312,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -316,6 +348,18 @@ public function offsetUnset($offset) 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. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -328,6 +372,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/MuxPhp/Models/Score.php b/MuxPhp/Models/Score.php index 4e0c2ee..208e086 100644 --- a/MuxPhp/Models/Score.php +++ b/MuxPhp/Models/Score.php @@ -1,8 +1,30 @@ + * @template TKey int|null + * @template TValue mixed|null */ -class Score implements ModelInterface, ArrayAccess +class Score implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'Score'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'watch_time' => 'int', 'view_count' => 'int', @@ -42,10 +69,12 @@ class Score implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'watch_time' => 'int64', 'view_count' => 'int64', @@ -178,12 +207,15 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['watch_time'] = isset($data['watch_time']) ? $data['watch_time'] : null; - $this->container['view_count'] = isset($data['view_count']) ? $data['view_count'] : null; - $this->container['name'] = isset($data['name']) ? $data['name'] : null; - $this->container['value'] = isset($data['value']) ? $data['value'] : null; - $this->container['metric'] = isset($data['metric']) ? $data['metric'] : null; - $this->container['items'] = isset($data['items']) ? $data['items'] : 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->container['watch_time'] = $data['watch_time'] ?? null; + $this->container['view_count'] = $data['view_count'] ?? null; + $this->container['name'] = $data['name'] ?? null; + $this->container['value'] = $data['value'] ?? null; + $this->container['metric'] = $data['metric'] ?? null; + $this->container['items'] = $data['items'] ?? null; } /** @@ -225,7 +257,7 @@ public function getWatchTime() * * @param int|null $watch_time watch_time * - * @return $this + * @return self */ public function setWatchTime($watch_time) { @@ -249,7 +281,7 @@ public function getViewCount() * * @param int|null $view_count view_count * - * @return $this + * @return self */ public function setViewCount($view_count) { @@ -273,7 +305,7 @@ public function getName() * * @param string|null $name name * - * @return $this + * @return self */ public function setName($name) { @@ -297,7 +329,7 @@ public function getValue() * * @param double|null $value value * - * @return $this + * @return self */ public function setValue($value) { @@ -321,7 +353,7 @@ public function getMetric() * * @param string|null $metric metric * - * @return $this + * @return self */ public function setMetric($metric) { @@ -345,7 +377,7 @@ public function getItems() * * @param \MuxPhp\Models\Metric[]|null $items items * - * @return $this + * @return self */ public function setItems($items) { @@ -370,18 +402,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -406,6 +438,18 @@ public function offsetUnset($offset) 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. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -418,6 +462,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/MuxPhp/Models/SignalLiveStreamCompleteResponse.php b/MuxPhp/Models/SignalLiveStreamCompleteResponse.php index ae3336e..95c4dbe 100644 --- a/MuxPhp/Models/SignalLiveStreamCompleteResponse.php +++ b/MuxPhp/Models/SignalLiveStreamCompleteResponse.php @@ -1,8 +1,30 @@ + * @template TKey int|null + * @template TValue mixed|null */ -class SignalLiveStreamCompleteResponse implements ModelInterface, ArrayAccess +class SignalLiveStreamCompleteResponse implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'SignalLiveStreamCompleteResponse'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'data' => 'object' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'data' => null ]; @@ -153,7 +182,10 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['data'] = isset($data['data']) ? $data['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->container['data'] = $data['data'] ?? null; } /** @@ -195,7 +227,7 @@ public function getData() * * @param object|null $data data * - * @return $this + * @return self */ public function setData($data) { @@ -220,18 +252,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -256,6 +288,18 @@ public function offsetUnset($offset) 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. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -268,6 +312,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/MuxPhp/Models/SigningKey.php b/MuxPhp/Models/SigningKey.php index 8c82e71..b15c5ca 100644 --- a/MuxPhp/Models/SigningKey.php +++ b/MuxPhp/Models/SigningKey.php @@ -1,8 +1,30 @@ + * @template TKey int|null + * @template TValue mixed|null */ -class SigningKey implements ModelInterface, ArrayAccess +class SigningKey implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'SigningKey'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'id' => 'string', 'created_at' => 'string', @@ -39,10 +66,12 @@ class SigningKey implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'id' => null, 'created_at' => 'int64', @@ -163,9 +192,12 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['id'] = isset($data['id']) ? $data['id'] : null; - $this->container['created_at'] = isset($data['created_at']) ? $data['created_at'] : null; - $this->container['private_key'] = isset($data['private_key']) ? $data['private_key'] : 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->container['id'] = $data['id'] ?? null; + $this->container['created_at'] = $data['created_at'] ?? null; + $this->container['private_key'] = $data['private_key'] ?? null; } /** @@ -207,7 +239,7 @@ public function getId() * * @param string|null $id id * - * @return $this + * @return self */ public function setId($id) { @@ -231,7 +263,7 @@ public function getCreatedAt() * * @param string|null $created_at created_at * - * @return $this + * @return self */ public function setCreatedAt($created_at) { @@ -255,7 +287,7 @@ public function getPrivateKey() * * @param string|null $private_key private_key * - * @return $this + * @return self */ public function setPrivateKey($private_key) { @@ -280,18 +312,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -316,6 +348,18 @@ public function offsetUnset($offset) 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. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -328,6 +372,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/MuxPhp/Models/SigningKeyResponse.php b/MuxPhp/Models/SigningKeyResponse.php index 5d42a9d..a8aa93e 100644 --- a/MuxPhp/Models/SigningKeyResponse.php +++ b/MuxPhp/Models/SigningKeyResponse.php @@ -1,8 +1,30 @@ + * @template TKey int|null + * @template TValue mixed|null */ -class SigningKeyResponse implements ModelInterface, ArrayAccess +class SigningKeyResponse implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'SigningKeyResponse'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'data' => '\MuxPhp\Models\SigningKey' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'data' => null ]; @@ -153,7 +182,10 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['data'] = isset($data['data']) ? $data['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->container['data'] = $data['data'] ?? null; } /** @@ -195,7 +227,7 @@ public function getData() * * @param \MuxPhp\Models\SigningKey|null $data data * - * @return $this + * @return self */ public function setData($data) { @@ -220,18 +252,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -256,6 +288,18 @@ public function offsetUnset($offset) 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. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -268,6 +312,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/MuxPhp/Models/SimulcastTarget.php b/MuxPhp/Models/SimulcastTarget.php index 20a986c..af707cc 100644 --- a/MuxPhp/Models/SimulcastTarget.php +++ b/MuxPhp/Models/SimulcastTarget.php @@ -1,8 +1,30 @@ + * @template TKey int|null + * @template TValue mixed|null */ -class SimulcastTarget implements ModelInterface, ArrayAccess +class SimulcastTarget implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'SimulcastTarget'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'id' => 'string', 'passthrough' => 'string', @@ -41,10 +68,12 @@ class SimulcastTarget implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'id' => null, 'passthrough' => null, @@ -154,10 +183,10 @@ public function getModelName() return self::$openAPIModelName; } - const STATUS_IDLE = 'idle'; - const STATUS_STARTING = 'starting'; - const STATUS_BROADCASTING = 'broadcasting'; - const STATUS_ERRORED = 'errored'; + public const STATUS_IDLE = 'idle'; + public const STATUS_STARTING = 'starting'; + public const STATUS_BROADCASTING = 'broadcasting'; + public const STATUS_ERRORED = 'errored'; @@ -192,11 +221,14 @@ public function getStatusAllowableValues() */ public function __construct(array $data = null) { - $this->container['id'] = isset($data['id']) ? $data['id'] : null; - $this->container['passthrough'] = isset($data['passthrough']) ? $data['passthrough'] : null; - $this->container['status'] = isset($data['status']) ? $data['status'] : null; - $this->container['stream_key'] = isset($data['stream_key']) ? $data['stream_key'] : null; - $this->container['url'] = isset($data['url']) ? $data['url'] : 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->container['id'] = $data['id'] ?? null; + $this->container['passthrough'] = $data['passthrough'] ?? null; + $this->container['status'] = $data['status'] ?? null; + $this->container['stream_key'] = $data['stream_key'] ?? null; + $this->container['url'] = $data['url'] ?? null; } /** @@ -211,7 +243,8 @@ public function listInvalidProperties() $allowedValues = $this->getStatusAllowableValues(); if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) { $invalidProperties[] = sprintf( - "invalid value for 'status', must be one of '%s'", + "invalid value '%s' for 'status', must be one of '%s'", + $this->container['status'], implode("', '", $allowedValues) ); } @@ -246,7 +279,7 @@ public function getId() * * @param string|null $id ID of the Simulcast Target * - * @return $this + * @return self */ public function setId($id) { @@ -270,7 +303,7 @@ public function getPassthrough() * * @param string|null $passthrough Arbitrary Metadata set when creating a simulcast target. * - * @return $this + * @return self */ public function setPassthrough($passthrough) { @@ -294,7 +327,7 @@ public function getStatus() * * @param string|null $status The current status of the simulcast target. See Statuses below for detailed description. * `idle`: Default status. When the parent live stream is in disconnected status, simulcast targets will be idle state. * `starting`: The simulcast target transitions into this state when the parent live stream transition into connected state. * `broadcasting`: The simulcast target has successfully connected to the third party live streaming service and is pushing video to that service. * `errored`: The simulcast target encountered an error either while attempting to connect to the third party live streaming service, or mid-broadcasting. Compared to other errored statuses in the Mux Video API, a simulcast may transition back into the broadcasting state if a connection with the service can be re-established. * - * @return $this + * @return self */ public function setStatus($status) { @@ -302,7 +335,8 @@ public function setStatus($status) if (!is_null($status) && !in_array($status, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( - "Invalid value for 'status', must be one of '%s'", + "Invalid value '%s' for 'status', must be one of '%s'", + $status, implode("', '", $allowedValues) ) ); @@ -327,7 +361,7 @@ public function getStreamKey() * * @param string|null $stream_key Stream Key represents an stream identifier for the third party live streaming service to simulcast the parent live stream too. * - * @return $this + * @return self */ public function setStreamKey($stream_key) { @@ -351,7 +385,7 @@ public function getUrl() * * @param string|null $url RTMP hostname including the application name for the third party live streaming service. * - * @return $this + * @return self */ public function setUrl($url) { @@ -376,18 +410,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -412,6 +446,18 @@ public function offsetUnset($offset) 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. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -424,6 +470,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/MuxPhp/Models/SimulcastTargetResponse.php b/MuxPhp/Models/SimulcastTargetResponse.php index 2f0fa5a..2a77309 100644 --- a/MuxPhp/Models/SimulcastTargetResponse.php +++ b/MuxPhp/Models/SimulcastTargetResponse.php @@ -1,8 +1,30 @@ + * @template TKey int|null + * @template TValue mixed|null */ -class SimulcastTargetResponse implements ModelInterface, ArrayAccess +class SimulcastTargetResponse implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'SimulcastTargetResponse'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'data' => '\MuxPhp\Models\SimulcastTarget' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'data' => null ]; @@ -153,7 +182,10 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['data'] = isset($data['data']) ? $data['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->container['data'] = $data['data'] ?? null; } /** @@ -195,7 +227,7 @@ public function getData() * * @param \MuxPhp\Models\SimulcastTarget|null $data data * - * @return $this + * @return self */ public function setData($data) { @@ -220,18 +252,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -256,6 +288,18 @@ public function offsetUnset($offset) 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. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -268,6 +312,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/MuxPhp/Models/Track.php b/MuxPhp/Models/Track.php index 9376006..db89ede 100644 --- a/MuxPhp/Models/Track.php +++ b/MuxPhp/Models/Track.php @@ -1,8 +1,30 @@ + * @template TKey int|null + * @template TValue mixed|null */ -class Track implements ModelInterface, ArrayAccess +class Track implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'Track'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'id' => 'string', 'type' => 'string', @@ -49,10 +76,12 @@ class Track implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'id' => null, 'type' => null, @@ -194,14 +223,14 @@ public function getModelName() return self::$openAPIModelName; } - const TYPE_VIDEO = 'video'; - const TYPE_AUDIO = 'audio'; - const TYPE_TEXT = 'text'; - const MAX_CHANNEL_LAYOUT_MONO = 'mono'; - const MAX_CHANNEL_LAYOUT_STEREO = 'stereo'; - const MAX_CHANNEL_LAYOUT__52 = '5.2'; - const MAX_CHANNEL_LAYOUT__71 = '7.1'; - const TEXT_TYPE_SUBTITLES = 'subtitles'; + public const TYPE_VIDEO = 'video'; + public const TYPE_AUDIO = 'audio'; + public const TYPE_TEXT = 'text'; + public const MAX_CHANNEL_LAYOUT_MONO = 'mono'; + public const MAX_CHANNEL_LAYOUT_STEREO = 'stereo'; + public const MAX_CHANNEL_LAYOUT__5_2 = '5.2'; + public const MAX_CHANNEL_LAYOUT__7_1 = '7.1'; + public const TEXT_TYPE_SUBTITLES = 'subtitles'; @@ -229,8 +258,8 @@ public function getMaxChannelLayoutAllowableValues() return [ self::MAX_CHANNEL_LAYOUT_MONO, self::MAX_CHANNEL_LAYOUT_STEREO, - self::MAX_CHANNEL_LAYOUT__52, - self::MAX_CHANNEL_LAYOUT__71, + self::MAX_CHANNEL_LAYOUT__5_2, + self::MAX_CHANNEL_LAYOUT__7_1, ]; } @@ -262,19 +291,22 @@ public function getTextTypeAllowableValues() */ public function __construct(array $data = null) { - $this->container['id'] = isset($data['id']) ? $data['id'] : null; - $this->container['type'] = isset($data['type']) ? $data['type'] : null; - $this->container['duration'] = isset($data['duration']) ? $data['duration'] : null; - $this->container['max_width'] = isset($data['max_width']) ? $data['max_width'] : null; - $this->container['max_height'] = isset($data['max_height']) ? $data['max_height'] : null; - $this->container['max_frame_rate'] = isset($data['max_frame_rate']) ? $data['max_frame_rate'] : null; - $this->container['max_channels'] = isset($data['max_channels']) ? $data['max_channels'] : null; - $this->container['max_channel_layout'] = isset($data['max_channel_layout']) ? $data['max_channel_layout'] : null; - $this->container['text_type'] = isset($data['text_type']) ? $data['text_type'] : null; - $this->container['language_code'] = isset($data['language_code']) ? $data['language_code'] : null; - $this->container['name'] = isset($data['name']) ? $data['name'] : null; - $this->container['closed_captions'] = isset($data['closed_captions']) ? $data['closed_captions'] : null; - $this->container['passthrough'] = isset($data['passthrough']) ? $data['passthrough'] : 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->container['id'] = $data['id'] ?? null; + $this->container['type'] = $data['type'] ?? null; + $this->container['duration'] = $data['duration'] ?? null; + $this->container['max_width'] = $data['max_width'] ?? null; + $this->container['max_height'] = $data['max_height'] ?? null; + $this->container['max_frame_rate'] = $data['max_frame_rate'] ?? null; + $this->container['max_channels'] = $data['max_channels'] ?? null; + $this->container['max_channel_layout'] = $data['max_channel_layout'] ?? null; + $this->container['text_type'] = $data['text_type'] ?? null; + $this->container['language_code'] = $data['language_code'] ?? null; + $this->container['name'] = $data['name'] ?? null; + $this->container['closed_captions'] = $data['closed_captions'] ?? null; + $this->container['passthrough'] = $data['passthrough'] ?? null; } /** @@ -289,7 +321,8 @@ public function listInvalidProperties() $allowedValues = $this->getTypeAllowableValues(); if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { $invalidProperties[] = sprintf( - "invalid value for 'type', must be one of '%s'", + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], implode("', '", $allowedValues) ); } @@ -297,7 +330,8 @@ public function listInvalidProperties() $allowedValues = $this->getMaxChannelLayoutAllowableValues(); if (!is_null($this->container['max_channel_layout']) && !in_array($this->container['max_channel_layout'], $allowedValues, true)) { $invalidProperties[] = sprintf( - "invalid value for 'max_channel_layout', must be one of '%s'", + "invalid value '%s' for 'max_channel_layout', must be one of '%s'", + $this->container['max_channel_layout'], implode("', '", $allowedValues) ); } @@ -305,7 +339,8 @@ public function listInvalidProperties() $allowedValues = $this->getTextTypeAllowableValues(); if (!is_null($this->container['text_type']) && !in_array($this->container['text_type'], $allowedValues, true)) { $invalidProperties[] = sprintf( - "invalid value for 'text_type', must be one of '%s'", + "invalid value '%s' for 'text_type', must be one of '%s'", + $this->container['text_type'], implode("', '", $allowedValues) ); } @@ -340,7 +375,7 @@ public function getId() * * @param string|null $id Unique identifier for the Track * - * @return $this + * @return self */ public function setId($id) { @@ -364,7 +399,7 @@ public function getType() * * @param string|null $type The type of track * - * @return $this + * @return self */ public function setType($type) { @@ -372,7 +407,8 @@ public function setType($type) if (!is_null($type) && !in_array($type, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( - "Invalid value for 'type', must be one of '%s'", + "Invalid value '%s' for 'type', must be one of '%s'", + $type, implode("', '", $allowedValues) ) ); @@ -397,7 +433,7 @@ public function getDuration() * * @param double|null $duration The duration in seconds of the track media. This parameter is not set for the `text` type track. This field is optional and may not be set. The top level `duration` field of an asset will always be set. * - * @return $this + * @return self */ public function setDuration($duration) { @@ -421,7 +457,7 @@ public function getMaxWidth() * * @param int|null $max_width The maximum width in pixels available for the track. Only set for the `video` type track. * - * @return $this + * @return self */ public function setMaxWidth($max_width) { @@ -445,7 +481,7 @@ public function getMaxHeight() * * @param int|null $max_height The maximum height in pixels available for the track. Only set for the `video` type track. * - * @return $this + * @return self */ public function setMaxHeight($max_height) { @@ -469,7 +505,7 @@ public function getMaxFrameRate() * * @param double|null $max_frame_rate The maximum frame rate available for the track. Only set for the `video` type track. This field may return `-1` if the frame rate of the input cannot be reliably determined. * - * @return $this + * @return self */ public function setMaxFrameRate($max_frame_rate) { @@ -493,7 +529,7 @@ public function getMaxChannels() * * @param int|null $max_channels The maximum number of audio channels the track supports. Only set for the `audio` type track. * - * @return $this + * @return self */ public function setMaxChannels($max_channels) { @@ -517,7 +553,7 @@ public function getMaxChannelLayout() * * @param string|null $max_channel_layout Only set for the `audio` type track. * - * @return $this + * @return self */ public function setMaxChannelLayout($max_channel_layout) { @@ -525,7 +561,8 @@ public function setMaxChannelLayout($max_channel_layout) if (!is_null($max_channel_layout) && !in_array($max_channel_layout, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( - "Invalid value for 'max_channel_layout', must be one of '%s'", + "Invalid value '%s' for 'max_channel_layout', must be one of '%s'", + $max_channel_layout, implode("', '", $allowedValues) ) ); @@ -550,7 +587,7 @@ public function getTextType() * * @param string|null $text_type This parameter is set only for the `text` type track. * - * @return $this + * @return self */ public function setTextType($text_type) { @@ -558,7 +595,8 @@ public function setTextType($text_type) if (!is_null($text_type) && !in_array($text_type, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( - "Invalid value for 'text_type', must be one of '%s'", + "Invalid value '%s' for 'text_type', must be one of '%s'", + $text_type, implode("', '", $allowedValues) ) ); @@ -583,7 +621,7 @@ public function getLanguageCode() * * @param string|null $language_code The language code value represents [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 set for `text` type and `subtitles` text type track. * - * @return $this + * @return self */ public function setLanguageCode($language_code) { @@ -607,7 +645,7 @@ public function getName() * * @param string|null $name The name of the track containing a human-readable description. The hls manifest will associate a subtitle text track with this value. For example, the value is \"English\" for subtitles text track for the `language_code` value of `en-US`. This parameter is set for the `text` type and `subtitles` text type track. * - * @return $this + * @return self */ public function setName($name) { @@ -631,7 +669,7 @@ public function getClosedCaptions() * * @param bool|null $closed_captions Indicates the track provides Subtitles for the Deaf or Hard-of-hearing (SDH). This parameter is set for the `text` type and `subtitles` text type track. * - * @return $this + * @return self */ public function setClosedCaptions($closed_captions) { @@ -655,7 +693,7 @@ public function getPassthrough() * * @param string|null $passthrough Arbitrary metadata set for the track either when creating the asset or track. This parameter is set for `text` type and `subtitles` text type track. Max 255 characters. * - * @return $this + * @return self */ public function setPassthrough($passthrough) { @@ -680,18 +718,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -716,6 +754,18 @@ public function offsetUnset($offset) 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. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -728,6 +778,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/MuxPhp/Models/UpdateAssetMP4SupportRequest.php b/MuxPhp/Models/UpdateAssetMP4SupportRequest.php index be208eb..a1824e4 100644 --- a/MuxPhp/Models/UpdateAssetMP4SupportRequest.php +++ b/MuxPhp/Models/UpdateAssetMP4SupportRequest.php @@ -1,8 +1,30 @@ + * @template TKey int|null + * @template TValue mixed|null */ -class UpdateAssetMP4SupportRequest implements ModelInterface, ArrayAccess +class UpdateAssetMP4SupportRequest implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'UpdateAssetMP4SupportRequest'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'mp4_support' => 'string' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'mp4_support' => null ]; @@ -134,8 +163,8 @@ public function getModelName() return self::$openAPIModelName; } - const MP4_SUPPORT_STANDARD = 'standard'; - const MP4_SUPPORT_NONE = 'none'; + public const MP4_SUPPORT_STANDARD = 'standard'; + public const MP4_SUPPORT_NONE = 'none'; @@ -168,7 +197,10 @@ public function getMp4SupportAllowableValues() */ public function __construct(array $data = null) { - $this->container['mp4_support'] = isset($data['mp4_support']) ? $data['mp4_support'] : 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->container['mp4_support'] = $data['mp4_support'] ?? null; } /** @@ -183,7 +215,8 @@ public function listInvalidProperties() $allowedValues = $this->getMp4SupportAllowableValues(); if (!is_null($this->container['mp4_support']) && !in_array($this->container['mp4_support'], $allowedValues, true)) { $invalidProperties[] = sprintf( - "invalid value for 'mp4_support', must be one of '%s'", + "invalid value '%s' for 'mp4_support', must be one of '%s'", + $this->container['mp4_support'], implode("', '", $allowedValues) ); } @@ -218,7 +251,7 @@ public function getMp4Support() * * @param string|null $mp4_support String value for the level of mp4 support * - * @return $this + * @return self */ public function setMp4Support($mp4_support) { @@ -226,7 +259,8 @@ public function setMp4Support($mp4_support) if (!is_null($mp4_support) && !in_array($mp4_support, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( - "Invalid value for 'mp4_support', must be one of '%s'", + "Invalid value '%s' for 'mp4_support', must be one of '%s'", + $mp4_support, implode("', '", $allowedValues) ) ); @@ -252,18 +286,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -288,6 +322,18 @@ public function offsetUnset($offset) 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. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -300,6 +346,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/MuxPhp/Models/UpdateAssetMasterAccessRequest.php b/MuxPhp/Models/UpdateAssetMasterAccessRequest.php index e8b5643..111530f 100644 --- a/MuxPhp/Models/UpdateAssetMasterAccessRequest.php +++ b/MuxPhp/Models/UpdateAssetMasterAccessRequest.php @@ -1,8 +1,30 @@ + * @template TKey int|null + * @template TValue mixed|null */ -class UpdateAssetMasterAccessRequest implements ModelInterface, ArrayAccess +class UpdateAssetMasterAccessRequest implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'UpdateAssetMasterAccessRequest'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'master_access' => 'string' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'master_access' => null ]; @@ -134,8 +163,8 @@ public function getModelName() return self::$openAPIModelName; } - const MASTER_ACCESS_TEMPORARY = 'temporary'; - const MASTER_ACCESS_NONE = 'none'; + public const MASTER_ACCESS_TEMPORARY = 'temporary'; + public const MASTER_ACCESS_NONE = 'none'; @@ -168,7 +197,10 @@ public function getMasterAccessAllowableValues() */ public function __construct(array $data = null) { - $this->container['master_access'] = isset($data['master_access']) ? $data['master_access'] : 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->container['master_access'] = $data['master_access'] ?? null; } /** @@ -183,7 +215,8 @@ public function listInvalidProperties() $allowedValues = $this->getMasterAccessAllowableValues(); if (!is_null($this->container['master_access']) && !in_array($this->container['master_access'], $allowedValues, true)) { $invalidProperties[] = sprintf( - "invalid value for 'master_access', must be one of '%s'", + "invalid value '%s' for 'master_access', must be one of '%s'", + $this->container['master_access'], implode("', '", $allowedValues) ); } @@ -218,7 +251,7 @@ public function getMasterAccess() * * @param string|null $master_access Add or remove access to the master version of the video. * - * @return $this + * @return self */ public function setMasterAccess($master_access) { @@ -226,7 +259,8 @@ public function setMasterAccess($master_access) if (!is_null($master_access) && !in_array($master_access, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( - "Invalid value for 'master_access', must be one of '%s'", + "Invalid value '%s' for 'master_access', must be one of '%s'", + $master_access, implode("', '", $allowedValues) ) ); @@ -252,18 +286,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -288,6 +322,18 @@ public function offsetUnset($offset) 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. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -300,6 +346,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/MuxPhp/Models/Upload.php b/MuxPhp/Models/Upload.php index bfa247f..dbf678e 100644 --- a/MuxPhp/Models/Upload.php +++ b/MuxPhp/Models/Upload.php @@ -1,8 +1,30 @@ + * @template TKey int|null + * @template TValue mixed|null */ -class Upload implements ModelInterface, ArrayAccess +class Upload implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'Upload'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'id' => 'string', 'timeout' => 'int', @@ -45,10 +72,12 @@ class Upload implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'id' => null, 'timeout' => 'int32', @@ -174,11 +203,11 @@ public function getModelName() return self::$openAPIModelName; } - const STATUS_WAITING = 'waiting'; - const STATUS_ASSET_CREATED = 'asset_created'; - const STATUS_ERRORED = 'errored'; - const STATUS_CANCELLED = 'cancelled'; - const STATUS_TIMED_OUT = 'timed_out'; + public const STATUS_WAITING = 'waiting'; + public const STATUS_ASSET_CREATED = 'asset_created'; + public const STATUS_ERRORED = 'errored'; + public const STATUS_CANCELLED = 'cancelled'; + public const STATUS_TIMED_OUT = 'timed_out'; @@ -214,15 +243,18 @@ public function getStatusAllowableValues() */ public function __construct(array $data = null) { - $this->container['id'] = isset($data['id']) ? $data['id'] : null; - $this->container['timeout'] = isset($data['timeout']) ? $data['timeout'] : 3600; - $this->container['status'] = isset($data['status']) ? $data['status'] : null; - $this->container['new_asset_settings'] = isset($data['new_asset_settings']) ? $data['new_asset_settings'] : null; - $this->container['asset_id'] = isset($data['asset_id']) ? $data['asset_id'] : null; - $this->container['error'] = isset($data['error']) ? $data['error'] : null; - $this->container['cors_origin'] = isset($data['cors_origin']) ? $data['cors_origin'] : null; - $this->container['url'] = isset($data['url']) ? $data['url'] : null; - $this->container['test'] = isset($data['test']) ? $data['test'] : 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->container['id'] = $data['id'] ?? null; + $this->container['timeout'] = $data['timeout'] ?? 3600; + $this->container['status'] = $data['status'] ?? null; + $this->container['new_asset_settings'] = $data['new_asset_settings'] ?? null; + $this->container['asset_id'] = $data['asset_id'] ?? null; + $this->container['error'] = $data['error'] ?? null; + $this->container['cors_origin'] = $data['cors_origin'] ?? null; + $this->container['url'] = $data['url'] ?? null; + $this->container['test'] = $data['test'] ?? null; } /** @@ -245,7 +277,8 @@ public function listInvalidProperties() $allowedValues = $this->getStatusAllowableValues(); if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) { $invalidProperties[] = sprintf( - "invalid value for 'status', must be one of '%s'", + "invalid value '%s' for 'status', must be one of '%s'", + $this->container['status'], implode("', '", $allowedValues) ); } @@ -280,7 +313,7 @@ public function getId() * * @param string|null $id id * - * @return $this + * @return self */ public function setId($id) { @@ -304,7 +337,7 @@ public function getTimeout() * * @param int|null $timeout Max time in seconds for the signed upload URL to be valid. If a successful upload has not occurred before the timeout limit, the direct upload is marked `timed_out` * - * @return $this + * @return self */ public function setTimeout($timeout) { @@ -336,7 +369,7 @@ public function getStatus() * * @param string|null $status status * - * @return $this + * @return self */ public function setStatus($status) { @@ -344,7 +377,8 @@ public function setStatus($status) if (!is_null($status) && !in_array($status, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( - "Invalid value for 'status', must be one of '%s'", + "Invalid value '%s' for 'status', must be one of '%s'", + $status, implode("', '", $allowedValues) ) ); @@ -369,7 +403,7 @@ public function getNewAssetSettings() * * @param \MuxPhp\Models\Asset|null $new_asset_settings new_asset_settings * - * @return $this + * @return self */ public function setNewAssetSettings($new_asset_settings) { @@ -393,7 +427,7 @@ public function getAssetId() * * @param string|null $asset_id Only set once the upload is in the `asset_created` state. * - * @return $this + * @return self */ public function setAssetId($asset_id) { @@ -417,7 +451,7 @@ public function getError() * * @param \MuxPhp\Models\UploadError|null $error error * - * @return $this + * @return self */ public function setError($error) { @@ -441,7 +475,7 @@ public function getCorsOrigin() * * @param string|null $cors_origin If the upload URL will be used in a browser, you must specify the origin in order for the signed URL to have the correct CORS headers. * - * @return $this + * @return self */ public function setCorsOrigin($cors_origin) { @@ -465,7 +499,7 @@ public function getUrl() * * @param string|null $url The URL to upload the associated source media to. * - * @return $this + * @return self */ public function setUrl($url) { @@ -489,7 +523,7 @@ public function getTest() * * @param bool|null $test test * - * @return $this + * @return self */ public function setTest($test) { @@ -514,18 +548,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -550,6 +584,18 @@ public function offsetUnset($offset) 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. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -562,6 +608,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/MuxPhp/Models/UploadError.php b/MuxPhp/Models/UploadError.php index 86d3ecd..0a72de9 100644 --- a/MuxPhp/Models/UploadError.php +++ b/MuxPhp/Models/UploadError.php @@ -1,8 +1,30 @@ + * @template TKey int|null + * @template TValue mixed|null */ -class UploadError implements ModelInterface, ArrayAccess +class UploadError implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'Upload_error'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'type' => 'string', 'message' => 'string' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'type' => null, 'message' => null @@ -159,8 +188,11 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['type'] = isset($data['type']) ? $data['type'] : null; - $this->container['message'] = isset($data['message']) ? $data['message'] : 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->container['type'] = $data['type'] ?? null; + $this->container['message'] = $data['message'] ?? null; } /** @@ -202,7 +234,7 @@ public function getType() * * @param string|null $type type * - * @return $this + * @return self */ public function setType($type) { @@ -226,7 +258,7 @@ public function getMessage() * * @param string|null $message message * - * @return $this + * @return self */ public function setMessage($message) { @@ -251,18 +283,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -287,6 +319,18 @@ public function offsetUnset($offset) 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. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -299,6 +343,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/MuxPhp/Models/UploadResponse.php b/MuxPhp/Models/UploadResponse.php index 2249953..cb03294 100644 --- a/MuxPhp/Models/UploadResponse.php +++ b/MuxPhp/Models/UploadResponse.php @@ -1,8 +1,30 @@ + * @template TKey int|null + * @template TValue mixed|null */ -class UploadResponse implements ModelInterface, ArrayAccess +class UploadResponse implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'UploadResponse'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'data' => '\MuxPhp\Models\Upload' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'data' => null ]; @@ -153,7 +182,10 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['data'] = isset($data['data']) ? $data['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->container['data'] = $data['data'] ?? null; } /** @@ -195,7 +227,7 @@ public function getData() * * @param \MuxPhp\Models\Upload|null $data data * - * @return $this + * @return self */ public function setData($data) { @@ -220,18 +252,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -256,6 +288,18 @@ public function offsetUnset($offset) 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. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -268,6 +312,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/MuxPhp/Models/VideoView.php b/MuxPhp/Models/VideoView.php index f5e3b79..1969d95 100644 --- a/MuxPhp/Models/VideoView.php +++ b/MuxPhp/Models/VideoView.php @@ -1,8 +1,30 @@ + * @template TKey int|null + * @template TValue mixed|null */ -class VideoView implements ModelInterface, ArrayAccess +class VideoView implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'VideoView'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'view_total_upscaling' => 'string', 'preroll_ad_asset_hostname' => 'string', @@ -148,10 +175,12 @@ class VideoView implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'view_total_upscaling' => null, 'preroll_ad_asset_hostname' => null, @@ -708,118 +737,121 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['view_total_upscaling'] = isset($data['view_total_upscaling']) ? $data['view_total_upscaling'] : null; - $this->container['preroll_ad_asset_hostname'] = isset($data['preroll_ad_asset_hostname']) ? $data['preroll_ad_asset_hostname'] : null; - $this->container['player_source_domain'] = isset($data['player_source_domain']) ? $data['player_source_domain'] : null; - $this->container['region'] = isset($data['region']) ? $data['region'] : null; - $this->container['viewer_user_agent'] = isset($data['viewer_user_agent']) ? $data['viewer_user_agent'] : null; - $this->container['preroll_requested'] = isset($data['preroll_requested']) ? $data['preroll_requested'] : null; - $this->container['page_type'] = isset($data['page_type']) ? $data['page_type'] : null; - $this->container['startup_score'] = isset($data['startup_score']) ? $data['startup_score'] : null; - $this->container['view_seek_duration'] = isset($data['view_seek_duration']) ? $data['view_seek_duration'] : null; - $this->container['country_name'] = isset($data['country_name']) ? $data['country_name'] : null; - $this->container['player_source_height'] = isset($data['player_source_height']) ? $data['player_source_height'] : null; - $this->container['longitude'] = isset($data['longitude']) ? $data['longitude'] : null; - $this->container['buffering_count'] = isset($data['buffering_count']) ? $data['buffering_count'] : null; - $this->container['video_duration'] = isset($data['video_duration']) ? $data['video_duration'] : null; - $this->container['player_source_type'] = isset($data['player_source_type']) ? $data['player_source_type'] : null; - $this->container['city'] = isset($data['city']) ? $data['city'] : null; - $this->container['view_id'] = isset($data['view_id']) ? $data['view_id'] : null; - $this->container['platform_description'] = isset($data['platform_description']) ? $data['platform_description'] : null; - $this->container['video_startup_preroll_request_time'] = isset($data['video_startup_preroll_request_time']) ? $data['video_startup_preroll_request_time'] : null; - $this->container['viewer_device_name'] = isset($data['viewer_device_name']) ? $data['viewer_device_name'] : null; - $this->container['video_series'] = isset($data['video_series']) ? $data['video_series'] : null; - $this->container['viewer_application_name'] = isset($data['viewer_application_name']) ? $data['viewer_application_name'] : null; - $this->container['updated_at'] = isset($data['updated_at']) ? $data['updated_at'] : null; - $this->container['view_total_content_playback_time'] = isset($data['view_total_content_playback_time']) ? $data['view_total_content_playback_time'] : null; - $this->container['cdn'] = isset($data['cdn']) ? $data['cdn'] : null; - $this->container['player_instance_id'] = isset($data['player_instance_id']) ? $data['player_instance_id'] : null; - $this->container['video_language'] = isset($data['video_language']) ? $data['video_language'] : null; - $this->container['player_source_width'] = isset($data['player_source_width']) ? $data['player_source_width'] : null; - $this->container['player_error_message'] = isset($data['player_error_message']) ? $data['player_error_message'] : null; - $this->container['player_mux_plugin_version'] = isset($data['player_mux_plugin_version']) ? $data['player_mux_plugin_version'] : null; - $this->container['watched'] = isset($data['watched']) ? $data['watched'] : null; - $this->container['playback_score'] = isset($data['playback_score']) ? $data['playback_score'] : null; - $this->container['page_url'] = isset($data['page_url']) ? $data['page_url'] : null; - $this->container['metro'] = isset($data['metro']) ? $data['metro'] : null; - $this->container['view_max_request_latency'] = isset($data['view_max_request_latency']) ? $data['view_max_request_latency'] : null; - $this->container['requests_for_first_preroll'] = isset($data['requests_for_first_preroll']) ? $data['requests_for_first_preroll'] : null; - $this->container['view_total_downscaling'] = isset($data['view_total_downscaling']) ? $data['view_total_downscaling'] : null; - $this->container['latitude'] = isset($data['latitude']) ? $data['latitude'] : null; - $this->container['player_source_host_name'] = isset($data['player_source_host_name']) ? $data['player_source_host_name'] : null; - $this->container['inserted_at'] = isset($data['inserted_at']) ? $data['inserted_at'] : null; - $this->container['view_end'] = isset($data['view_end']) ? $data['view_end'] : null; - $this->container['mux_embed_version'] = isset($data['mux_embed_version']) ? $data['mux_embed_version'] : null; - $this->container['player_language'] = isset($data['player_language']) ? $data['player_language'] : null; - $this->container['page_load_time'] = isset($data['page_load_time']) ? $data['page_load_time'] : null; - $this->container['viewer_device_category'] = isset($data['viewer_device_category']) ? $data['viewer_device_category'] : null; - $this->container['video_startup_preroll_load_time'] = isset($data['video_startup_preroll_load_time']) ? $data['video_startup_preroll_load_time'] : null; - $this->container['player_version'] = isset($data['player_version']) ? $data['player_version'] : null; - $this->container['watch_time'] = isset($data['watch_time']) ? $data['watch_time'] : null; - $this->container['player_source_stream_type'] = isset($data['player_source_stream_type']) ? $data['player_source_stream_type'] : null; - $this->container['preroll_ad_tag_hostname'] = isset($data['preroll_ad_tag_hostname']) ? $data['preroll_ad_tag_hostname'] : null; - $this->container['viewer_device_manufacturer'] = isset($data['viewer_device_manufacturer']) ? $data['viewer_device_manufacturer'] : null; - $this->container['rebuffering_score'] = isset($data['rebuffering_score']) ? $data['rebuffering_score'] : null; - $this->container['experiment_name'] = isset($data['experiment_name']) ? $data['experiment_name'] : null; - $this->container['viewer_os_version'] = isset($data['viewer_os_version']) ? $data['viewer_os_version'] : null; - $this->container['player_preload'] = isset($data['player_preload']) ? $data['player_preload'] : null; - $this->container['buffering_duration'] = isset($data['buffering_duration']) ? $data['buffering_duration'] : null; - $this->container['player_view_count'] = isset($data['player_view_count']) ? $data['player_view_count'] : null; - $this->container['player_software'] = isset($data['player_software']) ? $data['player_software'] : null; - $this->container['player_load_time'] = isset($data['player_load_time']) ? $data['player_load_time'] : null; - $this->container['platform_summary'] = isset($data['platform_summary']) ? $data['platform_summary'] : null; - $this->container['video_encoding_variant'] = isset($data['video_encoding_variant']) ? $data['video_encoding_variant'] : null; - $this->container['player_width'] = isset($data['player_width']) ? $data['player_width'] : null; - $this->container['view_seek_count'] = isset($data['view_seek_count']) ? $data['view_seek_count'] : null; - $this->container['viewer_experience_score'] = isset($data['viewer_experience_score']) ? $data['viewer_experience_score'] : null; - $this->container['view_error_id'] = isset($data['view_error_id']) ? $data['view_error_id'] : null; - $this->container['video_variant_name'] = isset($data['video_variant_name']) ? $data['video_variant_name'] : null; - $this->container['preroll_played'] = isset($data['preroll_played']) ? $data['preroll_played'] : null; - $this->container['viewer_application_engine'] = isset($data['viewer_application_engine']) ? $data['viewer_application_engine'] : null; - $this->container['viewer_os_architecture'] = isset($data['viewer_os_architecture']) ? $data['viewer_os_architecture'] : null; - $this->container['player_error_code'] = isset($data['player_error_code']) ? $data['player_error_code'] : null; - $this->container['buffering_rate'] = isset($data['buffering_rate']) ? $data['buffering_rate'] : null; - $this->container['events'] = isset($data['events']) ? $data['events'] : null; - $this->container['player_name'] = isset($data['player_name']) ? $data['player_name'] : null; - $this->container['view_start'] = isset($data['view_start']) ? $data['view_start'] : null; - $this->container['view_average_request_throughput'] = isset($data['view_average_request_throughput']) ? $data['view_average_request_throughput'] : null; - $this->container['video_producer'] = isset($data['video_producer']) ? $data['video_producer'] : null; - $this->container['error_type_id'] = isset($data['error_type_id']) ? $data['error_type_id'] : null; - $this->container['mux_viewer_id'] = isset($data['mux_viewer_id']) ? $data['mux_viewer_id'] : null; - $this->container['video_id'] = isset($data['video_id']) ? $data['video_id'] : null; - $this->container['continent_code'] = isset($data['continent_code']) ? $data['continent_code'] : null; - $this->container['session_id'] = isset($data['session_id']) ? $data['session_id'] : null; - $this->container['exit_before_video_start'] = isset($data['exit_before_video_start']) ? $data['exit_before_video_start'] : null; - $this->container['video_content_type'] = isset($data['video_content_type']) ? $data['video_content_type'] : null; - $this->container['viewer_os_family'] = isset($data['viewer_os_family']) ? $data['viewer_os_family'] : null; - $this->container['player_poster'] = isset($data['player_poster']) ? $data['player_poster'] : null; - $this->container['view_average_request_latency'] = isset($data['view_average_request_latency']) ? $data['view_average_request_latency'] : null; - $this->container['video_variant_id'] = isset($data['video_variant_id']) ? $data['video_variant_id'] : null; - $this->container['player_source_duration'] = isset($data['player_source_duration']) ? $data['player_source_duration'] : null; - $this->container['player_source_url'] = isset($data['player_source_url']) ? $data['player_source_url'] : null; - $this->container['mux_api_version'] = isset($data['mux_api_version']) ? $data['mux_api_version'] : null; - $this->container['video_title'] = isset($data['video_title']) ? $data['video_title'] : null; - $this->container['id'] = isset($data['id']) ? $data['id'] : null; - $this->container['short_time'] = isset($data['short_time']) ? $data['short_time'] : null; - $this->container['rebuffer_percentage'] = isset($data['rebuffer_percentage']) ? $data['rebuffer_percentage'] : null; - $this->container['time_to_first_frame'] = isset($data['time_to_first_frame']) ? $data['time_to_first_frame'] : null; - $this->container['viewer_user_id'] = isset($data['viewer_user_id']) ? $data['viewer_user_id'] : null; - $this->container['video_stream_type'] = isset($data['video_stream_type']) ? $data['video_stream_type'] : null; - $this->container['player_startup_time'] = isset($data['player_startup_time']) ? $data['player_startup_time'] : null; - $this->container['viewer_application_version'] = isset($data['viewer_application_version']) ? $data['viewer_application_version'] : null; - $this->container['view_max_downscale_percentage'] = isset($data['view_max_downscale_percentage']) ? $data['view_max_downscale_percentage'] : null; - $this->container['view_max_upscale_percentage'] = isset($data['view_max_upscale_percentage']) ? $data['view_max_upscale_percentage'] : null; - $this->container['country_code'] = isset($data['country_code']) ? $data['country_code'] : null; - $this->container['used_fullscreen'] = isset($data['used_fullscreen']) ? $data['used_fullscreen'] : null; - $this->container['isp'] = isset($data['isp']) ? $data['isp'] : null; - $this->container['property_id'] = isset($data['property_id']) ? $data['property_id'] : null; - $this->container['player_autoplay'] = isset($data['player_autoplay']) ? $data['player_autoplay'] : null; - $this->container['player_height'] = isset($data['player_height']) ? $data['player_height'] : null; - $this->container['asn'] = isset($data['asn']) ? $data['asn'] : null; - $this->container['asn_name'] = isset($data['asn_name']) ? $data['asn_name'] : null; - $this->container['quality_score'] = isset($data['quality_score']) ? $data['quality_score'] : null; - $this->container['player_software_version'] = isset($data['player_software_version']) ? $data['player_software_version'] : null; - $this->container['player_mux_plugin_name'] = isset($data['player_mux_plugin_name']) ? $data['player_mux_plugin_name'] : 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->container['view_total_upscaling'] = $data['view_total_upscaling'] ?? null; + $this->container['preroll_ad_asset_hostname'] = $data['preroll_ad_asset_hostname'] ?? null; + $this->container['player_source_domain'] = $data['player_source_domain'] ?? null; + $this->container['region'] = $data['region'] ?? null; + $this->container['viewer_user_agent'] = $data['viewer_user_agent'] ?? null; + $this->container['preroll_requested'] = $data['preroll_requested'] ?? null; + $this->container['page_type'] = $data['page_type'] ?? null; + $this->container['startup_score'] = $data['startup_score'] ?? null; + $this->container['view_seek_duration'] = $data['view_seek_duration'] ?? null; + $this->container['country_name'] = $data['country_name'] ?? null; + $this->container['player_source_height'] = $data['player_source_height'] ?? null; + $this->container['longitude'] = $data['longitude'] ?? null; + $this->container['buffering_count'] = $data['buffering_count'] ?? null; + $this->container['video_duration'] = $data['video_duration'] ?? null; + $this->container['player_source_type'] = $data['player_source_type'] ?? null; + $this->container['city'] = $data['city'] ?? null; + $this->container['view_id'] = $data['view_id'] ?? null; + $this->container['platform_description'] = $data['platform_description'] ?? null; + $this->container['video_startup_preroll_request_time'] = $data['video_startup_preroll_request_time'] ?? null; + $this->container['viewer_device_name'] = $data['viewer_device_name'] ?? null; + $this->container['video_series'] = $data['video_series'] ?? null; + $this->container['viewer_application_name'] = $data['viewer_application_name'] ?? null; + $this->container['updated_at'] = $data['updated_at'] ?? null; + $this->container['view_total_content_playback_time'] = $data['view_total_content_playback_time'] ?? null; + $this->container['cdn'] = $data['cdn'] ?? null; + $this->container['player_instance_id'] = $data['player_instance_id'] ?? null; + $this->container['video_language'] = $data['video_language'] ?? null; + $this->container['player_source_width'] = $data['player_source_width'] ?? null; + $this->container['player_error_message'] = $data['player_error_message'] ?? null; + $this->container['player_mux_plugin_version'] = $data['player_mux_plugin_version'] ?? null; + $this->container['watched'] = $data['watched'] ?? null; + $this->container['playback_score'] = $data['playback_score'] ?? null; + $this->container['page_url'] = $data['page_url'] ?? null; + $this->container['metro'] = $data['metro'] ?? null; + $this->container['view_max_request_latency'] = $data['view_max_request_latency'] ?? null; + $this->container['requests_for_first_preroll'] = $data['requests_for_first_preroll'] ?? null; + $this->container['view_total_downscaling'] = $data['view_total_downscaling'] ?? null; + $this->container['latitude'] = $data['latitude'] ?? null; + $this->container['player_source_host_name'] = $data['player_source_host_name'] ?? null; + $this->container['inserted_at'] = $data['inserted_at'] ?? null; + $this->container['view_end'] = $data['view_end'] ?? null; + $this->container['mux_embed_version'] = $data['mux_embed_version'] ?? null; + $this->container['player_language'] = $data['player_language'] ?? null; + $this->container['page_load_time'] = $data['page_load_time'] ?? null; + $this->container['viewer_device_category'] = $data['viewer_device_category'] ?? null; + $this->container['video_startup_preroll_load_time'] = $data['video_startup_preroll_load_time'] ?? null; + $this->container['player_version'] = $data['player_version'] ?? null; + $this->container['watch_time'] = $data['watch_time'] ?? null; + $this->container['player_source_stream_type'] = $data['player_source_stream_type'] ?? null; + $this->container['preroll_ad_tag_hostname'] = $data['preroll_ad_tag_hostname'] ?? null; + $this->container['viewer_device_manufacturer'] = $data['viewer_device_manufacturer'] ?? null; + $this->container['rebuffering_score'] = $data['rebuffering_score'] ?? null; + $this->container['experiment_name'] = $data['experiment_name'] ?? null; + $this->container['viewer_os_version'] = $data['viewer_os_version'] ?? null; + $this->container['player_preload'] = $data['player_preload'] ?? null; + $this->container['buffering_duration'] = $data['buffering_duration'] ?? null; + $this->container['player_view_count'] = $data['player_view_count'] ?? null; + $this->container['player_software'] = $data['player_software'] ?? null; + $this->container['player_load_time'] = $data['player_load_time'] ?? null; + $this->container['platform_summary'] = $data['platform_summary'] ?? null; + $this->container['video_encoding_variant'] = $data['video_encoding_variant'] ?? null; + $this->container['player_width'] = $data['player_width'] ?? null; + $this->container['view_seek_count'] = $data['view_seek_count'] ?? null; + $this->container['viewer_experience_score'] = $data['viewer_experience_score'] ?? null; + $this->container['view_error_id'] = $data['view_error_id'] ?? null; + $this->container['video_variant_name'] = $data['video_variant_name'] ?? null; + $this->container['preroll_played'] = $data['preroll_played'] ?? null; + $this->container['viewer_application_engine'] = $data['viewer_application_engine'] ?? null; + $this->container['viewer_os_architecture'] = $data['viewer_os_architecture'] ?? null; + $this->container['player_error_code'] = $data['player_error_code'] ?? null; + $this->container['buffering_rate'] = $data['buffering_rate'] ?? null; + $this->container['events'] = $data['events'] ?? null; + $this->container['player_name'] = $data['player_name'] ?? null; + $this->container['view_start'] = $data['view_start'] ?? null; + $this->container['view_average_request_throughput'] = $data['view_average_request_throughput'] ?? null; + $this->container['video_producer'] = $data['video_producer'] ?? null; + $this->container['error_type_id'] = $data['error_type_id'] ?? null; + $this->container['mux_viewer_id'] = $data['mux_viewer_id'] ?? null; + $this->container['video_id'] = $data['video_id'] ?? null; + $this->container['continent_code'] = $data['continent_code'] ?? null; + $this->container['session_id'] = $data['session_id'] ?? null; + $this->container['exit_before_video_start'] = $data['exit_before_video_start'] ?? null; + $this->container['video_content_type'] = $data['video_content_type'] ?? null; + $this->container['viewer_os_family'] = $data['viewer_os_family'] ?? null; + $this->container['player_poster'] = $data['player_poster'] ?? null; + $this->container['view_average_request_latency'] = $data['view_average_request_latency'] ?? null; + $this->container['video_variant_id'] = $data['video_variant_id'] ?? null; + $this->container['player_source_duration'] = $data['player_source_duration'] ?? null; + $this->container['player_source_url'] = $data['player_source_url'] ?? null; + $this->container['mux_api_version'] = $data['mux_api_version'] ?? null; + $this->container['video_title'] = $data['video_title'] ?? null; + $this->container['id'] = $data['id'] ?? null; + $this->container['short_time'] = $data['short_time'] ?? null; + $this->container['rebuffer_percentage'] = $data['rebuffer_percentage'] ?? null; + $this->container['time_to_first_frame'] = $data['time_to_first_frame'] ?? null; + $this->container['viewer_user_id'] = $data['viewer_user_id'] ?? null; + $this->container['video_stream_type'] = $data['video_stream_type'] ?? null; + $this->container['player_startup_time'] = $data['player_startup_time'] ?? null; + $this->container['viewer_application_version'] = $data['viewer_application_version'] ?? null; + $this->container['view_max_downscale_percentage'] = $data['view_max_downscale_percentage'] ?? null; + $this->container['view_max_upscale_percentage'] = $data['view_max_upscale_percentage'] ?? null; + $this->container['country_code'] = $data['country_code'] ?? null; + $this->container['used_fullscreen'] = $data['used_fullscreen'] ?? null; + $this->container['isp'] = $data['isp'] ?? null; + $this->container['property_id'] = $data['property_id'] ?? null; + $this->container['player_autoplay'] = $data['player_autoplay'] ?? null; + $this->container['player_height'] = $data['player_height'] ?? null; + $this->container['asn'] = $data['asn'] ?? null; + $this->container['asn_name'] = $data['asn_name'] ?? null; + $this->container['quality_score'] = $data['quality_score'] ?? null; + $this->container['player_software_version'] = $data['player_software_version'] ?? null; + $this->container['player_mux_plugin_name'] = $data['player_mux_plugin_name'] ?? null; } /** @@ -861,7 +893,7 @@ public function getViewTotalUpscaling() * * @param string|null $view_total_upscaling view_total_upscaling * - * @return $this + * @return self */ public function setViewTotalUpscaling($view_total_upscaling) { @@ -885,7 +917,7 @@ public function getPrerollAdAssetHostname() * * @param string|null $preroll_ad_asset_hostname preroll_ad_asset_hostname * - * @return $this + * @return self */ public function setPrerollAdAssetHostname($preroll_ad_asset_hostname) { @@ -909,7 +941,7 @@ public function getPlayerSourceDomain() * * @param string|null $player_source_domain player_source_domain * - * @return $this + * @return self */ public function setPlayerSourceDomain($player_source_domain) { @@ -933,7 +965,7 @@ public function getRegion() * * @param string|null $region region * - * @return $this + * @return self */ public function setRegion($region) { @@ -957,7 +989,7 @@ public function getViewerUserAgent() * * @param string|null $viewer_user_agent viewer_user_agent * - * @return $this + * @return self */ public function setViewerUserAgent($viewer_user_agent) { @@ -981,7 +1013,7 @@ public function getPrerollRequested() * * @param bool|null $preroll_requested preroll_requested * - * @return $this + * @return self */ public function setPrerollRequested($preroll_requested) { @@ -1005,7 +1037,7 @@ public function getPageType() * * @param string|null $page_type page_type * - * @return $this + * @return self */ public function setPageType($page_type) { @@ -1029,7 +1061,7 @@ public function getStartupScore() * * @param string|null $startup_score startup_score * - * @return $this + * @return self */ public function setStartupScore($startup_score) { @@ -1053,7 +1085,7 @@ public function getViewSeekDuration() * * @param int|null $view_seek_duration view_seek_duration * - * @return $this + * @return self */ public function setViewSeekDuration($view_seek_duration) { @@ -1077,7 +1109,7 @@ public function getCountryName() * * @param string|null $country_name country_name * - * @return $this + * @return self */ public function setCountryName($country_name) { @@ -1101,7 +1133,7 @@ public function getPlayerSourceHeight() * * @param int|null $player_source_height player_source_height * - * @return $this + * @return self */ public function setPlayerSourceHeight($player_source_height) { @@ -1125,7 +1157,7 @@ public function getLongitude() * * @param string|null $longitude longitude * - * @return $this + * @return self */ public function setLongitude($longitude) { @@ -1149,7 +1181,7 @@ public function getBufferingCount() * * @param int|null $buffering_count buffering_count * - * @return $this + * @return self */ public function setBufferingCount($buffering_count) { @@ -1173,7 +1205,7 @@ public function getVideoDuration() * * @param int|null $video_duration video_duration * - * @return $this + * @return self */ public function setVideoDuration($video_duration) { @@ -1197,7 +1229,7 @@ public function getPlayerSourceType() * * @param string|null $player_source_type player_source_type * - * @return $this + * @return self */ public function setPlayerSourceType($player_source_type) { @@ -1221,7 +1253,7 @@ public function getCity() * * @param string|null $city city * - * @return $this + * @return self */ public function setCity($city) { @@ -1245,7 +1277,7 @@ public function getViewId() * * @param string|null $view_id view_id * - * @return $this + * @return self */ public function setViewId($view_id) { @@ -1269,7 +1301,7 @@ public function getPlatformDescription() * * @param string|null $platform_description platform_description * - * @return $this + * @return self */ public function setPlatformDescription($platform_description) { @@ -1293,7 +1325,7 @@ public function getVideoStartupPrerollRequestTime() * * @param int|null $video_startup_preroll_request_time video_startup_preroll_request_time * - * @return $this + * @return self */ public function setVideoStartupPrerollRequestTime($video_startup_preroll_request_time) { @@ -1317,7 +1349,7 @@ public function getViewerDeviceName() * * @param string|null $viewer_device_name viewer_device_name * - * @return $this + * @return self */ public function setViewerDeviceName($viewer_device_name) { @@ -1341,7 +1373,7 @@ public function getVideoSeries() * * @param string|null $video_series video_series * - * @return $this + * @return self */ public function setVideoSeries($video_series) { @@ -1365,7 +1397,7 @@ public function getViewerApplicationName() * * @param string|null $viewer_application_name viewer_application_name * - * @return $this + * @return self */ public function setViewerApplicationName($viewer_application_name) { @@ -1389,7 +1421,7 @@ public function getUpdatedAt() * * @param string|null $updated_at updated_at * - * @return $this + * @return self */ public function setUpdatedAt($updated_at) { @@ -1413,7 +1445,7 @@ public function getViewTotalContentPlaybackTime() * * @param int|null $view_total_content_playback_time view_total_content_playback_time * - * @return $this + * @return self */ public function setViewTotalContentPlaybackTime($view_total_content_playback_time) { @@ -1437,7 +1469,7 @@ public function getCdn() * * @param string|null $cdn cdn * - * @return $this + * @return self */ public function setCdn($cdn) { @@ -1461,7 +1493,7 @@ public function getPlayerInstanceId() * * @param string|null $player_instance_id player_instance_id * - * @return $this + * @return self */ public function setPlayerInstanceId($player_instance_id) { @@ -1485,7 +1517,7 @@ public function getVideoLanguage() * * @param string|null $video_language video_language * - * @return $this + * @return self */ public function setVideoLanguage($video_language) { @@ -1509,7 +1541,7 @@ public function getPlayerSourceWidth() * * @param int|null $player_source_width player_source_width * - * @return $this + * @return self */ public function setPlayerSourceWidth($player_source_width) { @@ -1533,7 +1565,7 @@ public function getPlayerErrorMessage() * * @param string|null $player_error_message player_error_message * - * @return $this + * @return self */ public function setPlayerErrorMessage($player_error_message) { @@ -1557,7 +1589,7 @@ public function getPlayerMuxPluginVersion() * * @param string|null $player_mux_plugin_version player_mux_plugin_version * - * @return $this + * @return self */ public function setPlayerMuxPluginVersion($player_mux_plugin_version) { @@ -1581,7 +1613,7 @@ public function getWatched() * * @param bool|null $watched watched * - * @return $this + * @return self */ public function setWatched($watched) { @@ -1605,7 +1637,7 @@ public function getPlaybackScore() * * @param string|null $playback_score playback_score * - * @return $this + * @return self */ public function setPlaybackScore($playback_score) { @@ -1629,7 +1661,7 @@ public function getPageUrl() * * @param string|null $page_url page_url * - * @return $this + * @return self */ public function setPageUrl($page_url) { @@ -1653,7 +1685,7 @@ public function getMetro() * * @param string|null $metro metro * - * @return $this + * @return self */ public function setMetro($metro) { @@ -1677,7 +1709,7 @@ public function getViewMaxRequestLatency() * * @param int|null $view_max_request_latency view_max_request_latency * - * @return $this + * @return self */ public function setViewMaxRequestLatency($view_max_request_latency) { @@ -1701,7 +1733,7 @@ public function getRequestsForFirstPreroll() * * @param int|null $requests_for_first_preroll requests_for_first_preroll * - * @return $this + * @return self */ public function setRequestsForFirstPreroll($requests_for_first_preroll) { @@ -1725,7 +1757,7 @@ public function getViewTotalDownscaling() * * @param string|null $view_total_downscaling view_total_downscaling * - * @return $this + * @return self */ public function setViewTotalDownscaling($view_total_downscaling) { @@ -1749,7 +1781,7 @@ public function getLatitude() * * @param string|null $latitude latitude * - * @return $this + * @return self */ public function setLatitude($latitude) { @@ -1773,7 +1805,7 @@ public function getPlayerSourceHostName() * * @param string|null $player_source_host_name player_source_host_name * - * @return $this + * @return self */ public function setPlayerSourceHostName($player_source_host_name) { @@ -1797,7 +1829,7 @@ public function getInsertedAt() * * @param string|null $inserted_at inserted_at * - * @return $this + * @return self */ public function setInsertedAt($inserted_at) { @@ -1821,7 +1853,7 @@ public function getViewEnd() * * @param string|null $view_end view_end * - * @return $this + * @return self */ public function setViewEnd($view_end) { @@ -1845,7 +1877,7 @@ public function getMuxEmbedVersion() * * @param string|null $mux_embed_version mux_embed_version * - * @return $this + * @return self */ public function setMuxEmbedVersion($mux_embed_version) { @@ -1869,7 +1901,7 @@ public function getPlayerLanguage() * * @param string|null $player_language player_language * - * @return $this + * @return self */ public function setPlayerLanguage($player_language) { @@ -1893,7 +1925,7 @@ public function getPageLoadTime() * * @param int|null $page_load_time page_load_time * - * @return $this + * @return self */ public function setPageLoadTime($page_load_time) { @@ -1917,7 +1949,7 @@ public function getViewerDeviceCategory() * * @param string|null $viewer_device_category viewer_device_category * - * @return $this + * @return self */ public function setViewerDeviceCategory($viewer_device_category) { @@ -1941,7 +1973,7 @@ public function getVideoStartupPrerollLoadTime() * * @param int|null $video_startup_preroll_load_time video_startup_preroll_load_time * - * @return $this + * @return self */ public function setVideoStartupPrerollLoadTime($video_startup_preroll_load_time) { @@ -1965,7 +1997,7 @@ public function getPlayerVersion() * * @param string|null $player_version player_version * - * @return $this + * @return self */ public function setPlayerVersion($player_version) { @@ -1989,7 +2021,7 @@ public function getWatchTime() * * @param int|null $watch_time watch_time * - * @return $this + * @return self */ public function setWatchTime($watch_time) { @@ -2013,7 +2045,7 @@ public function getPlayerSourceStreamType() * * @param string|null $player_source_stream_type player_source_stream_type * - * @return $this + * @return self */ public function setPlayerSourceStreamType($player_source_stream_type) { @@ -2037,7 +2069,7 @@ public function getPrerollAdTagHostname() * * @param string|null $preroll_ad_tag_hostname preroll_ad_tag_hostname * - * @return $this + * @return self */ public function setPrerollAdTagHostname($preroll_ad_tag_hostname) { @@ -2061,7 +2093,7 @@ public function getViewerDeviceManufacturer() * * @param string|null $viewer_device_manufacturer viewer_device_manufacturer * - * @return $this + * @return self */ public function setViewerDeviceManufacturer($viewer_device_manufacturer) { @@ -2085,7 +2117,7 @@ public function getRebufferingScore() * * @param string|null $rebuffering_score rebuffering_score * - * @return $this + * @return self */ public function setRebufferingScore($rebuffering_score) { @@ -2109,7 +2141,7 @@ public function getExperimentName() * * @param string|null $experiment_name experiment_name * - * @return $this + * @return self */ public function setExperimentName($experiment_name) { @@ -2133,7 +2165,7 @@ public function getViewerOsVersion() * * @param string|null $viewer_os_version viewer_os_version * - * @return $this + * @return self */ public function setViewerOsVersion($viewer_os_version) { @@ -2157,7 +2189,7 @@ public function getPlayerPreload() * * @param bool|null $player_preload player_preload * - * @return $this + * @return self */ public function setPlayerPreload($player_preload) { @@ -2181,7 +2213,7 @@ public function getBufferingDuration() * * @param int|null $buffering_duration buffering_duration * - * @return $this + * @return self */ public function setBufferingDuration($buffering_duration) { @@ -2205,7 +2237,7 @@ public function getPlayerViewCount() * * @param int|null $player_view_count player_view_count * - * @return $this + * @return self */ public function setPlayerViewCount($player_view_count) { @@ -2229,7 +2261,7 @@ public function getPlayerSoftware() * * @param string|null $player_software player_software * - * @return $this + * @return self */ public function setPlayerSoftware($player_software) { @@ -2253,7 +2285,7 @@ public function getPlayerLoadTime() * * @param int|null $player_load_time player_load_time * - * @return $this + * @return self */ public function setPlayerLoadTime($player_load_time) { @@ -2277,7 +2309,7 @@ public function getPlatformSummary() * * @param string|null $platform_summary platform_summary * - * @return $this + * @return self */ public function setPlatformSummary($platform_summary) { @@ -2301,7 +2333,7 @@ public function getVideoEncodingVariant() * * @param string|null $video_encoding_variant video_encoding_variant * - * @return $this + * @return self */ public function setVideoEncodingVariant($video_encoding_variant) { @@ -2325,7 +2357,7 @@ public function getPlayerWidth() * * @param int|null $player_width player_width * - * @return $this + * @return self */ public function setPlayerWidth($player_width) { @@ -2349,7 +2381,7 @@ public function getViewSeekCount() * * @param int|null $view_seek_count view_seek_count * - * @return $this + * @return self */ public function setViewSeekCount($view_seek_count) { @@ -2373,7 +2405,7 @@ public function getViewerExperienceScore() * * @param string|null $viewer_experience_score viewer_experience_score * - * @return $this + * @return self */ public function setViewerExperienceScore($viewer_experience_score) { @@ -2397,7 +2429,7 @@ public function getViewErrorId() * * @param int|null $view_error_id view_error_id * - * @return $this + * @return self */ public function setViewErrorId($view_error_id) { @@ -2421,7 +2453,7 @@ public function getVideoVariantName() * * @param string|null $video_variant_name video_variant_name * - * @return $this + * @return self */ public function setVideoVariantName($video_variant_name) { @@ -2445,7 +2477,7 @@ public function getPrerollPlayed() * * @param bool|null $preroll_played preroll_played * - * @return $this + * @return self */ public function setPrerollPlayed($preroll_played) { @@ -2469,7 +2501,7 @@ public function getViewerApplicationEngine() * * @param string|null $viewer_application_engine viewer_application_engine * - * @return $this + * @return self */ public function setViewerApplicationEngine($viewer_application_engine) { @@ -2493,7 +2525,7 @@ public function getViewerOsArchitecture() * * @param string|null $viewer_os_architecture viewer_os_architecture * - * @return $this + * @return self */ public function setViewerOsArchitecture($viewer_os_architecture) { @@ -2517,7 +2549,7 @@ public function getPlayerErrorCode() * * @param string|null $player_error_code player_error_code * - * @return $this + * @return self */ public function setPlayerErrorCode($player_error_code) { @@ -2541,7 +2573,7 @@ public function getBufferingRate() * * @param string|null $buffering_rate buffering_rate * - * @return $this + * @return self */ public function setBufferingRate($buffering_rate) { @@ -2565,7 +2597,7 @@ public function getEvents() * * @param \MuxPhp\Models\VideoViewEvent[]|null $events events * - * @return $this + * @return self */ public function setEvents($events) { @@ -2589,7 +2621,7 @@ public function getPlayerName() * * @param string|null $player_name player_name * - * @return $this + * @return self */ public function setPlayerName($player_name) { @@ -2613,7 +2645,7 @@ public function getViewStart() * * @param string|null $view_start view_start * - * @return $this + * @return self */ public function setViewStart($view_start) { @@ -2637,7 +2669,7 @@ public function getViewAverageRequestThroughput() * * @param int|null $view_average_request_throughput view_average_request_throughput * - * @return $this + * @return self */ public function setViewAverageRequestThroughput($view_average_request_throughput) { @@ -2661,7 +2693,7 @@ public function getVideoProducer() * * @param string|null $video_producer video_producer * - * @return $this + * @return self */ public function setVideoProducer($video_producer) { @@ -2685,7 +2717,7 @@ public function getErrorTypeId() * * @param int|null $error_type_id error_type_id * - * @return $this + * @return self */ public function setErrorTypeId($error_type_id) { @@ -2709,7 +2741,7 @@ public function getMuxViewerId() * * @param string|null $mux_viewer_id mux_viewer_id * - * @return $this + * @return self */ public function setMuxViewerId($mux_viewer_id) { @@ -2733,7 +2765,7 @@ public function getVideoId() * * @param string|null $video_id video_id * - * @return $this + * @return self */ public function setVideoId($video_id) { @@ -2757,7 +2789,7 @@ public function getContinentCode() * * @param string|null $continent_code continent_code * - * @return $this + * @return self */ public function setContinentCode($continent_code) { @@ -2781,7 +2813,7 @@ public function getSessionId() * * @param string|null $session_id session_id * - * @return $this + * @return self */ public function setSessionId($session_id) { @@ -2805,7 +2837,7 @@ public function getExitBeforeVideoStart() * * @param bool|null $exit_before_video_start exit_before_video_start * - * @return $this + * @return self */ public function setExitBeforeVideoStart($exit_before_video_start) { @@ -2829,7 +2861,7 @@ public function getVideoContentType() * * @param string|null $video_content_type video_content_type * - * @return $this + * @return self */ public function setVideoContentType($video_content_type) { @@ -2853,7 +2885,7 @@ public function getViewerOsFamily() * * @param string|null $viewer_os_family viewer_os_family * - * @return $this + * @return self */ public function setViewerOsFamily($viewer_os_family) { @@ -2877,7 +2909,7 @@ public function getPlayerPoster() * * @param string|null $player_poster player_poster * - * @return $this + * @return self */ public function setPlayerPoster($player_poster) { @@ -2901,7 +2933,7 @@ public function getViewAverageRequestLatency() * * @param int|null $view_average_request_latency view_average_request_latency * - * @return $this + * @return self */ public function setViewAverageRequestLatency($view_average_request_latency) { @@ -2925,7 +2957,7 @@ public function getVideoVariantId() * * @param string|null $video_variant_id video_variant_id * - * @return $this + * @return self */ public function setVideoVariantId($video_variant_id) { @@ -2949,7 +2981,7 @@ public function getPlayerSourceDuration() * * @param int|null $player_source_duration player_source_duration * - * @return $this + * @return self */ public function setPlayerSourceDuration($player_source_duration) { @@ -2973,7 +3005,7 @@ public function getPlayerSourceUrl() * * @param string|null $player_source_url player_source_url * - * @return $this + * @return self */ public function setPlayerSourceUrl($player_source_url) { @@ -2997,7 +3029,7 @@ public function getMuxApiVersion() * * @param string|null $mux_api_version mux_api_version * - * @return $this + * @return self */ public function setMuxApiVersion($mux_api_version) { @@ -3021,7 +3053,7 @@ public function getVideoTitle() * * @param string|null $video_title video_title * - * @return $this + * @return self */ public function setVideoTitle($video_title) { @@ -3045,7 +3077,7 @@ public function getId() * * @param string|null $id id * - * @return $this + * @return self */ public function setId($id) { @@ -3069,7 +3101,7 @@ public function getShortTime() * * @param string|null $short_time short_time * - * @return $this + * @return self */ public function setShortTime($short_time) { @@ -3093,7 +3125,7 @@ public function getRebufferPercentage() * * @param string|null $rebuffer_percentage rebuffer_percentage * - * @return $this + * @return self */ public function setRebufferPercentage($rebuffer_percentage) { @@ -3117,7 +3149,7 @@ public function getTimeToFirstFrame() * * @param int|null $time_to_first_frame time_to_first_frame * - * @return $this + * @return self */ public function setTimeToFirstFrame($time_to_first_frame) { @@ -3141,7 +3173,7 @@ public function getViewerUserId() * * @param string|null $viewer_user_id viewer_user_id * - * @return $this + * @return self */ public function setViewerUserId($viewer_user_id) { @@ -3165,7 +3197,7 @@ public function getVideoStreamType() * * @param string|null $video_stream_type video_stream_type * - * @return $this + * @return self */ public function setVideoStreamType($video_stream_type) { @@ -3189,7 +3221,7 @@ public function getPlayerStartupTime() * * @param int|null $player_startup_time player_startup_time * - * @return $this + * @return self */ public function setPlayerStartupTime($player_startup_time) { @@ -3213,7 +3245,7 @@ public function getViewerApplicationVersion() * * @param string|null $viewer_application_version viewer_application_version * - * @return $this + * @return self */ public function setViewerApplicationVersion($viewer_application_version) { @@ -3237,7 +3269,7 @@ public function getViewMaxDownscalePercentage() * * @param string|null $view_max_downscale_percentage view_max_downscale_percentage * - * @return $this + * @return self */ public function setViewMaxDownscalePercentage($view_max_downscale_percentage) { @@ -3261,7 +3293,7 @@ public function getViewMaxUpscalePercentage() * * @param string|null $view_max_upscale_percentage view_max_upscale_percentage * - * @return $this + * @return self */ public function setViewMaxUpscalePercentage($view_max_upscale_percentage) { @@ -3285,7 +3317,7 @@ public function getCountryCode() * * @param string|null $country_code country_code * - * @return $this + * @return self */ public function setCountryCode($country_code) { @@ -3309,7 +3341,7 @@ public function getUsedFullscreen() * * @param bool|null $used_fullscreen used_fullscreen * - * @return $this + * @return self */ public function setUsedFullscreen($used_fullscreen) { @@ -3333,7 +3365,7 @@ public function getIsp() * * @param string|null $isp isp * - * @return $this + * @return self */ public function setIsp($isp) { @@ -3357,7 +3389,7 @@ public function getPropertyId() * * @param int|null $property_id property_id * - * @return $this + * @return self */ public function setPropertyId($property_id) { @@ -3381,7 +3413,7 @@ public function getPlayerAutoplay() * * @param bool|null $player_autoplay player_autoplay * - * @return $this + * @return self */ public function setPlayerAutoplay($player_autoplay) { @@ -3405,7 +3437,7 @@ public function getPlayerHeight() * * @param int|null $player_height player_height * - * @return $this + * @return self */ public function setPlayerHeight($player_height) { @@ -3429,7 +3461,7 @@ public function getAsn() * * @param int|null $asn asn * - * @return $this + * @return self */ public function setAsn($asn) { @@ -3453,7 +3485,7 @@ public function getAsnName() * * @param string|null $asn_name asn_name * - * @return $this + * @return self */ public function setAsnName($asn_name) { @@ -3477,7 +3509,7 @@ public function getQualityScore() * * @param string|null $quality_score quality_score * - * @return $this + * @return self */ public function setQualityScore($quality_score) { @@ -3501,7 +3533,7 @@ public function getPlayerSoftwareVersion() * * @param string|null $player_software_version player_software_version * - * @return $this + * @return self */ public function setPlayerSoftwareVersion($player_software_version) { @@ -3525,7 +3557,7 @@ public function getPlayerMuxPluginName() * * @param string|null $player_mux_plugin_name player_mux_plugin_name * - * @return $this + * @return self */ public function setPlayerMuxPluginName($player_mux_plugin_name) { @@ -3550,18 +3582,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -3586,6 +3618,18 @@ public function offsetUnset($offset) 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. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -3598,6 +3642,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/MuxPhp/Models/VideoViewEvent.php b/MuxPhp/Models/VideoViewEvent.php index 0b5572e..fbd6903 100644 --- a/MuxPhp/Models/VideoViewEvent.php +++ b/MuxPhp/Models/VideoViewEvent.php @@ -1,8 +1,30 @@ + * @template TKey int|null + * @template TValue mixed|null */ -class VideoViewEvent implements ModelInterface, ArrayAccess +class VideoViewEvent implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'VideoViewEvent'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'viewer_time' => 'int', 'playback_time' => 'int', @@ -40,10 +67,12 @@ class VideoViewEvent implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'viewer_time' => 'int64', 'playback_time' => 'int64', @@ -168,10 +197,13 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['viewer_time'] = isset($data['viewer_time']) ? $data['viewer_time'] : null; - $this->container['playback_time'] = isset($data['playback_time']) ? $data['playback_time'] : null; - $this->container['name'] = isset($data['name']) ? $data['name'] : null; - $this->container['event_time'] = isset($data['event_time']) ? $data['event_time'] : 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->container['viewer_time'] = $data['viewer_time'] ?? null; + $this->container['playback_time'] = $data['playback_time'] ?? null; + $this->container['name'] = $data['name'] ?? null; + $this->container['event_time'] = $data['event_time'] ?? null; } /** @@ -213,7 +245,7 @@ public function getViewerTime() * * @param int|null $viewer_time viewer_time * - * @return $this + * @return self */ public function setViewerTime($viewer_time) { @@ -237,7 +269,7 @@ public function getPlaybackTime() * * @param int|null $playback_time playback_time * - * @return $this + * @return self */ public function setPlaybackTime($playback_time) { @@ -261,7 +293,7 @@ public function getName() * * @param string|null $name name * - * @return $this + * @return self */ public function setName($name) { @@ -285,7 +317,7 @@ public function getEventTime() * * @param int|null $event_time event_time * - * @return $this + * @return self */ public function setEventTime($event_time) { @@ -310,18 +342,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -346,6 +378,18 @@ public function offsetUnset($offset) 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. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -358,6 +402,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/MuxPhp/Models/VideoViewResponse.php b/MuxPhp/Models/VideoViewResponse.php index 3ead4a1..07b7918 100644 --- a/MuxPhp/Models/VideoViewResponse.php +++ b/MuxPhp/Models/VideoViewResponse.php @@ -1,8 +1,30 @@ + * @template TKey int|null + * @template TValue mixed|null */ -class VideoViewResponse implements ModelInterface, ArrayAccess +class VideoViewResponse implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'VideoViewResponse'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'data' => '\MuxPhp\Models\VideoView', 'timeframe' => 'int[]' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ protected static $openAPIFormats = [ 'data' => null, 'timeframe' => 'int64' @@ -158,8 +187,11 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['data'] = isset($data['data']) ? $data['data'] : null; - $this->container['timeframe'] = isset($data['timeframe']) ? $data['timeframe'] : 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->container['data'] = $data['data'] ?? null; + $this->container['timeframe'] = $data['timeframe'] ?? null; } /** @@ -201,7 +233,7 @@ public function getData() * * @param \MuxPhp\Models\VideoView|null $data data * - * @return $this + * @return self */ public function setData($data) { @@ -225,7 +257,7 @@ public function getTimeframe() * * @param int[]|null $timeframe timeframe * - * @return $this + * @return self */ public function setTimeframe($timeframe) { @@ -250,18 +282,18 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ @@ -286,6 +318,18 @@ public function offsetUnset($offset) 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. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -298,6 +342,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/MuxPhp/ObjectSerializer.php b/MuxPhp/ObjectSerializer.php index cf6031e..c1855e2 100644 --- a/MuxPhp/ObjectSerializer.php +++ b/MuxPhp/ObjectSerializer.php @@ -1,8 +1,30 @@ format('Y-m-d') : $data->format(\DateTime::ATOM); - } elseif (is_array($data)) { + } + + if ($data instanceof \DateTime) { + return ($format === 'date') ? $data->format('Y-m-d') : $data->format(self::$dateTimeFormat); + } + + if (is_array($data)) { foreach ($data as $property => $value) { $data[$property] = self::sanitizeForSerialization($value); } return $data; - } elseif (is_object($data)) { + } + + if (is_object($data)) { $values = []; if ($data instanceof ModelInterface) { $formats = $data::openAPIFormats(); foreach ($data::openAPITypes() as $property => $openAPIType) { $getter = $data::getters()[$property]; $value = $data->$getter(); - if ($value !== null - && !in_array($openAPIType, ['DateTime', 'bool', 'boolean', 'byte', 'double', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true) - && method_exists($openAPIType, 'getAllowableEnumValues') - && !in_array($value, $openAPIType::getAllowableEnumValues(), true)) { - $imploded = implode("', '", $openAPIType::getAllowableEnumValues()); - throw new \InvalidArgumentException("Invalid value for enum '$openAPIType', must be one of: '$imploded'"); + if ($value !== null && !in_array($openAPIType, ['DateTime', 'bool', 'boolean', 'byte', 'double', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true)) { + $callable = [$openAPIType, 'getAllowableEnumValues']; + if (is_callable($callable)) { + /** array $callable */ + $allowedEnumTypes = $callable(); + if (!in_array($value, $allowedEnumTypes, true)) { + $imploded = implode("', '", $allowedEnumTypes); + throw new \InvalidArgumentException("Invalid value for enum '$openAPIType', must be one of: '$imploded'"); + } + } } if ($value !== null) { $values[$data::attributeMap()[$property]] = self::sanitizeForSerialization($value, $openAPIType, $formats[$property]); @@ -126,6 +173,11 @@ public static function toQueryValue($object) */ public static function toHeaderValue($value) { + $callable = [$value, 'toHeaderValue']; + if (is_callable($callable)) { + return $callable(); + } + return self::toString($value); } @@ -160,7 +212,7 @@ public static function toFormValue($value) public static function toString($value) { if ($value instanceof \DateTime) { // datetime in ISO8601 format - return $value->format(\DateTime::ATOM); + return $value->format(self::$dateTimeFormat); } elseif (is_bool($value)) { return $value ? 'true' : 'false'; } else { @@ -172,29 +224,32 @@ public static function toString($value) * Serialize an array to a string. * * @param array $collection collection to serialize to a string - * @param string $collectionFormat the format use for serialization (csv, + * @param string $style the format use for serialization (csv, * ssv, tsv, pipes, multi) * @param bool $allowCollectionFormatMulti allow collection format to be a multidimensional array * * @return string */ - public static function serializeCollection(array $collection, $collectionFormat, $allowCollectionFormatMulti = false) + public static function serializeCollection(array $collection, $style, $allowCollectionFormatMulti = false) { - if ($allowCollectionFormatMulti && ('multi' === $collectionFormat)) { + if ($allowCollectionFormatMulti && ('multi' === $style)) { // http_build_query() almost does the job for us. We just // need to fix the result of multidimensional arrays. return preg_replace('/%5B[0-9]+%5D=/', '=', http_build_query($collection, '', '&')); } - switch ($collectionFormat) { + switch ($style) { + case 'pipeDelimited': case 'pipes': return implode('|', $collection); case 'tsv': return implode("\t", $collection); + case 'spaceDelimited': case 'ssv': return implode(' ', $collection); + case 'simple': case 'csv': // Deliberate fall through. CSV is default format. default: @@ -216,12 +271,29 @@ public static function deserialize($data, $class, $httpHeaders = null) { if (null === $data) { return null; - } elseif (substr($class, 0, 4) === 'map[') { // for associative array e.g. map[string,int] + } + + if (strcasecmp(substr($class, -2), '[]') === 0) { + $data = is_string($data) ? json_decode($data) : $data; + + if (!is_array($data)) { + throw new \InvalidArgumentException("Invalid array '$class'"); + } + + $subClass = substr($class, 0, -2); + $values = []; + foreach ($data as $key => $value) { + $values[] = self::deserialize($value, $subClass, null); + } + return $values; + } + + if (substr($class, 0, 4) === 'map[') { // for associative array e.g. map[string,int] $data = is_string($data) ? json_decode($data) : $data; settype($data, 'array'); $inner = substr($class, 4, -1); $deserialized = []; - if (strrpos($inner, ',') !== false) { + if (strrpos($inner, ",") !== false) { $subClass_array = explode(',', $inner, 2); $subClass = $subClass_array[1]; foreach ($data as $key => $value) { @@ -229,18 +301,14 @@ public static function deserialize($data, $class, $httpHeaders = null) } } return $deserialized; - } elseif (strcasecmp(substr($class, -2), '[]') === 0) { - $data = is_string($data) ? json_decode($data) : $data; - $subClass = substr($class, 0, -2); - $values = []; - foreach ($data as $key => $value) { - $values[] = self::deserialize($value, $subClass, null); - } - return $values; - } elseif ($class === 'object') { + } + + if ($class === 'object') { settype($data, 'array'); return $data; - } elseif ($class === '\DateTime') { + } + + if ($class === '\DateTime') { // Some API's return an invalid, empty string as a // date-time property. DateTime::__construct() will return // the current time for empty input which is probably not @@ -248,14 +316,27 @@ public static function deserialize($data, $class, $httpHeaders = null) // be interpreted as a missing field/value. Let's handle // this graceful. if (!empty($data)) { - return new \DateTime($data); + try { + return new \DateTime($data); + } catch (\Exception $exception) { + // Some API's return a date-time with too high nanosecond + // precision for php's DateTime to handle. This conversion + // (string -> unix timestamp -> DateTime) is a workaround + // for the problem. + return (new \DateTime())->setTimestamp(strtotime($data)); + } } else { return null; } - } elseif (in_array($class, ['DateTime', 'bool', 'boolean', 'byte', 'double', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true)) { + } + + /** @psalm-suppress ParadoxicalCondition */ + if (in_array($class, ['DateTime', 'bool', 'boolean', 'byte', 'double', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true)) { settype($data, $class); return $data; - } elseif ($class === '\SplFileObject') { + } + + if ($class === '\SplFileObject') { /** @var \Psr\Http\Message\StreamInterface $data */ // determine file name @@ -289,6 +370,8 @@ public static function deserialize($data, $class, $httpHeaders = null) $class = $subclass; } } + + /** @var ModelInterface $instance */ $instance = new $class(); foreach ($instance::openAPITypes() as $property => $type) { $propertySetter = $instance::setters()[$property]; @@ -297,12 +380,32 @@ public static function deserialize($data, $class, $httpHeaders = null) continue; } - $propertyValue = $data->{$instance::attributeMap()[$property]}; - if (isset($propertyValue)) { + if (isset($data->{$instance::attributeMap()[$property]})) { + $propertyValue = $data->{$instance::attributeMap()[$property]}; $instance->$propertySetter(self::deserialize($propertyValue, $type, null)); } } return $instance; } } + + public static function buildBetterQuery($queryParams) { + if (!is_array($queryParams)) { + throw new \InvalidArgumentException('$queryParams must be an array.'); + } + + $parts = []; + + foreach ($queryParams as $key => $value) { + if (is_array($value)) { + foreach ($value as $subValue) { + array_push($parts, $key . "[]" . "=" . urlencode($subValue)); + } + } else { + array_push($parts, $key . "=" . urlencode($value)); + } + } + + return join("&", $parts); + } } diff --git a/README.md b/README.md index 6f2e1bd..c965a85 100644 --- a/README.md +++ b/README.md @@ -40,6 +40,17 @@ And then autoload in your code: require_once 'vendor/autoload.php'; ``` +### Manual Installation + +**PLEASE NOTE:** We don't really recommend manual installation and our ability to help if this route doesn't work is minimal. We include this mostly for purposes of completeness. + +Download the files and include `autoload.php`: + +```php +=7.2.5", + "php": ">=7.2", "ext-curl": "*", "ext-json": "*", "ext-mbstring": "*", - "guzzlehttp/guzzle": "^7" + "guzzlehttp/guzzle": "^6.2" }, "require-dev": { - "squizlabs/php_codesniffer": "~2.6", - "friendsofphp/php-cs-fixer": "~2.12" + "phpunit/phpunit": "^8.0 || ^9.0", + "friendsofphp/php-cs-fixer": "^2.12" }, "autoload": { "psr-4": { "MuxPhp\\" : "MuxPhp/" } }, "autoload-dev": { - "psr-4": { "MuxPhp\\" : "test/" } + "psr-4": { "MuxPhp\\Test\\" : "test/" } } } diff --git a/docs/Api/AssetsApi.md b/docs/Api/AssetsApi.md index f66555a..b5dcc3b 100644 --- a/docs/Api/AssetsApi.md +++ b/docs/Api/AssetsApi.md @@ -1,34 +1,63 @@ # MuxPhp\AssetsApi -All URIs are relative to *https://api.mux.com* +All URIs are relative to https://api.mux.com. Method | HTTP request | Description ------------- | ------------- | ------------- -[**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 -[**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 -[**deleteAssetTrack**](AssetsApi.md#deleteAssetTrack) | **DELETE** /video/v1/assets/{ASSET_ID}/tracks/{TRACK_ID} | Delete an asset track -[**getAsset**](AssetsApi.md#getAsset) | **GET** /video/v1/assets/{ASSET_ID} | Retrieve an asset -[**getAssetInputInfo**](AssetsApi.md#getAssetInputInfo) | **GET** /video/v1/assets/{ASSET_ID}/input-info | Retrieve asset input info -[**getAssetPlaybackId**](AssetsApi.md#getAssetPlaybackId) | **GET** /video/v1/assets/{ASSET_ID}/playback-ids/{PLAYBACK_ID} | Retrieve a playback ID -[**listAssets**](AssetsApi.md#listAssets) | **GET** /video/v1/assets | List assets -[**updateAssetMasterAccess**](AssetsApi.md#updateAssetMasterAccess) | **PUT** /video/v1/assets/{ASSET_ID}/master-access | Update master access -[**updateAssetMp4Support**](AssetsApi.md#updateAssetMp4Support) | **PUT** /video/v1/assets/{ASSET_ID}/mp4-support | Update MP4 support +[**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 +[**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 +[**deleteAssetTrack()**](AssetsApi.md#deleteAssetTrack) | **DELETE** /video/v1/assets/{ASSET_ID}/tracks/{TRACK_ID} | Delete an asset track +[**getAsset()**](AssetsApi.md#getAsset) | **GET** /video/v1/assets/{ASSET_ID} | Retrieve an asset +[**getAssetInputInfo()**](AssetsApi.md#getAssetInputInfo) | **GET** /video/v1/assets/{ASSET_ID}/input-info | Retrieve asset input info +[**getAssetPlaybackId()**](AssetsApi.md#getAssetPlaybackId) | **GET** /video/v1/assets/{ASSET_ID}/playback-ids/{PLAYBACK_ID} | Retrieve a playback ID +[**listAssets()**](AssetsApi.md#listAssets) | **GET** /video/v1/assets | List assets +[**updateAssetMasterAccess()**](AssetsApi.md#updateAssetMasterAccess) | **PUT** /video/v1/assets/{ASSET_ID}/master-access | Update master access +[**updateAssetMp4Support()**](AssetsApi.md#updateAssetMp4Support) | **PUT** /video/v1/assets/{ASSET_ID}/mp4-support | Update MP4 support + + +## `createAsset()` + +```php +createAsset($create_asset_request): \MuxPhp\Models\AssetResponse +``` +Create an asset +Create a new Mux Video asset. -## createAsset +### Example -> \MuxPhp\Models\AssetResponse createAsset($create_asset_request) +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); -### Parameters +$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 +); +$create_asset_request = {"input":"https://muxed.s3.amazonaws.com/leds.mp4","playback_policy":["public"]}; // \MuxPhp\Models\CreateAssetRequest + +try { + $result = $apiInstance->createAsset($create_asset_request); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling AssetsApi->createAsset: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- @@ -44,22 +73,52 @@ Name | Type | Description | Notes ### HTTP request headers -- **Content-Type**: application/json -- **Accept**: application/json +- **Content-Type**: `application/json` +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `createAssetPlaybackId()` -## createAssetPlaybackId - -> \MuxPhp\Models\CreatePlaybackIDResponse createAssetPlaybackId($asset_id, $create_playback_id_request) +```php +createAssetPlaybackId($asset_id, $create_playback_id_request): \MuxPhp\Models\CreatePlaybackIDResponse +``` Create a playback ID -### Parameters +### 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. +$create_playback_id_request = {"policy":"public"}; // \MuxPhp\Models\CreatePlaybackIDRequest + +try { + $result = $apiInstance->createAssetPlaybackId($asset_id, $create_playback_id_request); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling AssetsApi->createAssetPlaybackId: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- @@ -76,22 +135,52 @@ Name | Type | Description | Notes ### HTTP request headers -- **Content-Type**: application/json -- **Accept**: application/json +- **Content-Type**: `application/json` +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `createAssetTrack()` -## createAssetTrack - -> \MuxPhp\Models\CreateTrackResponse createAssetTrack($asset_id, $create_track_request) +```php +createAssetTrack($asset_id, $create_track_request): \MuxPhp\Models\CreateTrackResponse +``` Create an asset track -### Parameters +### 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. +$create_track_request = {"url":"https://example.com/myVideo_en.srt","type":"text","text_type":"subtitles","language_code":"en-US","name":"English","closed_captions":true,"passthrough":"English"}; // \MuxPhp\Models\CreateTrackRequest + +try { + $result = $apiInstance->createAssetTrack($asset_id, $create_track_request); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling AssetsApi->createAssetTrack: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- @@ -108,24 +197,52 @@ Name | Type | Description | Notes ### HTTP request headers -- **Content-Type**: application/json -- **Accept**: application/json +- **Content-Type**: `application/json` +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `deleteAsset()` -## deleteAsset - -> deleteAsset($asset_id) +```php +deleteAsset($asset_id) +``` Delete an asset Deletes a video asset and all its data -### Parameters +### 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. + +try { + $apiInstance->deleteAsset($asset_id); +} catch (Exception $e) { + echo 'Exception when calling AssetsApi->deleteAsset: ', $e->getMessage(), PHP_EOL; +} +``` +### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- @@ -144,19 +261,48 @@ void (empty response body) - **Content-Type**: Not defined - **Accept**: Not defined -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `deleteAssetPlaybackId()` -## deleteAssetPlaybackId - -> deleteAssetPlaybackId($asset_id, $playback_id) +```php +deleteAssetPlaybackId($asset_id, $playback_id) +``` Delete a playback ID -### Parameters +### 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. +$playback_id = 'playback_id_example'; // string | The live stream's playback ID. + +try { + $apiInstance->deleteAssetPlaybackId($asset_id, $playback_id); +} catch (Exception $e) { + echo 'Exception when calling AssetsApi->deleteAssetPlaybackId: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- @@ -176,19 +322,48 @@ void (empty response body) - **Content-Type**: Not defined - **Accept**: Not defined -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `deleteAssetTrack()` -## deleteAssetTrack - -> deleteAssetTrack($asset_id, $track_id) +```php +deleteAssetTrack($asset_id, $track_id) +``` Delete an asset track -### Parameters +### 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. +$track_id = 'track_id_example'; // string | The track ID. + +try { + $apiInstance->deleteAssetTrack($asset_id, $track_id); +} catch (Exception $e) { + echo 'Exception when calling AssetsApi->deleteAssetTrack: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- @@ -208,21 +383,50 @@ void (empty response body) - **Content-Type**: Not defined - **Accept**: Not defined -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `getAsset()` -## getAsset - -> \MuxPhp\Models\AssetResponse getAsset($asset_id) +```php +getAsset($asset_id): \MuxPhp\Models\AssetResponse +``` Retrieve an asset Retrieves the details of an asset that has previously been created. Supply the unique asset ID that was returned from your previous request, and Mux will return the corresponding asset information. The same information is returned when creating an asset. -### Parameters +### 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. + +try { + $result = $apiInstance->getAsset($asset_id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling AssetsApi->getAsset: ', $e->getMessage(), PHP_EOL; +} +``` +### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- @@ -239,23 +443,52 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `getAssetInputInfo()` -## getAssetInputInfo - -> \MuxPhp\Models\GetAssetInputInfoResponse getAssetInputInfo($asset_id) +```php +getAssetInputInfo($asset_id): \MuxPhp\Models\GetAssetInputInfoResponse +``` Retrieve asset input info Returns a list of the input objects that were used to create the asset along with any settings that were applied to each input. -### Parameters +### 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. + +try { + $result = $apiInstance->getAssetInputInfo($asset_id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling AssetsApi->getAssetInputInfo: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- @@ -272,21 +505,51 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `getAssetPlaybackId()` -## getAssetPlaybackId - -> \MuxPhp\Models\GetAssetPlaybackIDResponse getAssetPlaybackId($asset_id, $playback_id) +```php +getAssetPlaybackId($asset_id, $playback_id): \MuxPhp\Models\GetAssetPlaybackIDResponse +``` Retrieve a playback ID -### Parameters +### 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. +$playback_id = 'playback_id_example'; // string | The live stream's playback ID. + +try { + $result = $apiInstance->getAssetPlaybackId($asset_id, $playback_id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling AssetsApi->getAssetPlaybackId: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- @@ -304,29 +567,58 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `listAssets()` -## listAssets - -> \MuxPhp\Models\ListAssetsResponse listAssets($limit, $page) +```php +listAssets($limit, $page): \MuxPhp\Models\ListAssetsResponse +``` List assets List all Mux assets. -### Parameters +### 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 +); +$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->listAssets($limit, $page); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling AssetsApi->listAssets: ', $e->getMessage(), PHP_EOL; +} +``` +### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**optional_params** | **[]** | Assocaiative Array of optional parameters, specifically: | (optional) | -**optional_params[limit]** | int | Number of items to include in the response (optional, default to 25) -**optional_params[page]** | int | Offset by this many pages, of the size of `limit` (optional, default to 1) + **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 @@ -339,23 +631,53 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `updateAssetMasterAccess()` -## updateAssetMasterAccess - -> \MuxPhp\Models\AssetResponse updateAssetMasterAccess($asset_id, $update_asset_master_access_request) +```php +updateAssetMasterAccess($asset_id, $update_asset_master_access_request): \MuxPhp\Models\AssetResponse +``` Update master access Allows you add temporary access to the master (highest-quality) version of the asset in MP4 format. A URL will be created that can be used to download the master version for 24 hours. After 24 hours Master Access will revert to \"none\". This master version is not optimized for web and not meant to be streamed, only downloaded for purposes like archiving or editing the video offline. -### Parameters +### 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. +$update_asset_master_access_request = {"master_access":"temporary"}; // \MuxPhp\Models\UpdateAssetMasterAccessRequest + +try { + $result = $apiInstance->updateAssetMasterAccess($asset_id, $update_asset_master_access_request); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling AssetsApi->updateAssetMasterAccess: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- @@ -372,24 +694,54 @@ Name | Type | Description | Notes ### HTTP request headers -- **Content-Type**: application/json -- **Accept**: application/json +- **Content-Type**: `application/json` +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `updateAssetMp4Support()` -## updateAssetMp4Support - -> \MuxPhp\Models\AssetResponse updateAssetMp4Support($asset_id, $update_asset_mp4_support_request) +```php +updateAssetMp4Support($asset_id, $update_asset_mp4_support_request): \MuxPhp\Models\AssetResponse +``` Update MP4 support Allows you add or remove mp4 support for assets that were created without it. Currently there are two values supported in this request, `standard` 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. -### Parameters +### 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. +$update_asset_mp4_support_request = {"mp4_support":"standard"}; // \MuxPhp\Models\UpdateAssetMP4SupportRequest + +try { + $result = $apiInstance->updateAssetMp4Support($asset_id, $update_asset_mp4_support_request); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling AssetsApi->updateAssetMp4Support: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- @@ -406,10 +758,9 @@ Name | Type | Description | Notes ### HTTP request headers -- **Content-Type**: application/json -- **Accept**: application/json +- **Content-Type**: `application/json` +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to 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/DeliveryUsageApi.md b/docs/Api/DeliveryUsageApi.md index a9018b6..a5c285d 100644 --- a/docs/Api/DeliveryUsageApi.md +++ b/docs/Api/DeliveryUsageApi.md @@ -1,31 +1,62 @@ # MuxPhp\DeliveryUsageApi -All URIs are relative to *https://api.mux.com* +All URIs are relative to https://api.mux.com. Method | HTTP request | Description ------------- | ------------- | ------------- -[**listDeliveryUsage**](DeliveryUsageApi.md#listDeliveryUsage) | **GET** /video/v1/delivery-usage | List Usage +[**listDeliveryUsage()**](DeliveryUsageApi.md#listDeliveryUsage) | **GET** /video/v1/delivery-usage | List Usage +## `listDeliveryUsage()` -## listDeliveryUsage - -> \MuxPhp\Models\ListDeliveryUsageResponse listDeliveryUsage($page, $limit, $asset_id, $timeframe) +```php +listDeliveryUsage($page, $limit, $asset_id, $timeframe): \MuxPhp\Models\ListDeliveryUsageResponse +``` List Usage Returns a list of delivery usage records and their associated Asset IDs or Live Stream IDs. -### Parameters +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); +$apiInstance = new MuxPhp\Api\DeliveryUsageApi( + // 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 +); +$page = 1; // int | Offset by this many pages, of the size of `limit` +$limit = 100; // int | Number of items to include in the response +$asset_id = 'asset_id_example'; // string | Filter response to return delivery usage for this asset only. +$timeframe = array('timeframe_example'); // string[] | Time window to get delivery usage information. timeframe[0] indicates the start time, timeframe[1] indicates the end time in seconds since the Unix epoch. Default time window is 1 hour representing usage from 13th to 12th hour from when the request is made. + +try { + $result = $apiInstance->listDeliveryUsage($page, $limit, $asset_id, $timeframe); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling DeliveryUsageApi->listDeliveryUsage: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**optional_params** | **[]** | Assocaiative Array of optional parameters, specifically: | (optional) | -**optional_params[page]** | int | Offset by this many pages, of the size of `limit` (optional, default to 1) -**optional_params[limit]** | int | Number of items to include in the response (optional, default to 100) -**optional_params[asset_id]** | string | Filter response to return delivery usage for this asset only. (optional) -**optional_params[timeframe]** | string[] | Time window to get delivery usage information. timeframe[0] indicates the start time, timeframe[1] indicates the end time in seconds since the Unix epoch. Default time window is 1 hour representing usage from 13th to 12th hour from when the request is made. (optional) + **page** | **int**| Offset by this many pages, of the size of `limit` | [optional] [default to 1] + **limit** | **int**| Number of items to include in the response | [optional] [default to 100] + **asset_id** | **string**| Filter response to return delivery usage for this asset only. | [optional] + **timeframe** | [**string[]**](../Model/string.md)| Time window to get delivery usage information. timeframe[0] indicates the start time, timeframe[1] indicates the end time in seconds since the Unix epoch. Default time window is 1 hour representing usage from 13th to 12th hour from when the request is made. | [optional] ### Return type @@ -38,9 +69,8 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to 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/DimensionsApi.md b/docs/Api/DimensionsApi.md index fe5ab2e..832e33a 100644 --- a/docs/Api/DimensionsApi.md +++ b/docs/Api/DimensionsApi.md @@ -1,33 +1,65 @@ # MuxPhp\DimensionsApi -All URIs are relative to *https://api.mux.com* +All URIs are relative to https://api.mux.com. Method | HTTP request | Description ------------- | ------------- | ------------- -[**listDimensionValues**](DimensionsApi.md#listDimensionValues) | **GET** /data/v1/dimensions/{DIMENSION_ID} | Lists the values for a specific dimension -[**listDimensions**](DimensionsApi.md#listDimensions) | **GET** /data/v1/dimensions | List Dimensions +[**listDimensionValues()**](DimensionsApi.md#listDimensionValues) | **GET** /data/v1/dimensions/{DIMENSION_ID} | Lists the values for a specific dimension +[**listDimensions()**](DimensionsApi.md#listDimensions) | **GET** /data/v1/dimensions | List Dimensions +## `listDimensionValues()` -## listDimensionValues - -> \MuxPhp\Models\ListDimensionValuesResponse listDimensionValues($dimension_id, $limit, $page, $filters, $timeframe) +```php +listDimensionValues($dimension_id, $limit, $page, $filters, $timeframe): \MuxPhp\Models\ListDimensionValuesResponse +``` Lists the values for a specific dimension Lists the values for a dimension along with a total count of related views. Note: This API replaces the list-filter-values API call. -### Parameters +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); +$apiInstance = new MuxPhp\Api\DimensionsApi( + // 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 +); +$dimension_id = abcd1234; // string | ID of the Dimension +$limit = 25; // int | Number of items to include in the response +$page = 1; // int | Offset by this many pages, of the size of `limit` +$filters = array('filters_example'); // string[] | Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. +$timeframe = array('timeframe_example'); // string[] | Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. + +try { + $result = $apiInstance->listDimensionValues($dimension_id, $limit, $page, $filters, $timeframe); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling DimensionsApi->listDimensionValues: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **dimension_id** | **string**| ID of the Dimension | -**optional_params** | **[]** | Assocaiative Array of optional parameters, specifically: | (optional) | -**optional_params[limit]** | int | Number of items to include in the response (optional, default to 25) -**optional_params[page]** | int | Offset by this many pages, of the size of `limit` (optional, default to 1) -**optional_params[filters]** | string[] | Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. (optional) -**optional_params[timeframe]** | string[] | Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. (optional) + **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] + **filters** | [**string[]**](../Model/string.md)| Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. | [optional] + **timeframe** | [**string[]**](../Model/string.md)| Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. | [optional] ### Return type @@ -40,21 +72,50 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `listDimensions()` -## listDimensions - -> \MuxPhp\Models\ListDimensionsResponse listDimensions() +```php +listDimensions(): \MuxPhp\Models\ListDimensionsResponse +``` List Dimensions List all available dimensions. Note: This API replaces the list-filters API call. +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new MuxPhp\Api\DimensionsApi( + // 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 +); + +try { + $result = $apiInstance->listDimensions(); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling DimensionsApi->listDimensions: ', $e->getMessage(), PHP_EOL; +} +``` + ### Parameters This endpoint does not need any parameter. @@ -70,9 +131,8 @@ This endpoint does not need any parameter. ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to 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/DirectUploadsApi.md b/docs/Api/DirectUploadsApi.md index 99b13b5..2d43d7a 100644 --- a/docs/Api/DirectUploadsApi.md +++ b/docs/Api/DirectUploadsApi.md @@ -1,27 +1,56 @@ # MuxPhp\DirectUploadsApi -All URIs are relative to *https://api.mux.com* +All URIs are relative to https://api.mux.com. Method | HTTP request | Description ------------- | ------------- | ------------- -[**cancelDirectUpload**](DirectUploadsApi.md#cancelDirectUpload) | **PUT** /video/v1/uploads/{UPLOAD_ID}/cancel | Cancel a direct upload -[**createDirectUpload**](DirectUploadsApi.md#createDirectUpload) | **POST** /video/v1/uploads | Create a new direct upload URL -[**getDirectUpload**](DirectUploadsApi.md#getDirectUpload) | **GET** /video/v1/uploads/{UPLOAD_ID} | Retrieve a single direct upload's info -[**listDirectUploads**](DirectUploadsApi.md#listDirectUploads) | **GET** /video/v1/uploads | List direct uploads +[**cancelDirectUpload()**](DirectUploadsApi.md#cancelDirectUpload) | **PUT** /video/v1/uploads/{UPLOAD_ID}/cancel | Cancel a direct upload +[**createDirectUpload()**](DirectUploadsApi.md#createDirectUpload) | **POST** /video/v1/uploads | Create a new direct upload URL +[**getDirectUpload()**](DirectUploadsApi.md#getDirectUpload) | **GET** /video/v1/uploads/{UPLOAD_ID} | Retrieve a single direct upload's info +[**listDirectUploads()**](DirectUploadsApi.md#listDirectUploads) | **GET** /video/v1/uploads | List direct uploads +## `cancelDirectUpload()` -## cancelDirectUpload - -> \MuxPhp\Models\UploadResponse cancelDirectUpload($upload_id) +```php +cancelDirectUpload($upload_id): \MuxPhp\Models\UploadResponse +``` Cancel a direct upload Cancels a direct upload and marks it as cancelled. If a pending upload finishes after this request, no asset will be created. This request will only succeed if the upload is still in the `waiting` state. -### Parameters +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); +$apiInstance = new MuxPhp\Api\DirectUploadsApi( + // 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 +); +$upload_id = abcd1234; // string | ID of the Upload + +try { + $result = $apiInstance->cancelDirectUpload($upload_id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling DirectUploadsApi->cancelDirectUpload: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **upload_id** | **string**| ID of the Upload | @@ -37,21 +66,50 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `createDirectUpload()` -## createDirectUpload - -> \MuxPhp\Models\UploadResponse createDirectUpload($create_upload_request) +```php +createDirectUpload($create_upload_request): \MuxPhp\Models\UploadResponse +``` Create a new direct upload URL -### Parameters +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + +$apiInstance = new MuxPhp\Api\DirectUploadsApi( + // 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 +); +$create_upload_request = {"cors_origin":"https://example.com/","new_asset_settings":{"playback_policy":["public"],"mp4_support":"standard"}}; // \MuxPhp\Models\CreateUploadRequest + +try { + $result = $apiInstance->createDirectUpload($create_upload_request); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling DirectUploadsApi->createDirectUpload: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- @@ -67,22 +125,51 @@ Name | Type | Description | Notes ### HTTP request headers -- **Content-Type**: application/json -- **Accept**: application/json +- **Content-Type**: `application/json` +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `getDirectUpload()` -## getDirectUpload - -> \MuxPhp\Models\UploadResponse getDirectUpload($upload_id) +```php +getDirectUpload($upload_id): \MuxPhp\Models\UploadResponse +``` Retrieve a single direct upload's info -### Parameters +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + +$apiInstance = new MuxPhp\Api\DirectUploadsApi( + // 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 +); +$upload_id = abcd1234; // string | ID of the Upload + +try { + $result = $apiInstance->getDirectUpload($upload_id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling DirectUploadsApi->getDirectUpload: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- @@ -99,27 +186,56 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `listDirectUploads()` -## listDirectUploads - -> \MuxPhp\Models\ListUploadsResponse listDirectUploads($limit, $page) +```php +listDirectUploads($limit, $page): \MuxPhp\Models\ListUploadsResponse +``` List direct uploads -### Parameters +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + +$apiInstance = new MuxPhp\Api\DirectUploadsApi( + // 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->listDirectUploads($limit, $page); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling DirectUploadsApi->listDirectUploads: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**optional_params** | **[]** | Assocaiative Array of optional parameters, specifically: | (optional) | -**optional_params[limit]** | int | Number of items to include in the response (optional, default to 25) -**optional_params[page]** | int | Offset by this many pages, of the size of `limit` (optional, default to 1) + **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 @@ -132,9 +248,8 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to 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/ErrorsApi.md b/docs/Api/ErrorsApi.md index d97647e..4c9287f 100644 --- a/docs/Api/ErrorsApi.md +++ b/docs/Api/ErrorsApi.md @@ -1,29 +1,58 @@ # MuxPhp\ErrorsApi -All URIs are relative to *https://api.mux.com* +All URIs are relative to https://api.mux.com. Method | HTTP request | Description ------------- | ------------- | ------------- -[**listErrors**](ErrorsApi.md#listErrors) | **GET** /data/v1/errors | List Errors +[**listErrors()**](ErrorsApi.md#listErrors) | **GET** /data/v1/errors | List Errors +## `listErrors()` -## listErrors - -> \MuxPhp\Models\ListErrorsResponse listErrors($filters, $timeframe) +```php +listErrors($filters, $timeframe): \MuxPhp\Models\ListErrorsResponse +``` List Errors Returns a list of errors -### Parameters +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); +$apiInstance = new MuxPhp\Api\ErrorsApi( + // 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 +); +$filters = array('filters_example'); // string[] | Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. +$timeframe = array('timeframe_example'); // string[] | Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. + +try { + $result = $apiInstance->listErrors($filters, $timeframe); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ErrorsApi->listErrors: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**optional_params** | **[]** | Assocaiative Array of optional parameters, specifically: | (optional) | -**optional_params[filters]** | string[] | Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. (optional) -**optional_params[timeframe]** | string[] | Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. (optional) + **filters** | [**string[]**](../Model/string.md)| Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. | [optional] + **timeframe** | [**string[]**](../Model/string.md)| Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. | [optional] ### Return type @@ -36,9 +65,8 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to 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/ExportsApi.md b/docs/Api/ExportsApi.md index 006e030..ee48ce1 100644 --- a/docs/Api/ExportsApi.md +++ b/docs/Api/ExportsApi.md @@ -1,21 +1,50 @@ # MuxPhp\ExportsApi -All URIs are relative to *https://api.mux.com* +All URIs are relative to https://api.mux.com. Method | HTTP request | Description ------------- | ------------- | ------------- -[**listExports**](ExportsApi.md#listExports) | **GET** /data/v1/exports | List property video view export links +[**listExports()**](ExportsApi.md#listExports) | **GET** /data/v1/exports | List property video view export links +## `listExports()` -## listExports - -> \MuxPhp\Models\ListExportsResponse listExports() +```php +listExports(): \MuxPhp\Models\ListExportsResponse +``` List property video view export links Lists the available video view exports along with URLs to retrieve them +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new MuxPhp\Api\ExportsApi( + // 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 +); + +try { + $result = $apiInstance->listExports(); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ExportsApi->listExports: ', $e->getMessage(), PHP_EOL; +} +``` + ### Parameters This endpoint does not need any parameter. @@ -31,9 +60,8 @@ This endpoint does not need any parameter. ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to 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/FiltersApi.md b/docs/Api/FiltersApi.md index 903dd22..e67060d 100644 --- a/docs/Api/FiltersApi.md +++ b/docs/Api/FiltersApi.md @@ -1,33 +1,65 @@ # MuxPhp\FiltersApi -All URIs are relative to *https://api.mux.com* +All URIs are relative to https://api.mux.com. Method | HTTP request | Description ------------- | ------------- | ------------- -[**listFilterValues**](FiltersApi.md#listFilterValues) | **GET** /data/v1/filters/{FILTER_ID} | Lists values for a specific filter -[**listFilters**](FiltersApi.md#listFilters) | **GET** /data/v1/filters | List Filters +[**listFilterValues()**](FiltersApi.md#listFilterValues) | **GET** /data/v1/filters/{FILTER_ID} | Lists values for a specific filter +[**listFilters()**](FiltersApi.md#listFilters) | **GET** /data/v1/filters | List Filters +## `listFilterValues()` -## listFilterValues - -> \MuxPhp\Models\ListFilterValuesResponse listFilterValues($filter_id, $limit, $page, $filters, $timeframe) +```php +listFilterValues($filter_id, $limit, $page, $filters, $timeframe): \MuxPhp\Models\ListFilterValuesResponse +``` Lists values for a specific filter Deprecated: The API has been replaced by the list-dimension-values API call. Lists the values for a filter along with a total count of related views. -### Parameters +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); +$apiInstance = new MuxPhp\Api\FiltersApi( + // 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 +); +$filter_id = abcd1234; // string | ID of the Filter +$limit = 25; // int | Number of items to include in the response +$page = 1; // int | Offset by this many pages, of the size of `limit` +$filters = array('filters_example'); // string[] | Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. +$timeframe = array('timeframe_example'); // string[] | Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. + +try { + $result = $apiInstance->listFilterValues($filter_id, $limit, $page, $filters, $timeframe); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling FiltersApi->listFilterValues: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **filter_id** | **string**| ID of the Filter | -**optional_params** | **[]** | Assocaiative Array of optional parameters, specifically: | (optional) | -**optional_params[limit]** | int | Number of items to include in the response (optional, default to 25) -**optional_params[page]** | int | Offset by this many pages, of the size of `limit` (optional, default to 1) -**optional_params[filters]** | string[] | Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. (optional) -**optional_params[timeframe]** | string[] | Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. (optional) + **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] + **filters** | [**string[]**](../Model/string.md)| Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. | [optional] + **timeframe** | [**string[]**](../Model/string.md)| Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. | [optional] ### Return type @@ -40,21 +72,50 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `listFilters()` -## listFilters - -> \MuxPhp\Models\ListFiltersResponse listFilters() +```php +listFilters(): \MuxPhp\Models\ListFiltersResponse +``` List Filters Deprecated: The API has been replaced by the list-dimensions API call. Lists all the filters broken out into basic and advanced. +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new MuxPhp\Api\FiltersApi( + // 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 +); + +try { + $result = $apiInstance->listFilters(); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling FiltersApi->listFilters: ', $e->getMessage(), PHP_EOL; +} +``` + ### Parameters This endpoint does not need any parameter. @@ -70,9 +131,8 @@ This endpoint does not need any parameter. ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to 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/IncidentsApi.md b/docs/Api/IncidentsApi.md index c1a11fd..deaa546 100644 --- a/docs/Api/IncidentsApi.md +++ b/docs/Api/IncidentsApi.md @@ -1,25 +1,54 @@ # MuxPhp\IncidentsApi -All URIs are relative to *https://api.mux.com* +All URIs are relative to https://api.mux.com. Method | HTTP request | Description ------------- | ------------- | ------------- -[**getIncident**](IncidentsApi.md#getIncident) | **GET** /data/v1/incidents/{INCIDENT_ID} | Get an Incident -[**listIncidents**](IncidentsApi.md#listIncidents) | **GET** /data/v1/incidents | List Incidents -[**listRelatedIncidents**](IncidentsApi.md#listRelatedIncidents) | **GET** /data/v1/incidents/{INCIDENT_ID}/related | List Related Incidents +[**getIncident()**](IncidentsApi.md#getIncident) | **GET** /data/v1/incidents/{INCIDENT_ID} | Get an Incident +[**listIncidents()**](IncidentsApi.md#listIncidents) | **GET** /data/v1/incidents | List Incidents +[**listRelatedIncidents()**](IncidentsApi.md#listRelatedIncidents) | **GET** /data/v1/incidents/{INCIDENT_ID}/related | List Related Incidents +## `getIncident()` -## getIncident - -> \MuxPhp\Models\IncidentResponse getIncident($incident_id) +```php +getIncident($incident_id): \MuxPhp\Models\IncidentResponse +``` Get an Incident Returns the details of an incident -### Parameters +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new MuxPhp\Api\IncidentsApi( + // 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 +); +$incident_id = abcd1234; // string | ID of the Incident +try { + $result = $apiInstance->getIncident($incident_id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling IncidentsApi->getIncident: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- @@ -36,33 +65,66 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `listIncidents()` -## listIncidents - -> \MuxPhp\Models\ListIncidentsResponse listIncidents($limit, $page, $order_by, $order_direction, $status, $severity) +```php +listIncidents($limit, $page, $order_by, $order_direction, $status, $severity): \MuxPhp\Models\ListIncidentsResponse +``` List Incidents Returns a list of incidents -### Parameters +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); +$apiInstance = new MuxPhp\Api\IncidentsApi( + // 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` +$order_by = 'order_by_example'; // string | Value to order the results by +$order_direction = 'order_direction_example'; // string | Sort order. +$status = 'status_example'; // string | Status to filter incidents by +$severity = 'severity_example'; // string | Severity to filter incidents by + +try { + $result = $apiInstance->listIncidents($limit, $page, $order_by, $order_direction, $status, $severity); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling IncidentsApi->listIncidents: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**optional_params** | **[]** | Assocaiative Array of optional parameters, specifically: | (optional) | -**optional_params[limit]** | int | Number of items to include in the response (optional, default to 25) -**optional_params[page]** | int | Offset by this many pages, of the size of `limit` (optional, default to 1) -**optional_params[order_by]** | string | Value to order the results by (optional) -**optional_params[order_direction]** | string | Sort order. (optional) -**optional_params[status]** | string | Status to filter incidents by (optional) -**optional_params[severity]** | string | Severity to filter incidents by (optional) + **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] + **order_by** | **string**| Value to order the results by | [optional] + **order_direction** | **string**| Sort order. | [optional] + **status** | **string**| Status to filter incidents by | [optional] + **severity** | **string**| Severity to filter incidents by | [optional] ### Return type @@ -75,32 +137,64 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `listRelatedIncidents()` -## listRelatedIncidents - -> \MuxPhp\Models\ListRelatedIncidentsResponse listRelatedIncidents($incident_id, $limit, $page, $order_by, $order_direction) +```php +listRelatedIncidents($incident_id, $limit, $page, $order_by, $order_direction): \MuxPhp\Models\ListRelatedIncidentsResponse +``` List Related Incidents Returns all the incidents that seem related to a specific incident -### Parameters +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new MuxPhp\Api\IncidentsApi( + // 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 +); +$incident_id = abcd1234; // string | ID of the Incident +$limit = 25; // int | Number of items to include in the response +$page = 1; // int | Offset by this many pages, of the size of `limit` +$order_by = 'order_by_example'; // string | Value to order the results by +$order_direction = 'order_direction_example'; // string | Sort order. + +try { + $result = $apiInstance->listRelatedIncidents($incident_id, $limit, $page, $order_by, $order_direction); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling IncidentsApi->listRelatedIncidents: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **incident_id** | **string**| ID of the Incident | -**optional_params** | **[]** | Assocaiative Array of optional parameters, specifically: | (optional) | -**optional_params[limit]** | int | Number of items to include in the response (optional, default to 25) -**optional_params[page]** | int | Offset by this many pages, of the size of `limit` (optional, default to 1) -**optional_params[order_by]** | string | Value to order the results by (optional) -**optional_params[order_direction]** | string | Sort order. (optional) + **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] + **order_by** | **string**| Value to order the results by | [optional] + **order_direction** | **string**| Sort order. | [optional] ### Return type @@ -113,9 +207,8 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to 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/LiveStreamsApi.md b/docs/Api/LiveStreamsApi.md index 08548d2..d7b43ac 100644 --- a/docs/Api/LiveStreamsApi.md +++ b/docs/Api/LiveStreamsApi.md @@ -1,33 +1,62 @@ # MuxPhp\LiveStreamsApi -All URIs are relative to *https://api.mux.com* +All URIs are relative to https://api.mux.com. Method | HTTP request | Description ------------- | ------------- | ------------- -[**createLiveStream**](LiveStreamsApi.md#createLiveStream) | **POST** /video/v1/live-streams | Create a live stream -[**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 -[**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 -[**enableLiveStream**](LiveStreamsApi.md#enableLiveStream) | **PUT** /video/v1/live-streams/{LIVE_STREAM_ID}/enable | Enable a live stream -[**getLiveStream**](LiveStreamsApi.md#getLiveStream) | **GET** /video/v1/live-streams/{LIVE_STREAM_ID} | Retrieve a live stream -[**getLiveStreamSimulcastTarget**](LiveStreamsApi.md#getLiveStreamSimulcastTarget) | **GET** /video/v1/live-streams/{LIVE_STREAM_ID}/simulcast-targets/{SIMULCAST_TARGET_ID} | Retrieve a Live Stream Simulcast Target -[**listLiveStreams**](LiveStreamsApi.md#listLiveStreams) | **GET** /video/v1/live-streams | List live streams -[**resetStreamKey**](LiveStreamsApi.md#resetStreamKey) | **POST** /video/v1/live-streams/{LIVE_STREAM_ID}/reset-stream-key | Reset a live stream’s stream key -[**signalLiveStreamComplete**](LiveStreamsApi.md#signalLiveStreamComplete) | **PUT** /video/v1/live-streams/{LIVE_STREAM_ID}/complete | Signal a live stream is finished +[**createLiveStream()**](LiveStreamsApi.md#createLiveStream) | **POST** /video/v1/live-streams | Create a live stream +[**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 +[**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 +[**enableLiveStream()**](LiveStreamsApi.md#enableLiveStream) | **PUT** /video/v1/live-streams/{LIVE_STREAM_ID}/enable | Enable a live stream +[**getLiveStream()**](LiveStreamsApi.md#getLiveStream) | **GET** /video/v1/live-streams/{LIVE_STREAM_ID} | Retrieve a live stream +[**getLiveStreamSimulcastTarget()**](LiveStreamsApi.md#getLiveStreamSimulcastTarget) | **GET** /video/v1/live-streams/{LIVE_STREAM_ID}/simulcast-targets/{SIMULCAST_TARGET_ID} | Retrieve a Live Stream Simulcast Target +[**listLiveStreams()**](LiveStreamsApi.md#listLiveStreams) | **GET** /video/v1/live-streams | List live streams +[**resetStreamKey()**](LiveStreamsApi.md#resetStreamKey) | **POST** /video/v1/live-streams/{LIVE_STREAM_ID}/reset-stream-key | Reset a live stream’s stream key +[**signalLiveStreamComplete()**](LiveStreamsApi.md#signalLiveStreamComplete) | **PUT** /video/v1/live-streams/{LIVE_STREAM_ID}/complete | Signal a live stream is finished + + +## `createLiveStream()` + +```php +createLiveStream($create_live_stream_request): \MuxPhp\Models\LiveStreamResponse +``` +Create a live stream +### Example -## createLiveStream +```php + \MuxPhp\Models\LiveStreamResponse createLiveStream($create_live_stream_request) -Create a live stream +// Configure HTTP basic authorization: accessToken +$config = MuxPhp\Configuration::getDefaultConfiguration() + ->setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); -### Parameters +$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 +); +$create_live_stream_request = {"playback_policy":"public","new_asset_settings":{"playback_policy":"public"}}; // \MuxPhp\Models\CreateLiveStreamRequest + +try { + $result = $apiInstance->createLiveStream($create_live_stream_request); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling LiveStreamsApi->createLiveStream: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- @@ -43,22 +72,52 @@ Name | Type | Description | Notes ### HTTP request headers -- **Content-Type**: application/json -- **Accept**: application/json +- **Content-Type**: `application/json` +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `createLiveStreamPlaybackId()` -## createLiveStreamPlaybackId - -> \MuxPhp\Models\CreatePlaybackIDResponse createLiveStreamPlaybackId($live_stream_id, $create_playback_id_request) +```php +createLiveStreamPlaybackId($live_stream_id, $create_playback_id_request): \MuxPhp\Models\CreatePlaybackIDResponse +``` Create a live stream playback ID -### Parameters +### 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 +$create_playback_id_request = {"policy":"signed"}; // \MuxPhp\Models\CreatePlaybackIDRequest + +try { + $result = $apiInstance->createLiveStreamPlaybackId($live_stream_id, $create_playback_id_request); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling LiveStreamsApi->createLiveStreamPlaybackId: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- @@ -75,24 +134,54 @@ Name | Type | Description | Notes ### HTTP request headers -- **Content-Type**: application/json -- **Accept**: application/json +- **Content-Type**: `application/json` +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `createLiveStreamSimulcastTarget()` -## createLiveStreamSimulcastTarget - -> \MuxPhp\Models\SimulcastTargetResponse createLiveStreamSimulcastTarget($live_stream_id, $create_simulcast_target_request) +```php +createLiveStreamSimulcastTarget($live_stream_id, $create_simulcast_target_request): \MuxPhp\Models\SimulcastTargetResponse +``` Create a live stream simulcast target Create a simulcast target for the parent live stream. Simulcast target can only be created when the parent live stream is in idle state. Only one simulcast target can be created at a time with this API. -### Parameters +### 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 +$create_simulcast_target_request = {"url":"rtmp://live.example.com/app","stream_key":"abcdefgh","passthrough":"Example"}; // \MuxPhp\Models\CreateSimulcastTargetRequest +try { + $result = $apiInstance->createLiveStreamSimulcastTarget($live_stream_id, $create_simulcast_target_request); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling LiveStreamsApi->createLiveStreamSimulcastTarget: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- @@ -109,23 +198,51 @@ Name | Type | Description | Notes ### HTTP request headers -- **Content-Type**: application/json -- **Accept**: application/json +- **Content-Type**: `application/json` +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `deleteLiveStream()` -## deleteLiveStream - -> deleteLiveStream($live_stream_id) +```php +deleteLiveStream($live_stream_id) +``` Delete a live stream -### Parameters +### 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->deleteLiveStream($live_stream_id); +} catch (Exception $e) { + echo 'Exception when calling LiveStreamsApi->deleteLiveStream: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **live_stream_id** | **string**| The live stream ID | @@ -143,19 +260,48 @@ void (empty response body) - **Content-Type**: Not defined - **Accept**: Not defined -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `deleteLiveStreamPlaybackId()` -## deleteLiveStreamPlaybackId - -> deleteLiveStreamPlaybackId($live_stream_id, $playback_id) +```php +deleteLiveStreamPlaybackId($live_stream_id, $playback_id) +``` Delete a live stream playback ID -### Parameters +### 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 +$playback_id = 'playback_id_example'; // string | The live stream's playback ID. + +try { + $apiInstance->deleteLiveStreamPlaybackId($live_stream_id, $playback_id); +} catch (Exception $e) { + echo 'Exception when calling LiveStreamsApi->deleteLiveStreamPlaybackId: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- @@ -175,21 +321,50 @@ void (empty response body) - **Content-Type**: Not defined - **Accept**: Not defined -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `deleteLiveStreamSimulcastTarget()` -## deleteLiveStreamSimulcastTarget - -> deleteLiveStreamSimulcastTarget($live_stream_id, $simulcast_target_id) +```php +deleteLiveStreamSimulcastTarget($live_stream_id, $simulcast_target_id) +``` Delete a Live Stream Simulcast Target Delete the simulcast target using the simulcast target ID returned when creating the simulcast target. Simulcast Target can only be deleted when the parent live stream is in idle state. -### Parameters +### 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 +$simulcast_target_id = 'simulcast_target_id_example'; // string | The ID of the simulcast target. + +try { + $apiInstance->deleteLiveStreamSimulcastTarget($live_stream_id, $simulcast_target_id); +} catch (Exception $e) { + echo 'Exception when calling LiveStreamsApi->deleteLiveStreamSimulcastTarget: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- @@ -209,21 +384,50 @@ void (empty response body) - **Content-Type**: Not defined - **Accept**: Not defined -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `disableLiveStream()` -## disableLiveStream - -> \MuxPhp\Models\DisableLiveStreamResponse disableLiveStream($live_stream_id) +```php +disableLiveStream($live_stream_id): \MuxPhp\Models\DisableLiveStreamResponse +``` Disable a live stream Disables a live stream, making it reject incoming RTMP streams until re-enabled. -### Parameters +### 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 { + $result = $apiInstance->disableLiveStream($live_stream_id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling LiveStreamsApi->disableLiveStream: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- @@ -240,23 +444,52 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `enableLiveStream()` -## enableLiveStream - -> \MuxPhp\Models\EnableLiveStreamResponse enableLiveStream($live_stream_id) +```php +enableLiveStream($live_stream_id): \MuxPhp\Models\EnableLiveStreamResponse +``` Enable a live stream Enables a live stream, allowing it to accept an incoming RTMP stream. -### Parameters +### 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 { + $result = $apiInstance->enableLiveStream($live_stream_id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling LiveStreamsApi->enableLiveStream: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- @@ -273,23 +506,52 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `getLiveStream()` -## getLiveStream - -> \MuxPhp\Models\LiveStreamResponse getLiveStream($live_stream_id) +```php +getLiveStream($live_stream_id): \MuxPhp\Models\LiveStreamResponse +``` Retrieve a live stream Retrieves the details of a live stream that has previously been created. Supply the unique live stream ID that was returned from your previous request, and Mux will return the corresponding live stream information. The same information is returned when creating a live stream. -### Parameters +### 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 { + $result = $apiInstance->getLiveStream($live_stream_id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling LiveStreamsApi->getLiveStream: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- @@ -306,23 +568,53 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `getLiveStreamSimulcastTarget()` -## getLiveStreamSimulcastTarget - -> \MuxPhp\Models\SimulcastTargetResponse getLiveStreamSimulcastTarget($live_stream_id, $simulcast_target_id) +```php +getLiveStreamSimulcastTarget($live_stream_id, $simulcast_target_id): \MuxPhp\Models\SimulcastTargetResponse +``` Retrieve a Live Stream Simulcast Target Retrieves the details of the simulcast target created for the parent live stream. Supply the unique live stream ID and simulcast target ID that was returned in the response of create simulcast target request, and Mux will return the corresponding information. -### Parameters +### 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 +$simulcast_target_id = 'simulcast_target_id_example'; // string | The ID of the simulcast target. + +try { + $result = $apiInstance->getLiveStreamSimulcastTarget($live_stream_id, $simulcast_target_id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling LiveStreamsApi->getLiveStreamSimulcastTarget: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- @@ -340,27 +632,56 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `listLiveStreams()` -## listLiveStreams - -> \MuxPhp\Models\ListLiveStreamsResponse listLiveStreams($limit, $page) +```php +listLiveStreams($limit, $page): \MuxPhp\Models\ListLiveStreamsResponse +``` List live streams -### Parameters +### 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 +); +$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->listLiveStreams($limit, $page); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling LiveStreamsApi->listLiveStreams: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**optional_params** | **[]** | Assocaiative Array of optional parameters, specifically: | (optional) | -**optional_params[limit]** | int | Number of items to include in the response (optional, default to 25) -**optional_params[page]** | int | Offset by this many pages, of the size of `limit` (optional, default to 1) + **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 @@ -373,24 +694,53 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `resetStreamKey()` -## resetStreamKey - -> \MuxPhp\Models\LiveStreamResponse resetStreamKey($live_stream_id) +```php +resetStreamKey($live_stream_id): \MuxPhp\Models\LiveStreamResponse +``` Reset a live stream’s stream key Reset a live stream key if you want to immediately stop the current stream key from working and create a new stream key that can be used for future broadcasts. -### Parameters +### 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 { + $result = $apiInstance->resetStreamKey($live_stream_id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling LiveStreamsApi->resetStreamKey: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **live_stream_id** | **string**| The live stream ID | @@ -406,24 +756,53 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `signalLiveStreamComplete()` -## signalLiveStreamComplete - -> \MuxPhp\Models\SignalLiveStreamCompleteResponse signalLiveStreamComplete($live_stream_id) +```php +signalLiveStreamComplete($live_stream_id): \MuxPhp\Models\SignalLiveStreamCompleteResponse +``` Signal a live stream is finished (Optional) Make the recorded asset available immediately instead of waiting for the reconnect_window. -### Parameters +### 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 { + $result = $apiInstance->signalLiveStreamComplete($live_stream_id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling LiveStreamsApi->signalLiveStreamComplete: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **live_stream_id** | **string**| The live stream ID | @@ -439,9 +818,8 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to 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/MetricsApi.md b/docs/Api/MetricsApi.md index beb1bb8..b92b7fa 100644 --- a/docs/Api/MetricsApi.md +++ b/docs/Api/MetricsApi.md @@ -1,37 +1,70 @@ # MuxPhp\MetricsApi -All URIs are relative to *https://api.mux.com* +All URIs are relative to https://api.mux.com. Method | HTTP request | Description ------------- | ------------- | ------------- -[**getMetricTimeseriesData**](MetricsApi.md#getMetricTimeseriesData) | **GET** /data/v1/metrics/{METRIC_ID}/timeseries | Get metric timeseries data -[**getOverallValues**](MetricsApi.md#getOverallValues) | **GET** /data/v1/metrics/{METRIC_ID}/overall | Get Overall values -[**listAllMetricValues**](MetricsApi.md#listAllMetricValues) | **GET** /data/v1/metrics/comparison | List all metric values -[**listBreakdownValues**](MetricsApi.md#listBreakdownValues) | **GET** /data/v1/metrics/{METRIC_ID}/breakdown | List breakdown values -[**listInsights**](MetricsApi.md#listInsights) | **GET** /data/v1/metrics/{METRIC_ID}/insights | List Insights +[**getMetricTimeseriesData()**](MetricsApi.md#getMetricTimeseriesData) | **GET** /data/v1/metrics/{METRIC_ID}/timeseries | Get metric timeseries data +[**getOverallValues()**](MetricsApi.md#getOverallValues) | **GET** /data/v1/metrics/{METRIC_ID}/overall | Get Overall values +[**listAllMetricValues()**](MetricsApi.md#listAllMetricValues) | **GET** /data/v1/metrics/comparison | List all metric values +[**listBreakdownValues()**](MetricsApi.md#listBreakdownValues) | **GET** /data/v1/metrics/{METRIC_ID}/breakdown | List breakdown values +[**listInsights()**](MetricsApi.md#listInsights) | **GET** /data/v1/metrics/{METRIC_ID}/insights | List Insights +## `getMetricTimeseriesData()` -## getMetricTimeseriesData - -> \MuxPhp\Models\GetMetricTimeseriesDataResponse getMetricTimeseriesData($metric_id, $timeframe, $filters, $measurement, $order_direction, $group_by) +```php +getMetricTimeseriesData($metric_id, $timeframe, $filters, $measurement, $order_direction, $group_by): \MuxPhp\Models\GetMetricTimeseriesDataResponse +``` Get metric timeseries data Returns timeseries data for a specific metric -### Parameters +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); +$apiInstance = new MuxPhp\Api\MetricsApi( + // 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 +); +$metric_id = video_startup_time; // string | ID of the Metric +$timeframe = array('timeframe_example'); // string[] | Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. +$filters = array('filters_example'); // string[] | Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. +$measurement = 'measurement_example'; // string | Measurement for the provided metric. If omitted, the deafult for the metric will be used. +$order_direction = 'order_direction_example'; // string | Sort order. +$group_by = 'group_by_example'; // string | Time granularity to group results by. If this value is omitted, a default granularity is chosen based on the supplied timeframe. + +try { + $result = $apiInstance->getMetricTimeseriesData($metric_id, $timeframe, $filters, $measurement, $order_direction, $group_by); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling MetricsApi->getMetricTimeseriesData: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **metric_id** | **string**| ID of the Metric | -**optional_params** | **[]** | Assocaiative Array of optional parameters, specifically: | (optional) | -**optional_params[timeframe]** | string[] | Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. (optional) -**optional_params[filters]** | string[] | Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. (optional) -**optional_params[measurement]** | string | Measurement for the provided metric. If omitted, the deafult for the metric will be used. (optional) -**optional_params[order_direction]** | string | Sort order. (optional) -**optional_params[group_by]** | string | Time granularity to group results by. If this value is omitted, a default granularity is chosen based on the supplied timeframe. (optional) + **timeframe** | [**string[]**](../Model/string.md)| Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. | [optional] + **filters** | [**string[]**](../Model/string.md)| Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. | [optional] + **measurement** | **string**| Measurement for the provided metric. If omitted, the deafult for the metric will be used. | [optional] + **order_direction** | **string**| Sort order. | [optional] + **group_by** | **string**| Time granularity to group results by. If this value is omitted, a default granularity is chosen based on the supplied timeframe. | [optional] ### Return type @@ -44,31 +77,62 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `getOverallValues()` -## getOverallValues - -> \MuxPhp\Models\GetOverallValuesResponse getOverallValues($metric_id, $timeframe, $filters, $measurement) +```php +getOverallValues($metric_id, $timeframe, $filters, $measurement): \MuxPhp\Models\GetOverallValuesResponse +``` Get Overall values Returns the overall value for a specific metric, as well as the total view count, watch time, and the Mux Global metric value for the metric. -### Parameters +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + +$apiInstance = new MuxPhp\Api\MetricsApi( + // 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 +); +$metric_id = video_startup_time; // string | ID of the Metric +$timeframe = array('timeframe_example'); // string[] | Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. +$filters = array('filters_example'); // string[] | Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. +$measurement = 'measurement_example'; // string | Measurement for the provided metric. If omitted, the deafult for the metric will be used. + +try { + $result = $apiInstance->getOverallValues($metric_id, $timeframe, $filters, $measurement); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling MetricsApi->getOverallValues: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **metric_id** | **string**| ID of the Metric | -**optional_params** | **[]** | Assocaiative Array of optional parameters, specifically: | (optional) | -**optional_params[timeframe]** | string[] | Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. (optional) -**optional_params[filters]** | string[] | Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. (optional) -**optional_params[measurement]** | string | Measurement for the provided metric. If omitted, the deafult for the metric will be used. (optional) + **timeframe** | [**string[]**](../Model/string.md)| Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. | [optional] + **filters** | [**string[]**](../Model/string.md)| Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. | [optional] + **measurement** | **string**| Measurement for the provided metric. If omitted, the deafult for the metric will be used. | [optional] ### Return type @@ -81,31 +145,62 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `listAllMetricValues()` -## listAllMetricValues - -> \MuxPhp\Models\ListAllMetricValuesResponse listAllMetricValues($timeframe, $filters, $dimension, $value) +```php +listAllMetricValues($timeframe, $filters, $dimension, $value): \MuxPhp\Models\ListAllMetricValuesResponse +``` List all metric values List all of the values across every breakdown for a specific metric -### Parameters +### Example +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new MuxPhp\Api\MetricsApi( + // 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 +); +$timeframe = array('timeframe_example'); // string[] | Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. +$filters = array('filters_example'); // string[] | Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. +$dimension = 'dimension_example'; // string | Dimension the specified value belongs to +$value = 'value_example'; // string | Value to show all available metrics for + +try { + $result = $apiInstance->listAllMetricValues($timeframe, $filters, $dimension, $value); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling MetricsApi->listAllMetricValues: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**optional_params** | **[]** | Assocaiative Array of optional parameters, specifically: | (optional) | -**optional_params[timeframe]** | string[] | Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. (optional) -**optional_params[filters]** | string[] | Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. (optional) -**optional_params[dimension]** | string | Dimension the specified value belongs to (optional) -**optional_params[value]** | string | Value to show all available metrics for (optional) + **timeframe** | [**string[]**](../Model/string.md)| Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. | [optional] + **filters** | [**string[]**](../Model/string.md)| Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. | [optional] + **dimension** | **string**| Dimension the specified value belongs to | [optional] + **value** | **string**| Value to show all available metrics for | [optional] ### Return type @@ -118,36 +213,72 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `listBreakdownValues()` -## listBreakdownValues - -> \MuxPhp\Models\ListBreakdownValuesResponse listBreakdownValues($metric_id, $group_by, $measurement, $filters, $limit, $page, $order_by, $order_direction, $timeframe) +```php +listBreakdownValues($metric_id, $group_by, $measurement, $filters, $limit, $page, $order_by, $order_direction, $timeframe): \MuxPhp\Models\ListBreakdownValuesResponse +``` List breakdown values List the breakdown values for a specific metric -### Parameters +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new MuxPhp\Api\MetricsApi( + // 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 +); +$metric_id = video_startup_time; // string | ID of the Metric +$group_by = 'group_by_example'; // string | Breakdown value to group the results by +$measurement = 'measurement_example'; // string | Measurement for the provided metric. If omitted, the deafult for the metric will be used. +$filters = array('filters_example'); // string[] | Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. +$limit = 25; // int | Number of items to include in the response +$page = 1; // int | Offset by this many pages, of the size of `limit` +$order_by = 'order_by_example'; // string | Value to order the results by +$order_direction = 'order_direction_example'; // string | Sort order. +$timeframe = array('timeframe_example'); // string[] | Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. + +try { + $result = $apiInstance->listBreakdownValues($metric_id, $group_by, $measurement, $filters, $limit, $page, $order_by, $order_direction, $timeframe); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling MetricsApi->listBreakdownValues: ', $e->getMessage(), PHP_EOL; +} +``` +### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **metric_id** | **string**| ID of the Metric | -**optional_params** | **[]** | Assocaiative Array of optional parameters, specifically: | (optional) | -**optional_params[group_by]** | string | Breakdown value to group the results by (optional) -**optional_params[measurement]** | string | Measurement for the provided metric. If omitted, the deafult for the metric will be used. (optional) -**optional_params[filters]** | string[] | Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. (optional) -**optional_params[limit]** | int | Number of items to include in the response (optional, default to 25) -**optional_params[page]** | int | Offset by this many pages, of the size of `limit` (optional, default to 1) -**optional_params[order_by]** | string | Value to order the results by (optional) -**optional_params[order_direction]** | string | Sort order. (optional) -**optional_params[timeframe]** | string[] | Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. (optional) + **group_by** | **string**| Breakdown value to group the results by | [optional] + **measurement** | **string**| Measurement for the provided metric. If omitted, the deafult for the metric will be used. | [optional] + **filters** | [**string[]**](../Model/string.md)| Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. | [optional] + **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] + **order_by** | **string**| Value to order the results by | [optional] + **order_direction** | **string**| Sort order. | [optional] + **timeframe** | [**string[]**](../Model/string.md)| Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. | [optional] ### Return type @@ -160,31 +291,62 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `listInsights()` -## listInsights - -> \MuxPhp\Models\ListInsightsResponse listInsights($metric_id, $measurement, $order_direction, $timeframe) +```php +listInsights($metric_id, $measurement, $order_direction, $timeframe): \MuxPhp\Models\ListInsightsResponse +``` List Insights Returns a list of insights for a metric. These are the worst performing values across all breakdowns sorted by how much they negatively impact a specific metric. -### Parameters +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); +$apiInstance = new MuxPhp\Api\MetricsApi( + // 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 +); +$metric_id = video_startup_time; // string | ID of the Metric +$measurement = 'measurement_example'; // string | Measurement for the provided metric. If omitted, the deafult for the metric will be used. +$order_direction = 'order_direction_example'; // string | Sort order. +$timeframe = array('timeframe_example'); // string[] | Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. + +try { + $result = $apiInstance->listInsights($metric_id, $measurement, $order_direction, $timeframe); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling MetricsApi->listInsights: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **metric_id** | **string**| ID of the Metric | -**optional_params** | **[]** | Assocaiative Array of optional parameters, specifically: | (optional) | -**optional_params[measurement]** | string | Measurement for the provided metric. If omitted, the deafult for the metric will be used. (optional) -**optional_params[order_direction]** | string | Sort order. (optional) -**optional_params[timeframe]** | string[] | Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. (optional) + **measurement** | **string**| Measurement for the provided metric. If omitted, the deafult for the metric will be used. | [optional] + **order_direction** | **string**| Sort order. | [optional] + **timeframe** | [**string[]**](../Model/string.md)| Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. | [optional] ### Return type @@ -197,9 +359,8 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to 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/PlaybackIDApi.md b/docs/Api/PlaybackIDApi.md index 2378983..3ba2b00 100644 --- a/docs/Api/PlaybackIDApi.md +++ b/docs/Api/PlaybackIDApi.md @@ -1,24 +1,53 @@ # MuxPhp\PlaybackIDApi -All URIs are relative to *https://api.mux.com* +All URIs are relative to https://api.mux.com. Method | HTTP request | Description ------------- | ------------- | ------------- -[**getAssetOrLivestreamId**](PlaybackIDApi.md#getAssetOrLivestreamId) | **GET** /video/v1/playback-ids/{PLAYBACK_ID} | Retrieve an Asset or Live Stream ID +[**getAssetOrLivestreamId()**](PlaybackIDApi.md#getAssetOrLivestreamId) | **GET** /video/v1/playback-ids/{PLAYBACK_ID} | Retrieve an Asset or Live Stream ID +## `getAssetOrLivestreamId()` -## getAssetOrLivestreamId - -> \MuxPhp\Models\GetAssetOrLiveStreamIdResponse getAssetOrLivestreamId($playback_id) +```php +getAssetOrLivestreamId($playback_id): \MuxPhp\Models\GetAssetOrLiveStreamIdResponse +``` Retrieve an Asset or Live Stream ID Retrieves the Identifier of the Asset or Live Stream associated with the Playback ID. -### Parameters +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); +$apiInstance = new MuxPhp\Api\PlaybackIDApi( + // 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 +); +$playback_id = 'playback_id_example'; // string | The live stream's playback ID. + +try { + $result = $apiInstance->getAssetOrLivestreamId($playback_id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PlaybackIDApi->getAssetOrLivestreamId: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **playback_id** | **string**| The live stream's playback ID. | @@ -34,9 +63,8 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to 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/RealTimeApi.md b/docs/Api/RealTimeApi.md index eaf2ddd..7d117d8 100644 --- a/docs/Api/RealTimeApi.md +++ b/docs/Api/RealTimeApi.md @@ -1,37 +1,70 @@ # MuxPhp\RealTimeApi -All URIs are relative to *https://api.mux.com* +All URIs are relative to https://api.mux.com. Method | HTTP request | Description ------------- | ------------- | ------------- -[**getRealtimeBreakdown**](RealTimeApi.md#getRealtimeBreakdown) | **GET** /data/v1/realtime/metrics/{REALTIME_METRIC_ID}/breakdown | Get Real-Time Breakdown -[**getRealtimeHistogramTimeseries**](RealTimeApi.md#getRealtimeHistogramTimeseries) | **GET** /data/v1/realtime/metrics/{REALTIME_METRIC_ID}/histogram-timeseries | Get Real-Time Histogram Timeseries -[**getRealtimeTimeseries**](RealTimeApi.md#getRealtimeTimeseries) | **GET** /data/v1/realtime/metrics/{REALTIME_METRIC_ID}/timeseries | Get Real-Time Timeseries -[**listRealtimeDimensions**](RealTimeApi.md#listRealtimeDimensions) | **GET** /data/v1/realtime/dimensions | List Real-Time Dimensions -[**listRealtimeMetrics**](RealTimeApi.md#listRealtimeMetrics) | **GET** /data/v1/realtime/metrics | List Real-Time Metrics +[**getRealtimeBreakdown()**](RealTimeApi.md#getRealtimeBreakdown) | **GET** /data/v1/realtime/metrics/{REALTIME_METRIC_ID}/breakdown | Get Real-Time Breakdown +[**getRealtimeHistogramTimeseries()**](RealTimeApi.md#getRealtimeHistogramTimeseries) | **GET** /data/v1/realtime/metrics/{REALTIME_METRIC_ID}/histogram-timeseries | Get Real-Time Histogram Timeseries +[**getRealtimeTimeseries()**](RealTimeApi.md#getRealtimeTimeseries) | **GET** /data/v1/realtime/metrics/{REALTIME_METRIC_ID}/timeseries | Get Real-Time Timeseries +[**listRealtimeDimensions()**](RealTimeApi.md#listRealtimeDimensions) | **GET** /data/v1/realtime/dimensions | List Real-Time Dimensions +[**listRealtimeMetrics()**](RealTimeApi.md#listRealtimeMetrics) | **GET** /data/v1/realtime/metrics | List Real-Time Metrics +## `getRealtimeBreakdown()` -## getRealtimeBreakdown - -> \MuxPhp\Models\GetRealTimeBreakdownResponse getRealtimeBreakdown($realtime_metric_id, $dimension, $timestamp, $filters, $order_by, $order_direction) +```php +getRealtimeBreakdown($realtime_metric_id, $dimension, $timestamp, $filters, $order_by, $order_direction): \MuxPhp\Models\GetRealTimeBreakdownResponse +``` Get Real-Time Breakdown Gets breakdown information for a specific dimension and metric along with the number of concurrent viewers and negative impact score. -### Parameters +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + +$apiInstance = new MuxPhp\Api\RealTimeApi( + // 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 +); +$realtime_metric_id = video-startup-time; // string | ID of the Realtime Metric +$dimension = 'dimension_example'; // string | Dimension the specified value belongs to +$timestamp = 3.4; // float | Timestamp to limit results by. This value must be provided as a unix timestamp. Defaults to the current unix timestamp. +$filters = array('filters_example'); // string[] | Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. +$order_by = 'order_by_example'; // string | Value to order the results by +$order_direction = 'order_direction_example'; // string | Sort order. + +try { + $result = $apiInstance->getRealtimeBreakdown($realtime_metric_id, $dimension, $timestamp, $filters, $order_by, $order_direction); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling RealTimeApi->getRealtimeBreakdown: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **realtime_metric_id** | **string**| ID of the Realtime Metric | -**optional_params** | **[]** | Assocaiative Array of optional parameters, specifically: | (optional) | -**optional_params[dimension]** | string | Dimension the specified value belongs to (optional) -**optional_params[timestamp]** | double | Timestamp to limit results by. This value must be provided as a unix timestamp. Defaults to the current unix timestamp. (optional) -**optional_params[filters]** | string[] | Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. (optional) -**optional_params[order_by]** | string | Value to order the results by (optional) -**optional_params[order_direction]** | string | Sort order. (optional) + **dimension** | **string**| Dimension the specified value belongs to | [optional] + **timestamp** | **float**| Timestamp to limit results by. This value must be provided as a unix timestamp. Defaults to the current unix timestamp. | [optional] + **filters** | [**string[]**](../Model/string.md)| Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. | [optional] + **order_by** | **string**| Value to order the results by | [optional] + **order_direction** | **string**| Sort order. | [optional] ### Return type @@ -44,29 +77,58 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `getRealtimeHistogramTimeseries()` -## getRealtimeHistogramTimeseries - -> \MuxPhp\Models\GetRealTimeHistogramTimeseriesResponse getRealtimeHistogramTimeseries($realtime_metric_id, $filters) +```php +getRealtimeHistogramTimeseries($realtime_metric_id, $filters): \MuxPhp\Models\GetRealTimeHistogramTimeseriesResponse +``` Get Real-Time Histogram Timeseries Gets histogram timeseries information for a specific metric. -### Parameters +### Example +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new MuxPhp\Api\RealTimeApi( + // 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 +); +$realtime_metric_id = video-startup-time; // string | ID of the Realtime Metric +$filters = array('filters_example'); // string[] | Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. + +try { + $result = $apiInstance->getRealtimeHistogramTimeseries($realtime_metric_id, $filters); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling RealTimeApi->getRealtimeHistogramTimeseries: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **realtime_metric_id** | **string**| ID of the Realtime Metric | -**optional_params** | **[]** | Assocaiative Array of optional parameters, specifically: | (optional) | -**optional_params[filters]** | string[] | Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. (optional) + **filters** | [**string[]**](../Model/string.md)| Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. | [optional] ### Return type @@ -79,29 +141,58 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `getRealtimeTimeseries()` -## getRealtimeTimeseries - -> \MuxPhp\Models\GetRealTimeTimeseriesResponse getRealtimeTimeseries($realtime_metric_id, $filters) +```php +getRealtimeTimeseries($realtime_metric_id, $filters): \MuxPhp\Models\GetRealTimeTimeseriesResponse +``` Get Real-Time Timeseries Gets Time series information for a specific metric along with the number of concurrent viewers. -### Parameters +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new MuxPhp\Api\RealTimeApi( + // 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 +); +$realtime_metric_id = video-startup-time; // string | ID of the Realtime Metric +$filters = array('filters_example'); // string[] | Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. + +try { + $result = $apiInstance->getRealtimeTimeseries($realtime_metric_id, $filters); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling RealTimeApi->getRealtimeTimeseries: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **realtime_metric_id** | **string**| ID of the Realtime Metric | -**optional_params** | **[]** | Assocaiative Array of optional parameters, specifically: | (optional) | -**optional_params[filters]** | string[] | Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. (optional) + **filters** | [**string[]**](../Model/string.md)| Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. | [optional] ### Return type @@ -114,21 +205,50 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `listRealtimeDimensions()` -## listRealtimeDimensions - -> \MuxPhp\Models\ListRealTimeDimensionsResponse listRealtimeDimensions() +```php +listRealtimeDimensions(): \MuxPhp\Models\ListRealTimeDimensionsResponse +``` List Real-Time Dimensions Lists availiable real-time dimensions +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new MuxPhp\Api\RealTimeApi( + // 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 +); + +try { + $result = $apiInstance->listRealtimeDimensions(); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling RealTimeApi->listRealtimeDimensions: ', $e->getMessage(), PHP_EOL; +} +``` + ### Parameters This endpoint does not need any parameter. @@ -144,21 +264,50 @@ This endpoint does not need any parameter. ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `listRealtimeMetrics()` -## listRealtimeMetrics - -> \MuxPhp\Models\ListRealTimeMetricsResponse listRealtimeMetrics() +```php +listRealtimeMetrics(): \MuxPhp\Models\ListRealTimeMetricsResponse +``` List Real-Time Metrics Lists availiable real-time metrics. +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new MuxPhp\Api\RealTimeApi( + // 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 +); + +try { + $result = $apiInstance->listRealtimeMetrics(); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling RealTimeApi->listRealtimeMetrics: ', $e->getMessage(), PHP_EOL; +} +``` + ### Parameters This endpoint does not need any parameter. @@ -174,9 +323,8 @@ This endpoint does not need any parameter. ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to 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/URLSigningKeysApi.md b/docs/Api/URLSigningKeysApi.md index 54c9fdd..a7cf6c0 100644 --- a/docs/Api/URLSigningKeysApi.md +++ b/docs/Api/URLSigningKeysApi.md @@ -1,24 +1,53 @@ # MuxPhp\URLSigningKeysApi -All URIs are relative to *https://api.mux.com* +All URIs are relative to https://api.mux.com. Method | HTTP request | Description ------------- | ------------- | ------------- -[**createUrlSigningKey**](URLSigningKeysApi.md#createUrlSigningKey) | **POST** /video/v1/signing-keys | Create a URL signing key -[**deleteUrlSigningKey**](URLSigningKeysApi.md#deleteUrlSigningKey) | **DELETE** /video/v1/signing-keys/{SIGNING_KEY_ID} | Delete a URL signing key -[**getUrlSigningKey**](URLSigningKeysApi.md#getUrlSigningKey) | **GET** /video/v1/signing-keys/{SIGNING_KEY_ID} | Retrieve a URL signing key -[**listUrlSigningKeys**](URLSigningKeysApi.md#listUrlSigningKeys) | **GET** /video/v1/signing-keys | List URL signing keys +[**createUrlSigningKey()**](URLSigningKeysApi.md#createUrlSigningKey) | **POST** /video/v1/signing-keys | Create a URL signing key +[**deleteUrlSigningKey()**](URLSigningKeysApi.md#deleteUrlSigningKey) | **DELETE** /video/v1/signing-keys/{SIGNING_KEY_ID} | Delete a URL signing key +[**getUrlSigningKey()**](URLSigningKeysApi.md#getUrlSigningKey) | **GET** /video/v1/signing-keys/{SIGNING_KEY_ID} | Retrieve a URL signing key +[**listUrlSigningKeys()**](URLSigningKeysApi.md#listUrlSigningKeys) | **GET** /video/v1/signing-keys | List URL signing keys +## `createUrlSigningKey()` -## createUrlSigningKey - -> \MuxPhp\Models\SigningKeyResponse createUrlSigningKey() +```php +createUrlSigningKey(): \MuxPhp\Models\SigningKeyResponse +``` Create a URL signing key Creates a new signing key pair. When creating a new signing key, the API will generate a 2048-bit RSA key-pair and return the private key and a generated key-id; the public key will be stored at Mux to validate signed tokens. +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new MuxPhp\Api\URLSigningKeysApi( + // 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 +); + +try { + $result = $apiInstance->createUrlSigningKey(); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling URLSigningKeysApi->createUrlSigningKey: ', $e->getMessage(), PHP_EOL; +} +``` + ### Parameters This endpoint does not need any parameter. @@ -34,23 +63,51 @@ This endpoint does not need any parameter. ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `deleteUrlSigningKey()` -## deleteUrlSigningKey - -> deleteUrlSigningKey($signing_key_id) +```php +deleteUrlSigningKey($signing_key_id) +``` Delete a URL signing key Deletes an existing signing key. Use with caution, as this will invalidate any existing signatures and no URLs can be signed using the key again. -### Parameters +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + +$apiInstance = new MuxPhp\Api\URLSigningKeysApi( + // 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 +); +$signing_key_id = 'signing_key_id_example'; // string | The ID of the signing key. + +try { + $apiInstance->deleteUrlSigningKey($signing_key_id); +} catch (Exception $e) { + echo 'Exception when calling URLSigningKeysApi->deleteUrlSigningKey: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- @@ -69,21 +126,50 @@ void (empty response body) - **Content-Type**: Not defined - **Accept**: Not defined -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `getUrlSigningKey()` -## getUrlSigningKey - -> \MuxPhp\Models\SigningKeyResponse getUrlSigningKey($signing_key_id) +```php +getUrlSigningKey($signing_key_id): \MuxPhp\Models\SigningKeyResponse +``` Retrieve a URL signing key Retrieves the details of a URL signing key that has previously been created. Supply the unique signing key ID that was returned from your previous request, and Mux will return the corresponding signing key information. **The private key is not returned in this response.** -### Parameters +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + +$apiInstance = new MuxPhp\Api\URLSigningKeysApi( + // 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 +); +$signing_key_id = 'signing_key_id_example'; // string | The ID of the signing key. + +try { + $result = $apiInstance->getUrlSigningKey($signing_key_id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling URLSigningKeysApi->getUrlSigningKey: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- @@ -100,29 +186,58 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `listUrlSigningKeys()` -## listUrlSigningKeys - -> \MuxPhp\Models\ListSigningKeysResponse listUrlSigningKeys($limit, $page) +```php +listUrlSigningKeys($limit, $page): \MuxPhp\Models\ListSigningKeysResponse +``` List URL signing keys Returns a list of URL signing keys. -### Parameters +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + +$apiInstance = new MuxPhp\Api\URLSigningKeysApi( + // 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->listUrlSigningKeys($limit, $page); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling URLSigningKeysApi->listUrlSigningKeys: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**optional_params** | **[]** | Assocaiative Array of optional parameters, specifically: | (optional) | -**optional_params[limit]** | int | Number of items to include in the response (optional, default to 25) -**optional_params[page]** | int | Offset by this many pages, of the size of `limit` (optional, default to 1) + **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 @@ -135,9 +250,8 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to 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/VideoViewsApi.md b/docs/Api/VideoViewsApi.md index 66d1490..162e8b8 100644 --- a/docs/Api/VideoViewsApi.md +++ b/docs/Api/VideoViewsApi.md @@ -1,24 +1,53 @@ # MuxPhp\VideoViewsApi -All URIs are relative to *https://api.mux.com* +All URIs are relative to https://api.mux.com. Method | HTTP request | Description ------------- | ------------- | ------------- -[**getVideoView**](VideoViewsApi.md#getVideoView) | **GET** /data/v1/video-views/{VIDEO_VIEW_ID} | Get a Video View -[**listVideoViews**](VideoViewsApi.md#listVideoViews) | **GET** /data/v1/video-views | List Video Views +[**getVideoView()**](VideoViewsApi.md#getVideoView) | **GET** /data/v1/video-views/{VIDEO_VIEW_ID} | Get a Video View +[**listVideoViews()**](VideoViewsApi.md#listVideoViews) | **GET** /data/v1/video-views | List Video Views +## `getVideoView()` -## getVideoView - -> \MuxPhp\Models\VideoViewResponse getVideoView($video_view_id) +```php +getVideoView($video_view_id): \MuxPhp\Models\VideoViewResponse +``` Get a Video View Returns the details of a video view -### Parameters +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new MuxPhp\Api\VideoViewsApi( + // 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 +); +$video_view_id = abcd1234; // string | ID of the Video View +try { + $result = $apiInstance->getVideoView($video_view_id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling VideoViewsApi->getVideoView: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- @@ -35,34 +64,68 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `listVideoViews()` -## listVideoViews - -> \MuxPhp\Models\ListVideoViewsResponse listVideoViews($limit, $page, $viewer_id, $error_id, $order_direction, $filters, $timeframe) +```php +listVideoViews($limit, $page, $viewer_id, $error_id, $order_direction, $filters, $timeframe): \MuxPhp\Models\ListVideoViewsResponse +``` List Video Views Returns a list of video views -### Parameters +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new MuxPhp\Api\VideoViewsApi( + // 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` +$viewer_id = 'viewer_id_example'; // string | Viewer ID to filter results by. This value may be provided by the integration, or may be created by Mux. +$error_id = 56; // int | Filter video views by the provided error ID (as returned in the error_type_id field in the list video views endpoint). If you provide any as the error ID, this will filter the results to those with any error. +$order_direction = 'order_direction_example'; // string | Sort order. +$filters = array('filters_example'); // string[] | Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. +$timeframe = array('timeframe_example'); // string[] | Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. + +try { + $result = $apiInstance->listVideoViews($limit, $page, $viewer_id, $error_id, $order_direction, $filters, $timeframe); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling VideoViewsApi->listVideoViews: ', $e->getMessage(), PHP_EOL; +} +``` +### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**optional_params** | **[]** | Assocaiative Array of optional parameters, specifically: | (optional) | -**optional_params[limit]** | int | Number of items to include in the response (optional, default to 25) -**optional_params[page]** | int | Offset by this many pages, of the size of `limit` (optional, default to 1) -**optional_params[viewer_id]** | string | Viewer ID to filter results by. This value may be provided by the integration, or may be created by Mux. (optional) -**optional_params[error_id]** | int | Filter video views by the provided error ID (as returned in the error_type_id field in the list video views endpoint). If you provide any as the error ID, this will filter the results to those with any error. (optional) -**optional_params[order_direction]** | string | Sort order. (optional) -**optional_params[filters]** | string[] | Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. (optional) -**optional_params[timeframe]** | string[] | Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. (optional) + **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] + **viewer_id** | **string**| Viewer ID to filter results by. This value may be provided by the integration, or may be created by Mux. | [optional] + **error_id** | **int**| Filter video views by the provided error ID (as returned in the error_type_id field in the list video views endpoint). If you provide any as the error ID, this will filter the results to those with any error. | [optional] + **order_direction** | **string**| Sort order. | [optional] + **filters** | [**string[]**](../Model/string.md)| Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint. | [optional] + **timeframe** | [**string[]**](../Model/string.md)| Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days. | [optional] ### Return type @@ -75,9 +138,8 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to 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/AbridgedVideoView.md b/docs/Model/AbridgedVideoView.md index 4cf3df5..d4a661c 100644 --- a/docs/Model/AbridgedVideoView.md +++ b/docs/Model/AbridgedVideoView.md @@ -4,18 +4,16 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **string** | | [optional] -**viewer_os_family** | **string** | | [optional] -**viewer_application_name** | **string** | | [optional] -**video_title** | **string** | | [optional] -**total_row_count** | **int** | | [optional] -**player_error_message** | **string** | | [optional] -**player_error_code** | **string** | | [optional] -**error_type_id** | **int** | | [optional] -**country_code** | **string** | | [optional] -**view_start** | **string** | | [optional] -**view_end** | **string** | | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**id** | **string** | | [optional] +**viewer_os_family** | **string** | | [optional] +**viewer_application_name** | **string** | | [optional] +**video_title** | **string** | | [optional] +**total_row_count** | **int** | | [optional] +**player_error_message** | **string** | | [optional] +**player_error_code** | **string** | | [optional] +**error_type_id** | **int** | | [optional] +**country_code** | **string** | | [optional] +**view_start** | **string** | | [optional] +**view_end** | **string** | | [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/Asset.md b/docs/Model/Asset.md index 4b5c990..779cf76 100644 --- a/docs/Model/Asset.md +++ b/docs/Model/Asset.md @@ -4,31 +4,29 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **string** | Unique identifier for the Asset. | [optional] -**created_at** | **string** | Time at which the object was created. Measured in seconds since the Unix epoch. | [optional] -**deleted_at** | **string** | | [optional] -**status** | **string** | The status of the asset. | [optional] -**duration** | **double** | The duration of the asset in seconds (max duration for a single asset is 24 hours). | [optional] -**max_stored_resolution** | **string** | The maximum resolution that has been stored for the asset. The asset may be delivered at lower resolutions depending on the device and bandwidth, however it cannot be delivered at a higher value than is stored. | [optional] -**max_stored_frame_rate** | **double** | The maximum frame rate that has been stored for the asset. The asset may be delivered at lower frame rates depending on the device and bandwidth, however it cannot be delivered at a higher value than is stored. This field may return -1 if the frame rate of the input cannot be reliably determined. | [optional] -**aspect_ratio** | **string** | The aspect ratio of the asset in the form of `width:height`, for example `16:9`. | [optional] -**playback_ids** | [**\MuxPhp\Models\PlaybackID[]**](PlaybackID.md) | | [optional] -**tracks** | [**\MuxPhp\Models\Track[]**](Track.md) | | [optional] -**errors** | [**\MuxPhp\Models\AssetErrors**](AssetErrors.md) | | [optional] -**per_title_encode** | **bool** | | [optional] -**is_live** | **bool** | Whether the asset is created from a live stream and the live stream is currently `active` and not in `idle` state. | [optional] -**passthrough** | **string** | Arbitrary metadata set for the asset. Max 255 characters. | [optional] -**live_stream_id** | **string** | Unique identifier for the live stream. This is an optional parameter added when the asset is created from a live stream. | [optional] -**master** | [**\MuxPhp\Models\AssetMaster**](AssetMaster.md) | | [optional] -**master_access** | **string** | | [optional] [default to 'none'] -**mp4_support** | **string** | | [optional] [default to 'none'] -**source_asset_id** | **string** | Asset Identifier of the video used as the source for creating the clip. | [optional] +**id** | **string** | Unique identifier for the Asset. | [optional] +**created_at** | **string** | Time at which the object was created. Measured in seconds since the Unix epoch. | [optional] +**deleted_at** | **string** | | [optional] +**status** | **string** | The status of the asset. | [optional] +**duration** | **double** | The duration of the asset in seconds (max duration for a single asset is 24 hours). | [optional] +**max_stored_resolution** | **string** | The maximum resolution that has been stored for the asset. The asset may be delivered at lower resolutions depending on the device and bandwidth, however it cannot be delivered at a higher value than is stored. | [optional] +**max_stored_frame_rate** | **double** | The maximum frame rate that has been stored for the asset. The asset may be delivered at lower frame rates depending on the device and bandwidth, however it cannot be delivered at a higher value than is stored. This field may return -1 if the frame rate of the input cannot be reliably determined. | [optional] +**aspect_ratio** | **string** | The aspect ratio of the asset in the form of `width:height`, for example `16:9`. | [optional] +**playback_ids** | [**\MuxPhp\Models\PlaybackID[]**](PlaybackID.md) | | [optional] +**tracks** | [**\MuxPhp\Models\Track[]**](Track.md) | | [optional] +**errors** | [**\MuxPhp\Models\AssetErrors**](AssetErrors.md) | | [optional] +**per_title_encode** | **bool** | | [optional] +**is_live** | **bool** | Whether the asset is created from a live stream and the live stream is currently `active` and not in `idle` state. | [optional] +**passthrough** | **string** | Arbitrary metadata set for the asset. Max 255 characters. | [optional] +**live_stream_id** | **string** | Unique identifier for the live stream. This is an optional parameter added when the asset is created from a live stream. | [optional] +**master** | [**\MuxPhp\Models\AssetMaster**](AssetMaster.md) | | [optional] +**master_access** | **string** | | [optional] [default to MASTER_ACCESS_NONE] +**mp4_support** | **string** | | [optional] [default to MP4_SUPPORT_NONE] +**source_asset_id** | **string** | Asset Identifier of the video used as the source for creating the clip. | [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] -**static_renditions** | [**\MuxPhp\Models\AssetStaticRenditions**](AssetStaticRenditions.md) | | [optional] -**recording_times** | [**\MuxPhp\Models\AssetRecordingTimes[]**](AssetRecordingTimes.md) | An array of individual live stream recording sessions. A recording session is created on each encoder connection during the live stream | [optional] -**non_standard_input_reasons** | [**\MuxPhp\Models\AssetNonStandardInputReasons**](AssetNonStandardInputReasons.md) | | [optional] -**test** | **bool** | Indicates this asset is a test asset if the value is `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 assets are watermarked with the Mux logo, limited to 10 seconds, and deleted after 24 hrs. | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**static_renditions** | [**\MuxPhp\Models\AssetStaticRenditions**](AssetStaticRenditions.md) | | [optional] +**recording_times** | [**\MuxPhp\Models\AssetRecordingTimes[]**](AssetRecordingTimes.md) | An array of individual live stream recording sessions. A recording session is created on each encoder connection during the live stream | [optional] +**non_standard_input_reasons** | [**\MuxPhp\Models\AssetNonStandardInputReasons**](AssetNonStandardInputReasons.md) | | [optional] +**test** | **bool** | Indicates this asset is a test asset if the value is `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 assets are watermarked with the Mux logo, limited to 10 seconds, and deleted after 24 hrs. | [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/AssetErrors.md b/docs/Model/AssetErrors.md index 7bdad5d..45c3229 100644 --- a/docs/Model/AssetErrors.md +++ b/docs/Model/AssetErrors.md @@ -4,9 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**type** | **string** | The type of error that occurred for this asset. | [optional] -**messages** | **string[]** | Error messages with more details. | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**type** | **string** | The type of error that occurred for this asset. | [optional] +**messages** | **string[]** | Error messages with more details. | [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/AssetMaster.md b/docs/Model/AssetMaster.md index b579fd3..ec1ada7 100644 --- a/docs/Model/AssetMaster.md +++ b/docs/Model/AssetMaster.md @@ -4,9 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**status** | **string** | | [optional] -**url** | **string** | | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**status** | **string** | | [optional] +**url** | **string** | | [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/AssetNonStandardInputReasons.md b/docs/Model/AssetNonStandardInputReasons.md index 09f22f1..935c901 100644 --- a/docs/Model/AssetNonStandardInputReasons.md +++ b/docs/Model/AssetNonStandardInputReasons.md @@ -4,16 +4,14 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**video_codec** | **string** | The video codec used on the input file. | [optional] -**audio_codec** | **string** | The audio codec used on the input file. | [optional] -**video_gop_size** | **string** | The video key frame Interval (also called as Group of Picture or GOP) of the input file. | [optional] -**video_frame_rate** | **string** | The video frame rate of the input file. | [optional] -**video_resolution** | **string** | The video resolution of the input file. | [optional] -**pixel_aspect_ratio** | **string** | The video pixel aspect ratio of the input file. | [optional] -**video_edit_list** | **string** | Video Edit List reason indicates that the input file's video track contains a complex Edit Decision List. | [optional] -**audio_edit_list** | **string** | Audio Edit List reason indicates that the input file's audio track contains a complex Edit Decision List. | [optional] -**unexpected_media_file_parameters** | **string** | A catch-all reason when the input file in created with non-standard encoding parameters. | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**video_codec** | **string** | The video codec used on the input file. | [optional] +**audio_codec** | **string** | The audio codec used on the input file. | [optional] +**video_gop_size** | **string** | The video key frame Interval (also called as Group of Picture or GOP) of the input file. | [optional] +**video_frame_rate** | **string** | The video frame rate of the input file. | [optional] +**video_resolution** | **string** | The video resolution of the input file. | [optional] +**pixel_aspect_ratio** | **string** | The video pixel aspect ratio of the input file. | [optional] +**video_edit_list** | **string** | Video Edit List reason indicates that the input file's video track contains a complex Edit Decision List. | [optional] +**audio_edit_list** | **string** | Audio Edit List reason indicates that the input file's audio track contains a complex Edit Decision List. | [optional] +**unexpected_media_file_parameters** | **string** | A catch-all reason when the input file in created with non-standard encoding parameters. | [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/AssetRecordingTimes.md b/docs/Model/AssetRecordingTimes.md index b374341..4c24f29 100644 --- a/docs/Model/AssetRecordingTimes.md +++ b/docs/Model/AssetRecordingTimes.md @@ -4,9 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**started_at** | [**\DateTime**](\DateTime.md) | The time at which the recording for the live stream started. The time value is Unix epoch time represented in ISO 8601 format. | [optional] -**duration** | **double** | The duration of the live stream recorded. The time value is in seconds. | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**started_at** | [**\DateTime**](\DateTime.md) | The time at which the recording for the live stream started. The time value is Unix epoch time represented in ISO 8601 format. | [optional] +**duration** | **double** | The duration of the live stream recorded. The time value is in seconds. | [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/AssetResponse.md b/docs/Model/AssetResponse.md index e99f2ca..4bd25d5 100644 --- a/docs/Model/AssetResponse.md +++ b/docs/Model/AssetResponse.md @@ -4,8 +4,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**data** | [**\MuxPhp\Models\Asset**](.md) | | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**data** | [**\MuxPhp\Models\Asset**](.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/AssetStaticRenditions.md b/docs/Model/AssetStaticRenditions.md index aa5b9b9..f42c26f 100644 --- a/docs/Model/AssetStaticRenditions.md +++ b/docs/Model/AssetStaticRenditions.md @@ -4,9 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**status** | **string** | Indicates the status of downloadable MP4 versions of this asset. | [optional] [default to 'disabled'] -**files** | [**\MuxPhp\Models\AssetStaticRenditionsFiles[]**](AssetStaticRenditionsFiles.md) | | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**status** | **string** | Indicates the status of downloadable MP4 versions of this asset. | [optional] [default to STATUS_DISABLED] +**files** | [**\MuxPhp\Models\AssetStaticRenditionsFiles[]**](AssetStaticRenditionsFiles.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/AssetStaticRenditionsFiles.md b/docs/Model/AssetStaticRenditionsFiles.md index aa5e0dc..323419f 100644 --- a/docs/Model/AssetStaticRenditionsFiles.md +++ b/docs/Model/AssetStaticRenditionsFiles.md @@ -4,13 +4,11 @@ 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** | | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - +**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** | | [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/BreakdownValue.md b/docs/Model/BreakdownValue.md index 21c966a..a23d1e1 100644 --- a/docs/Model/BreakdownValue.md +++ b/docs/Model/BreakdownValue.md @@ -4,12 +4,10 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**views** | **int** | | [optional] -**value** | **double** | | [optional] -**total_watch_time** | **int** | | [optional] -**negative_impact** | **int** | | [optional] -**field** | **string** | | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**views** | **int** | | [optional] +**value** | **double** | | [optional] +**total_watch_time** | **int** | | [optional] +**negative_impact** | **int** | | [optional] +**field** | **string** | | [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/CreateAssetRequest.md b/docs/Model/CreateAssetRequest.md index 8f135c4..e6e4cd3 100644 --- a/docs/Model/CreateAssetRequest.md +++ b/docs/Model/CreateAssetRequest.md @@ -4,15 +4,13 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**input** | [**\MuxPhp\Models\InputSettings[]**](InputSettings.md) | An array of objects that each describe an input file to be used to create the asset. As a shortcut, input can also be a string URL for a file when only one input file is used. See `input[].url` for requirements. | [optional] -**playback_policy** | [**\MuxPhp\Models\PlaybackPolicy[]**](PlaybackPolicy.md) | An array of playback policy names that you want applied to this asset and available through `playback_ids`. Options include: `\"public\"` (anyone with the playback URL can stream the asset). And `\"signed\"` (an additional access token is required to play the asset). If no playback_policy is set, the asset will have no playback IDs and will therefore not be playable. For simplicity, a single string name can be used in place of the array in the case of only one playback policy. | [optional] -**per_title_encode** | **bool** | | [optional] -**passthrough** | **string** | Arbitrary 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 (if any) of support for mp4 playback. 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 vidoes guide](/guides/video/download-your-videos) for more information. | [optional] +**input** | [**\MuxPhp\Models\InputSettings[]**](InputSettings.md) | An array of objects that each describe an input file to be used to create the asset. As a shortcut, input can also be a string URL for a file when only one input file is used. See `input[].url` for requirements. | [optional] +**playback_policy** | [**\MuxPhp\Models\PlaybackPolicy[]**](PlaybackPolicy.md) | An array of playback policy names that you want applied to this asset and available through `playback_ids`. Options include: `\"public\"` (anyone with the playback URL can stream the asset). And `\"signed\"` (an additional access token is required to play the asset). If no playback_policy is set, the asset will have no playback IDs and will therefore not be playable. For simplicity, a single string name can be used in place of the array in the case of only one playback policy. | [optional] +**per_title_encode** | **bool** | | [optional] +**passthrough** | **string** | Arbitrary 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 (if any) of support for mp4 playback. 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 vidoes guide](/guides/video/download-your-videos) 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 vidoes guide](/guides/video/download-your-videos) 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] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**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 vidoes guide](/guides/video/download-your-videos) 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] +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CreateLiveStreamRequest.md b/docs/Model/CreateLiveStreamRequest.md index c9ac166..31b8470 100644 --- a/docs/Model/CreateLiveStreamRequest.md +++ b/docs/Model/CreateLiveStreamRequest.md @@ -4,14 +4,12 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**playback_policy** | [**\MuxPhp\Models\PlaybackPolicy[]**](PlaybackPolicy.md) | | [optional] -**new_asset_settings** | [**\MuxPhp\Models\CreateAssetRequest**](CreateAssetRequest.md) | | [optional] -**reconnect_window** | **float** | When live streaming software disconnects from Mux, either intentionally or due to a drop in the network, the Reconnect Window is the time in seconds that Mux should wait for the streaming software to reconnect before considering the live stream finished and completing the recorded asset. Defaults to 60 seconds on the API if not specified. | [optional] -**passthrough** | **string** | | [optional] -**reduced_latency** | **bool** | Latency is the time from when the streamer does something in real life to when you see it happen in the player. Set this if you want lower latency for your live stream. Note: Reconnect windows are incompatible with Reduced Latency and will always be set to zero (0) seconds. Read more here: https://mux.com/blog/reduced-latency-for-mux-live-streaming-now-available/ | [optional] -**test** | **bool** | | [optional] -**simulcast_targets** | [**\MuxPhp\Models\CreateSimulcastTargetRequest[]**](CreateSimulcastTargetRequest.md) | | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - +**playback_policy** | [**\MuxPhp\Models\PlaybackPolicy[]**](PlaybackPolicy.md) | | [optional] +**new_asset_settings** | [**\MuxPhp\Models\CreateAssetRequest**](CreateAssetRequest.md) | | [optional] +**reconnect_window** | **float** | When live streaming software disconnects from Mux, either intentionally or due to a drop in the network, the Reconnect Window is the time in seconds that Mux should wait for the streaming software to reconnect before considering the live stream finished and completing the recorded asset. Defaults to 60 seconds on the API if not specified. | [optional] +**passthrough** | **string** | | [optional] +**reduced_latency** | **bool** | Latency is the time from when the streamer does something in real life to when you see it happen in the player. Set this if you want lower latency for your live stream. Note: Reconnect windows are incompatible with Reduced Latency and will always be set to zero (0) seconds. Read more here: https://mux.com/blog/reduced-latency-for-mux-live-streaming-now-available/ | [optional] +**test** | **bool** | | [optional] +**simulcast_targets** | [**\MuxPhp\Models\CreateSimulcastTargetRequest[]**](CreateSimulcastTargetRequest.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/CreatePlaybackIDRequest.md b/docs/Model/CreatePlaybackIDRequest.md index 49f8c11..eeb78bd 100644 --- a/docs/Model/CreatePlaybackIDRequest.md +++ b/docs/Model/CreatePlaybackIDRequest.md @@ -4,8 +4,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**policy** | [**\MuxPhp\Models\PlaybackPolicy**](PlaybackPolicy.md) | | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**policy** | [**\MuxPhp\Models\PlaybackPolicy**](PlaybackPolicy.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/CreatePlaybackIDResponse.md b/docs/Model/CreatePlaybackIDResponse.md index 6351205..968c6c6 100644 --- a/docs/Model/CreatePlaybackIDResponse.md +++ b/docs/Model/CreatePlaybackIDResponse.md @@ -4,8 +4,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**data** | [**\MuxPhp\Models\PlaybackID**](.md) | | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**data** | [**\MuxPhp\Models\PlaybackID**](.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/CreateSimulcastTargetRequest.md b/docs/Model/CreateSimulcastTargetRequest.md index 077435d..d3373b9 100644 --- a/docs/Model/CreateSimulcastTargetRequest.md +++ b/docs/Model/CreateSimulcastTargetRequest.md @@ -4,10 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**passthrough** | **string** | Arbitrary metadata set by you when creating a simulcast target. | [optional] -**stream_key** | **string** | Stream Key represents a stream identifier on the third party live streaming service to send the parent live stream to. | [optional] -**url** | **string** | RTMP hostname including application name for the third party live streaming service. Example: 'rtmp://live.example.com/app'. | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**passthrough** | **string** | Arbitrary metadata set by you when creating a simulcast target. | [optional] +**stream_key** | **string** | Stream Key represents a stream identifier on the third party live streaming service to send the parent live stream to. | [optional] +**url** | **string** | RTMP hostname including application name for the third party live streaming service. Example: 'rtmp://live.example.com/app'. | +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CreateTrackRequest.md b/docs/Model/CreateTrackRequest.md index bc74f05..bc61df7 100644 --- a/docs/Model/CreateTrackRequest.md +++ b/docs/Model/CreateTrackRequest.md @@ -4,14 +4,12 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**url** | **string** | | -**type** | **string** | | -**text_type** | **string** | | -**language_code** | **string** | The language code value must be a valid BCP 47 specification compliant value. For example, en for English or en-US for the US version of English. | -**name** | **string** | The name of the track containing a human-readable description. This value must be unqiue across all the text type and subtitles text type tracks. HLS manifest will associate subtitle text track with this value. For example, set the value to \"English\" for subtitles text track with language_code as en-US. If this parameter is not included, Mux will auto-populate based on the language_code value. | [optional] -**closed_captions** | **bool** | Indicates the track provides Subtitles for the Deaf or Hard-of-hearing (SDH). | [optional] -**passthrough** | **string** | Arbitrary metadata set for the track either when creating the asset or track. | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - +**url** | **string** | | +**type** | **string** | | +**text_type** | **string** | | +**language_code** | **string** | The language code value must be a valid BCP 47 specification compliant value. For example, en for English or en-US for the US version of English. | +**name** | **string** | The name of the track containing a human-readable description. This value must be unqiue across all the text type and subtitles text type tracks. HLS manifest will associate subtitle text track with this value. For example, set the value to \"English\" for subtitles text track with language_code as en-US. If this parameter is not included, Mux will auto-populate based on the language_code value. | [optional] +**closed_captions** | **bool** | Indicates the track provides Subtitles for the Deaf or Hard-of-hearing (SDH). | [optional] +**passthrough** | **string** | Arbitrary metadata set for the track either when creating the asset or track. | [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/CreateTrackResponse.md b/docs/Model/CreateTrackResponse.md index 73bb7c3..f97f9f3 100644 --- a/docs/Model/CreateTrackResponse.md +++ b/docs/Model/CreateTrackResponse.md @@ -4,8 +4,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**data** | [**\MuxPhp\Models\Track**](.md) | | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**data** | [**\MuxPhp\Models\Track**](.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/CreateUploadRequest.md b/docs/Model/CreateUploadRequest.md index cf13108..8dc08bb 100644 --- a/docs/Model/CreateUploadRequest.md +++ b/docs/Model/CreateUploadRequest.md @@ -5,10 +5,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **timeout** | **int** | Max time in seconds for the signed upload URL to be valid. If a successful upload has not occurred before the timeout limit, the direct upload is marked `timed_out` | [optional] [default to 3600] -**cors_origin** | **string** | If the upload URL will be used in a browser, you must specify the origin in order for the signed URL to have the correct CORS headers. | [optional] -**new_asset_settings** | [**\MuxPhp\Models\CreateAssetRequest**](CreateAssetRequest.md) | | -**test** | **bool** | | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**cors_origin** | **string** | If the upload URL will be used in a browser, you must specify the origin in order for the signed URL to have the correct CORS headers. | [optional] +**new_asset_settings** | [**\MuxPhp\Models\CreateAssetRequest**](CreateAssetRequest.md) | | +**test** | **bool** | | [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/DeliveryReport.md b/docs/Model/DeliveryReport.md index eb94693..2626a8c 100644 --- a/docs/Model/DeliveryReport.md +++ b/docs/Model/DeliveryReport.md @@ -4,14 +4,12 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**live_stream_id** | **string** | | [optional] -**asset_id** | **string** | | [optional] -**passthrough** | **string** | | [optional] -**created_at** | **string** | | [optional] -**asset_state** | **string** | | [optional] -**asset_duration** | **double** | | [optional] -**delivered_seconds** | **double** | | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - +**live_stream_id** | **string** | | [optional] +**asset_id** | **string** | | [optional] +**passthrough** | **string** | | [optional] +**created_at** | **string** | | [optional] +**asset_state** | **string** | | [optional] +**asset_duration** | **double** | | [optional] +**delivered_seconds** | **double** | | [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/DimensionValue.md b/docs/Model/DimensionValue.md index fb9ee71..fc74ab2 100644 --- a/docs/Model/DimensionValue.md +++ b/docs/Model/DimensionValue.md @@ -4,9 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**value** | **string** | | [optional] -**total_count** | **int** | | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**value** | **string** | | [optional] +**total_count** | **int** | | [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/DisableLiveStreamResponse.md b/docs/Model/DisableLiveStreamResponse.md index b018c23..593aaef 100644 --- a/docs/Model/DisableLiveStreamResponse.md +++ b/docs/Model/DisableLiveStreamResponse.md @@ -4,8 +4,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**data** | [**object**](.md) | | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**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/EnableLiveStreamResponse.md b/docs/Model/EnableLiveStreamResponse.md index 33a7924..301cbb5 100644 --- a/docs/Model/EnableLiveStreamResponse.md +++ b/docs/Model/EnableLiveStreamResponse.md @@ -4,8 +4,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**data** | [**object**](.md) | | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**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/Error.md b/docs/Model/Error.md index 3567606..7d1922f 100644 --- a/docs/Model/Error.md +++ b/docs/Model/Error.md @@ -4,15 +4,13 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **int** | | [optional] -**percentage** | **double** | | [optional] -**notes** | **string** | | [optional] -**message** | **string** | | [optional] -**last_seen** | **string** | | [optional] -**description** | **string** | | [optional] -**count** | **int** | | [optional] -**code** | **int** | | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**id** | **int** | | [optional] +**percentage** | **double** | | [optional] +**notes** | **string** | | [optional] +**message** | **string** | | [optional] +**last_seen** | **string** | | [optional] +**description** | **string** | | [optional] +**count** | **int** | | [optional] +**code** | **int** | | [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/FilterValue.md b/docs/Model/FilterValue.md index 7b47619..a12ab5a 100644 --- a/docs/Model/FilterValue.md +++ b/docs/Model/FilterValue.md @@ -4,9 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**value** | **string** | | [optional] -**total_count** | **int** | | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**value** | **string** | | [optional] +**total_count** | **int** | | [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/GetAssetInputInfoResponse.md b/docs/Model/GetAssetInputInfoResponse.md index ed65199..8968669 100644 --- a/docs/Model/GetAssetInputInfoResponse.md +++ b/docs/Model/GetAssetInputInfoResponse.md @@ -4,8 +4,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**data** | [**\MuxPhp\Models\InputInfo[]**](InputInfo.md) | | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**data** | [**\MuxPhp\Models\InputInfo[]**](InputInfo.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/GetAssetOrLiveStreamIdResponse.md b/docs/Model/GetAssetOrLiveStreamIdResponse.md index 42833de..c6e0456 100644 --- a/docs/Model/GetAssetOrLiveStreamIdResponse.md +++ b/docs/Model/GetAssetOrLiveStreamIdResponse.md @@ -4,8 +4,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**data** | [**\MuxPhp\Models\GetAssetOrLiveStreamIdResponseData**](GetAssetOrLiveStreamIdResponseData.md) | | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**data** | [**\MuxPhp\Models\GetAssetOrLiveStreamIdResponseData**](GetAssetOrLiveStreamIdResponseData.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/GetAssetOrLiveStreamIdResponseData.md b/docs/Model/GetAssetOrLiveStreamIdResponseData.md index 3363d02..0c2d242 100644 --- a/docs/Model/GetAssetOrLiveStreamIdResponseData.md +++ b/docs/Model/GetAssetOrLiveStreamIdResponseData.md @@ -4,10 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **string** | The Playback ID used to retrieve the corresponding asset or the live stream ID | [optional] -**policy** | [**\MuxPhp\Models\PlaybackPolicy**](PlaybackPolicy.md) | | [optional] -**object** | [**\MuxPhp\Models\GetAssetOrLiveStreamIdResponseDataObject**](GetAssetOrLiveStreamIdResponseDataObject.md) | | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**id** | **string** | The Playback ID used to retrieve the corresponding asset or the live stream ID | [optional] +**policy** | [**\MuxPhp\Models\PlaybackPolicy**](PlaybackPolicy.md) | | [optional] +**object** | [**\MuxPhp\Models\GetAssetOrLiveStreamIdResponseDataObject**](GetAssetOrLiveStreamIdResponseDataObject.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/GetAssetOrLiveStreamIdResponseDataObject.md b/docs/Model/GetAssetOrLiveStreamIdResponseDataObject.md index 3b6443a..642dbc1 100644 --- a/docs/Model/GetAssetOrLiveStreamIdResponseDataObject.md +++ b/docs/Model/GetAssetOrLiveStreamIdResponseDataObject.md @@ -4,9 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **string** | The identifier of the object. | [optional] -**type** | **string** | Identifies the object type associated with the playback ID. | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**id** | **string** | The identifier of the object. | [optional] +**type** | **string** | Identifies the object type associated with the playback ID. | [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/GetAssetPlaybackIDResponse.md b/docs/Model/GetAssetPlaybackIDResponse.md index 082bd2b..ce31622 100644 --- a/docs/Model/GetAssetPlaybackIDResponse.md +++ b/docs/Model/GetAssetPlaybackIDResponse.md @@ -4,8 +4,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**data** | [**\MuxPhp\Models\PlaybackID**](.md) | | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**data** | [**\MuxPhp\Models\PlaybackID**](.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/GetMetricTimeseriesDataResponse.md b/docs/Model/GetMetricTimeseriesDataResponse.md index 360902a..eccc292 100644 --- a/docs/Model/GetMetricTimeseriesDataResponse.md +++ b/docs/Model/GetMetricTimeseriesDataResponse.md @@ -4,10 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**data** | [**string[][]**](array.md) | | [optional] -**total_row_count** | **int** | | [optional] -**timeframe** | **int[]** | | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**data** | [**string[][]**](array.md) | | [optional] +**total_row_count** | **int** | | [optional] +**timeframe** | **int[]** | | [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/GetOverallValuesResponse.md b/docs/Model/GetOverallValuesResponse.md index 9ecd6d9..3b259a2 100644 --- a/docs/Model/GetOverallValuesResponse.md +++ b/docs/Model/GetOverallValuesResponse.md @@ -4,10 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**data** | [**\MuxPhp\Models\OverallValues**](OverallValues.md) | | [optional] -**total_row_count** | **int** | | [optional] -**timeframe** | **int[]** | | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**data** | [**\MuxPhp\Models\OverallValues**](OverallValues.md) | | [optional] +**total_row_count** | **int** | | [optional] +**timeframe** | **int[]** | | [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/GetRealTimeBreakdownResponse.md b/docs/Model/GetRealTimeBreakdownResponse.md index f4b3e2e..5df977e 100644 --- a/docs/Model/GetRealTimeBreakdownResponse.md +++ b/docs/Model/GetRealTimeBreakdownResponse.md @@ -4,10 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**data** | [**\MuxPhp\Models\RealTimeBreakdownValue[]**](RealTimeBreakdownValue.md) | | [optional] -**total_row_count** | **int** | | [optional] -**timeframe** | **int[]** | | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**data** | [**\MuxPhp\Models\RealTimeBreakdownValue[]**](RealTimeBreakdownValue.md) | | [optional] +**total_row_count** | **int** | | [optional] +**timeframe** | **int[]** | | [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/GetRealTimeHistogramTimeseriesResponse.md b/docs/Model/GetRealTimeHistogramTimeseriesResponse.md index eef4ed9..21e2059 100644 --- a/docs/Model/GetRealTimeHistogramTimeseriesResponse.md +++ b/docs/Model/GetRealTimeHistogramTimeseriesResponse.md @@ -4,11 +4,9 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**meta** | [**\MuxPhp\Models\GetRealTimeHistogramTimeseriesResponseMeta**](GetRealTimeHistogramTimeseriesResponseMeta.md) | | [optional] -**data** | [**\MuxPhp\Models\RealTimeHistogramTimeseriesDatapoint[]**](RealTimeHistogramTimeseriesDatapoint.md) | | [optional] -**total_row_count** | **int** | | [optional] -**timeframe** | **int[]** | | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**meta** | [**\MuxPhp\Models\GetRealTimeHistogramTimeseriesResponseMeta**](GetRealTimeHistogramTimeseriesResponseMeta.md) | | [optional] +**data** | [**\MuxPhp\Models\RealTimeHistogramTimeseriesDatapoint[]**](RealTimeHistogramTimeseriesDatapoint.md) | | [optional] +**total_row_count** | **int** | | [optional] +**timeframe** | **int[]** | | [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/GetRealTimeHistogramTimeseriesResponseMeta.md b/docs/Model/GetRealTimeHistogramTimeseriesResponseMeta.md index 2e217a6..98b9415 100644 --- a/docs/Model/GetRealTimeHistogramTimeseriesResponseMeta.md +++ b/docs/Model/GetRealTimeHistogramTimeseriesResponseMeta.md @@ -4,8 +4,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**buckets** | [**\MuxPhp\Models\RealTimeHistogramTimeseriesBucket[]**](RealTimeHistogramTimeseriesBucket.md) | | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**buckets** | [**\MuxPhp\Models\RealTimeHistogramTimeseriesBucket[]**](RealTimeHistogramTimeseriesBucket.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/GetRealTimeTimeseriesResponse.md b/docs/Model/GetRealTimeTimeseriesResponse.md index 78b897f..2434098 100644 --- a/docs/Model/GetRealTimeTimeseriesResponse.md +++ b/docs/Model/GetRealTimeTimeseriesResponse.md @@ -4,10 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**data** | [**\MuxPhp\Models\RealTimeTimeseriesDatapoint[]**](RealTimeTimeseriesDatapoint.md) | | [optional] -**total_row_count** | **int** | | [optional] -**timeframe** | **int[]** | | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**data** | [**\MuxPhp\Models\RealTimeTimeseriesDatapoint[]**](RealTimeTimeseriesDatapoint.md) | | [optional] +**total_row_count** | **int** | | [optional] +**timeframe** | **int[]** | | [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/Incident.md b/docs/Model/Incident.md index 34500d3..899d676 100644 --- a/docs/Model/Incident.md +++ b/docs/Model/Incident.md @@ -4,28 +4,26 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**threshold** | **double** | | [optional] -**status** | **string** | | [optional] -**started_at** | **string** | | [optional] -**severity** | **string** | | [optional] -**sample_size_unit** | **string** | | [optional] -**sample_size** | **int** | | [optional] -**resolved_at** | **string** | | [optional] -**notifications** | [**\MuxPhp\Models\IncidentNotification[]**](IncidentNotification.md) | | [optional] -**notification_rules** | [**\MuxPhp\Models\IncidentNotificationRule[]**](IncidentNotificationRule.md) | | [optional] -**measurement** | **string** | | [optional] -**measured_value_on_close** | **double** | | [optional] -**measured_value** | **double** | | [optional] -**incident_key** | **string** | | [optional] -**impact** | **string** | | [optional] -**id** | **string** | | [optional] -**error_description** | **string** | | [optional] -**description** | **string** | | [optional] -**breakdowns** | [**\MuxPhp\Models\IncidentBreakdown[]**](IncidentBreakdown.md) | | [optional] -**affected_views_per_hour_on_open** | **int** | | [optional] -**affected_views_per_hour** | **int** | | [optional] -**affected_views** | **int** | | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**threshold** | **double** | | [optional] +**status** | **string** | | [optional] +**started_at** | **string** | | [optional] +**severity** | **string** | | [optional] +**sample_size_unit** | **string** | | [optional] +**sample_size** | **int** | | [optional] +**resolved_at** | **string** | | [optional] +**notifications** | [**\MuxPhp\Models\IncidentNotification[]**](IncidentNotification.md) | | [optional] +**notification_rules** | [**\MuxPhp\Models\IncidentNotificationRule[]**](IncidentNotificationRule.md) | | [optional] +**measurement** | **string** | | [optional] +**measured_value_on_close** | **double** | | [optional] +**measured_value** | **double** | | [optional] +**incident_key** | **string** | | [optional] +**impact** | **string** | | [optional] +**id** | **string** | | [optional] +**error_description** | **string** | | [optional] +**description** | **string** | | [optional] +**breakdowns** | [**\MuxPhp\Models\IncidentBreakdown[]**](IncidentBreakdown.md) | | [optional] +**affected_views_per_hour_on_open** | **int** | | [optional] +**affected_views_per_hour** | **int** | | [optional] +**affected_views** | **int** | | [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/IncidentBreakdown.md b/docs/Model/IncidentBreakdown.md index db7789e..7f40f82 100644 --- a/docs/Model/IncidentBreakdown.md +++ b/docs/Model/IncidentBreakdown.md @@ -4,10 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**value** | **string** | | [optional] -**name** | **string** | | [optional] -**id** | **string** | | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**value** | **string** | | [optional] +**name** | **string** | | [optional] +**id** | **string** | | [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/IncidentNotification.md b/docs/Model/IncidentNotification.md index ef163cc..0c7d586 100644 --- a/docs/Model/IncidentNotification.md +++ b/docs/Model/IncidentNotification.md @@ -4,10 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**queued_at** | **string** | | [optional] -**id** | **int** | | [optional] -**attempted_at** | **string** | | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**queued_at** | **string** | | [optional] +**id** | **int** | | [optional] +**attempted_at** | **string** | | [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/IncidentNotificationRule.md b/docs/Model/IncidentNotificationRule.md index ec8a3f3..e057770 100644 --- a/docs/Model/IncidentNotificationRule.md +++ b/docs/Model/IncidentNotificationRule.md @@ -4,12 +4,10 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**status** | **string** | | [optional] -**rules** | [**\MuxPhp\Models\NotificationRule[]**](NotificationRule.md) | | [optional] -**property_id** | **string** | | [optional] -**id** | **string** | | [optional] -**action** | **string** | | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**status** | **string** | | [optional] +**rules** | [**\MuxPhp\Models\NotificationRule[]**](NotificationRule.md) | | [optional] +**property_id** | **string** | | [optional] +**id** | **string** | | [optional] +**action** | **string** | | [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/IncidentResponse.md b/docs/Model/IncidentResponse.md index 7342bb9..394fc93 100644 --- a/docs/Model/IncidentResponse.md +++ b/docs/Model/IncidentResponse.md @@ -4,9 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**data** | [**\MuxPhp\Models\Incident**](.md) | | [optional] -**timeframe** | **int[]** | | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**data** | [**\MuxPhp\Models\Incident**](.md) | | [optional] +**timeframe** | **int[]** | | [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/InputFile.md b/docs/Model/InputFile.md index cd9373b..cbd3def 100644 --- a/docs/Model/InputFile.md +++ b/docs/Model/InputFile.md @@ -4,9 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**container_format** | **string** | | [optional] -**tracks** | [**\MuxPhp\Models\InputTrack[]**](InputTrack.md) | | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**container_format** | **string** | | [optional] +**tracks** | [**\MuxPhp\Models\InputTrack[]**](InputTrack.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/InputInfo.md b/docs/Model/InputInfo.md index 16c0a2e..e36aa71 100644 --- a/docs/Model/InputInfo.md +++ b/docs/Model/InputInfo.md @@ -4,9 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**settings** | [**\MuxPhp\Models\InputSettings**](InputSettings.md) | | [optional] -**file** | [**\MuxPhp\Models\InputFile**](InputFile.md) | | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**settings** | [**\MuxPhp\Models\InputSettings**](InputSettings.md) | | [optional] +**file** | [**\MuxPhp\Models\InputFile**](InputFile.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 b055106..ba7d0fd 100644 --- a/docs/Model/InputSettings.md +++ b/docs/Model/InputSettings.md @@ -4,17 +4,15 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**url** | **string** | The web address of the file that Mux should download and use. * For subtitles text tracks, the url is the location of subtitle/captions file. Mux supports [SubRip Text (SRT)](https://en.wikipedia.org/wiki/SubRip) and [Web Video Text Tracks](https://www.w3.org/TR/webvtt1/) format for ingesting Subtitles and Closed Captions. * For Watermarking or Overlay, the url is the location of the watermark image. * When creating clips from existing Mux assets, the url is defined with `mux://assets/{asset_id}` template where `asset_id` is the Asset Identifier for creating the clip from. | [optional] -**overlay_settings** | [**\MuxPhp\Models\InputSettingsOverlaySettings**](InputSettingsOverlaySettings.md) | | [optional] -**start_time** | **double** | The time offset in seconds from the beginning of the video indicating the clip's starting marker. The default value is 0 when not included. | [optional] -**end_time** | **double** | The time offset in seconds from the beginning of the video, indicating the clip's ending marker. The default value is the duration of the video when not included. | [optional] -**type** | **string** | This parameter is required for the `text` track type. | [optional] -**text_type** | **string** | Type of text track. This parameter only supports subtitles value. For more information on Subtitles / Closed Captions, [see this blog post](https://mux.com/blog/subtitles-captions-webvtt-hls-and-those-magic-flags/). This parameter is required for `text` track type. | [optional] -**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 type and subtitles text type track. | [optional] -**name** | **string** | The name of the track containing a human-readable description. This value must be unique across all text type and subtitles `text` type tracks. The hls manifest will associate a subtitle text track with this value. For example, the value should be \"English\" for subtitles text track with language_code as en. This optional parameter should be used only for `text` type and subtitles `text` type track. 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 `text` type and subtitles `text` type tracks. | [optional] -**passthrough** | **string** | This optional parameter should be used for `text` type and subtitles `text` type tracks. | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**url** | **string** | The web address of the file that Mux should download and use. * For subtitles text tracks, the url is the location of subtitle/captions file. Mux supports [SubRip Text (SRT)](https://en.wikipedia.org/wiki/SubRip) and [Web Video Text Tracks](https://www.w3.org/TR/webvtt1/) format for ingesting Subtitles and Closed Captions. * For Watermarking or Overlay, the url is the location of the watermark image. * When creating clips from existing Mux assets, the url is defined with `mux://assets/{asset_id}` template where `asset_id` is the Asset Identifier for creating the clip from. | [optional] +**overlay_settings** | [**\MuxPhp\Models\InputSettingsOverlaySettings**](InputSettingsOverlaySettings.md) | | [optional] +**start_time** | **double** | The time offset in seconds from the beginning of the video indicating the clip's starting marker. The default value is 0 when not included. | [optional] +**end_time** | **double** | The time offset in seconds from the beginning of the video, indicating the clip's ending marker. The default value is the duration of the video when not included. | [optional] +**type** | **string** | This parameter is required for the `text` track type. | [optional] +**text_type** | **string** | Type of text track. This parameter only supports subtitles value. For more information on Subtitles / Closed Captions, [see this blog post](https://mux.com/blog/subtitles-captions-webvtt-hls-and-those-magic-flags/). This parameter is required for `text` track type. | [optional] +**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 type and subtitles text type track. | [optional] +**name** | **string** | The name of the track containing a human-readable description. This value must be unique across all text type and subtitles `text` type tracks. The hls manifest will associate a subtitle text track with this value. For example, the value should be \"English\" for subtitles text track with language_code as en. This optional parameter should be used only for `text` type and subtitles `text` type track. 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 `text` type and subtitles `text` type tracks. | [optional] +**passthrough** | **string** | This optional parameter should be used for `text` type and subtitles `text` type tracks. | [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/InputSettingsOverlaySettings.md b/docs/Model/InputSettingsOverlaySettings.md index 69a03d0..1f82e41 100644 --- a/docs/Model/InputSettingsOverlaySettings.md +++ b/docs/Model/InputSettingsOverlaySettings.md @@ -4,14 +4,12 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**vertical_align** | **string** | Where the vertical positioning of the overlay/watermark should begin from. Defaults to `\"top\"` | [optional] -**vertical_margin** | **string** | The distance from the vertical_align starting point and the image's closest edge. Can be expressed as a percent (\"10%\") or as a pixel value (\"100px\"). Negative values will move the overlay offscreen. In the case of 'middle', a positive value will shift the overlay towards the bottom and and a negative value will shift it towards the top. | [optional] -**horizontal_align** | **string** | Where the horizontal positioning of the overlay/watermark should begin from. | [optional] -**horizontal_margin** | **string** | The distance from the horizontal_align starting point and the image's closest edge. Can be expressed as a percent (\"10%\") or as a pixel value (\"100px\"). Negative values will move the overlay offscreen. In the case of 'center', a positive value will shift the image towards the right and and a negative value will shift it towards the left. | [optional] -**width** | **string** | How wide the overlay should appear. Can be expressed as a percent (\"10%\") or as a pixel value (\"100px\"). If both width and height are left blank the width will be the true pixels of the image, applied as if the video has been scaled to fit a 1920x1080 frame. If height is supplied with no width, the width will scale proportionally to the height. | [optional] -**height** | **string** | How tall the overlay should appear. Can be expressed as a percent (\"10%\") or as a pixel value (\"100px\"). If both width and height are left blank the height will be the true pixels of the image, applied as if the video has been scaled to fit a 1920x1080 frame. If width is supplied with no height, the height will scale proportionally to the width. | [optional] -**opacity** | **string** | How opaque the overlay should appear, expressed as a percent. (Default 100%) | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - +**vertical_align** | **string** | Where the vertical positioning of the overlay/watermark should begin from. Defaults to `\"top\"` | [optional] +**vertical_margin** | **string** | The distance from the vertical_align starting point and the image's closest edge. Can be expressed as a percent (\"10%\") or as a pixel value (\"100px\"). Negative values will move the overlay offscreen. In the case of 'middle', a positive value will shift the overlay towards the bottom and and a negative value will shift it towards the top. | [optional] +**horizontal_align** | **string** | Where the horizontal positioning of the overlay/watermark should begin from. | [optional] +**horizontal_margin** | **string** | The distance from the horizontal_align starting point and the image's closest edge. Can be expressed as a percent (\"10%\") or as a pixel value (\"100px\"). Negative values will move the overlay offscreen. In the case of 'center', a positive value will shift the image towards the right and and a negative value will shift it towards the left. | [optional] +**width** | **string** | How wide the overlay should appear. Can be expressed as a percent (\"10%\") or as a pixel value (\"100px\"). If both width and height are left blank the width will be the true pixels of the image, applied as if the video has been scaled to fit a 1920x1080 frame. If height is supplied with no width, the width will scale proportionally to the height. | [optional] +**height** | **string** | How tall the overlay should appear. Can be expressed as a percent (\"10%\") or as a pixel value (\"100px\"). If both width and height are left blank the height will be the true pixels of the image, applied as if the video has been scaled to fit a 1920x1080 frame. If width is supplied with no height, the height will scale proportionally to the width. | [optional] +**opacity** | **string** | How opaque the overlay should appear, expressed as a percent. (Default 100%) | [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/InputTrack.md b/docs/Model/InputTrack.md index 056657c..e0758a3 100644 --- a/docs/Model/InputTrack.md +++ b/docs/Model/InputTrack.md @@ -4,16 +4,14 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**type** | **string** | | [optional] -**duration** | **double** | | [optional] -**encoding** | **string** | | [optional] -**width** | **int** | | [optional] -**height** | **int** | | [optional] -**frame_rate** | **double** | | [optional] -**sample_rate** | **int** | | [optional] -**sample_size** | **int** | | [optional] -**channels** | **int** | | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**type** | **string** | | [optional] +**duration** | **double** | | [optional] +**encoding** | **string** | | [optional] +**width** | **int** | | [optional] +**height** | **int** | | [optional] +**frame_rate** | **double** | | [optional] +**sample_rate** | **int** | | [optional] +**sample_size** | **int** | | [optional] +**channels** | **int** | | [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/Insight.md b/docs/Model/Insight.md index 1f4b680..f1c9704 100644 --- a/docs/Model/Insight.md +++ b/docs/Model/Insight.md @@ -4,13 +4,11 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**total_watch_time** | **int** | | [optional] -**total_views** | **int** | | [optional] -**negative_impact_score** | **float** | | [optional] -**metric** | **double** | | [optional] -**filter_value** | **string** | | [optional] -**filter_column** | **string** | | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - +**total_watch_time** | **int** | | [optional] +**total_views** | **int** | | [optional] +**negative_impact_score** | **float** | | [optional] +**metric** | **double** | | [optional] +**filter_value** | **string** | | [optional] +**filter_column** | **string** | | [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/ListAllMetricValuesResponse.md b/docs/Model/ListAllMetricValuesResponse.md index f9e704b..2bc04ce 100644 --- a/docs/Model/ListAllMetricValuesResponse.md +++ b/docs/Model/ListAllMetricValuesResponse.md @@ -4,10 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**data** | [**\MuxPhp\Models\Score[]**](Score.md) | | [optional] -**total_row_count** | **int** | | [optional] -**timeframe** | **int[]** | | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**data** | [**\MuxPhp\Models\Score[]**](Score.md) | | [optional] +**total_row_count** | **int** | | [optional] +**timeframe** | **int[]** | | [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/ListAssetsResponse.md b/docs/Model/ListAssetsResponse.md index b948ab3..f987f84 100644 --- a/docs/Model/ListAssetsResponse.md +++ b/docs/Model/ListAssetsResponse.md @@ -4,8 +4,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**data** | [**\MuxPhp\Models\Asset[]**](Asset.md) | | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**data** | [**\MuxPhp\Models\Asset[]**](Asset.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/ListBreakdownValuesResponse.md b/docs/Model/ListBreakdownValuesResponse.md index d1a5d37..b818bf5 100644 --- a/docs/Model/ListBreakdownValuesResponse.md +++ b/docs/Model/ListBreakdownValuesResponse.md @@ -4,10 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**data** | [**\MuxPhp\Models\BreakdownValue[]**](BreakdownValue.md) | | [optional] -**total_row_count** | **int** | | [optional] -**timeframe** | **int[]** | | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**data** | [**\MuxPhp\Models\BreakdownValue[]**](BreakdownValue.md) | | [optional] +**total_row_count** | **int** | | [optional] +**timeframe** | **int[]** | | [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/ListDeliveryUsageResponse.md b/docs/Model/ListDeliveryUsageResponse.md index fd9d49d..56a4840 100644 --- a/docs/Model/ListDeliveryUsageResponse.md +++ b/docs/Model/ListDeliveryUsageResponse.md @@ -4,11 +4,9 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**data** | [**\MuxPhp\Models\DeliveryReport[]**](DeliveryReport.md) | | [optional] -**total_row_count** | **int** | | [optional] -**timeframe** | **int[]** | | [optional] -**limit** | **int** | Number of assets returned in this response. Default value is 100. | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**data** | [**\MuxPhp\Models\DeliveryReport[]**](DeliveryReport.md) | | [optional] +**total_row_count** | **int** | | [optional] +**timeframe** | **int[]** | | [optional] +**limit** | **int** | Number of assets returned in this response. Default value is 100. | [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/ListDimensionValuesResponse.md b/docs/Model/ListDimensionValuesResponse.md index 73152a9..fb139d8 100644 --- a/docs/Model/ListDimensionValuesResponse.md +++ b/docs/Model/ListDimensionValuesResponse.md @@ -4,10 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**data** | [**\MuxPhp\Models\DimensionValue[]**](DimensionValue.md) | | [optional] -**total_row_count** | **int** | | [optional] -**timeframe** | **int[]** | | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**data** | [**\MuxPhp\Models\DimensionValue[]**](DimensionValue.md) | | [optional] +**total_row_count** | **int** | | [optional] +**timeframe** | **int[]** | | [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/ListDimensionsResponse.md b/docs/Model/ListDimensionsResponse.md index e19c40b..4f6499a 100644 --- a/docs/Model/ListDimensionsResponse.md +++ b/docs/Model/ListDimensionsResponse.md @@ -4,10 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**data** | [**\MuxPhp\Models\ListFiltersResponseData**](ListFiltersResponseData.md) | | [optional] -**total_row_count** | **int** | | [optional] -**timeframe** | **int[]** | | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**data** | [**\MuxPhp\Models\ListFiltersResponseData**](ListFiltersResponseData.md) | | [optional] +**total_row_count** | **int** | | [optional] +**timeframe** | **int[]** | | [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/ListErrorsResponse.md b/docs/Model/ListErrorsResponse.md index 3b227da..05ab4a4 100644 --- a/docs/Model/ListErrorsResponse.md +++ b/docs/Model/ListErrorsResponse.md @@ -4,10 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**data** | [**\MuxPhp\Models\Error[]**](Error.md) | | [optional] -**total_row_count** | **int** | | [optional] -**timeframe** | **int[]** | | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**data** | [**\MuxPhp\Models\Error[]**](Error.md) | | [optional] +**total_row_count** | **int** | | [optional] +**timeframe** | **int[]** | | [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/ListExportsResponse.md b/docs/Model/ListExportsResponse.md index e1bebc8..f02ea24 100644 --- a/docs/Model/ListExportsResponse.md +++ b/docs/Model/ListExportsResponse.md @@ -4,10 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**data** | **string[]** | | [optional] -**total_row_count** | **int** | | [optional] -**timeframe** | **int[]** | | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**data** | **string[]** | | [optional] +**total_row_count** | **int** | | [optional] +**timeframe** | **int[]** | | [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/ListFilterValuesResponse.md b/docs/Model/ListFilterValuesResponse.md index 732e752..8ed0967 100644 --- a/docs/Model/ListFilterValuesResponse.md +++ b/docs/Model/ListFilterValuesResponse.md @@ -4,10 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**data** | [**\MuxPhp\Models\FilterValue[]**](FilterValue.md) | | [optional] -**total_row_count** | **int** | | [optional] -**timeframe** | **int[]** | | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**data** | [**\MuxPhp\Models\FilterValue[]**](FilterValue.md) | | [optional] +**total_row_count** | **int** | | [optional] +**timeframe** | **int[]** | | [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/ListFiltersResponse.md b/docs/Model/ListFiltersResponse.md index 38d7b2c..dbd9449 100644 --- a/docs/Model/ListFiltersResponse.md +++ b/docs/Model/ListFiltersResponse.md @@ -4,10 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**data** | [**\MuxPhp\Models\ListFiltersResponseData**](ListFiltersResponseData.md) | | [optional] -**total_row_count** | **int** | | [optional] -**timeframe** | **int[]** | | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**data** | [**\MuxPhp\Models\ListFiltersResponseData**](ListFiltersResponseData.md) | | [optional] +**total_row_count** | **int** | | [optional] +**timeframe** | **int[]** | | [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/ListFiltersResponseData.md b/docs/Model/ListFiltersResponseData.md index 4964634..0ed722c 100644 --- a/docs/Model/ListFiltersResponseData.md +++ b/docs/Model/ListFiltersResponseData.md @@ -4,9 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**basic** | **string[]** | | [optional] -**advanced** | **string[]** | | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**basic** | **string[]** | | [optional] +**advanced** | **string[]** | | [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/ListIncidentsResponse.md b/docs/Model/ListIncidentsResponse.md index a98382f..8ba34fc 100644 --- a/docs/Model/ListIncidentsResponse.md +++ b/docs/Model/ListIncidentsResponse.md @@ -4,10 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**data** | [**\MuxPhp\Models\Incident[]**](Incident.md) | | [optional] -**total_row_count** | **int** | | [optional] -**timeframe** | **int[]** | | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**data** | [**\MuxPhp\Models\Incident[]**](Incident.md) | | [optional] +**total_row_count** | **int** | | [optional] +**timeframe** | **int[]** | | [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/ListInsightsResponse.md b/docs/Model/ListInsightsResponse.md index 447191a..360a21f 100644 --- a/docs/Model/ListInsightsResponse.md +++ b/docs/Model/ListInsightsResponse.md @@ -4,10 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**data** | [**\MuxPhp\Models\Insight[]**](Insight.md) | | [optional] -**total_row_count** | **int** | | [optional] -**timeframe** | **int[]** | | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**data** | [**\MuxPhp\Models\Insight[]**](Insight.md) | | [optional] +**total_row_count** | **int** | | [optional] +**timeframe** | **int[]** | | [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/ListLiveStreamsResponse.md b/docs/Model/ListLiveStreamsResponse.md index ac53cda..6d68b21 100644 --- a/docs/Model/ListLiveStreamsResponse.md +++ b/docs/Model/ListLiveStreamsResponse.md @@ -4,8 +4,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**data** | [**\MuxPhp\Models\LiveStream[]**](LiveStream.md) | | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**data** | [**\MuxPhp\Models\LiveStream[]**](LiveStream.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/ListRealTimeDimensionsResponse.md b/docs/Model/ListRealTimeDimensionsResponse.md index da0bc36..2aa63c0 100644 --- a/docs/Model/ListRealTimeDimensionsResponse.md +++ b/docs/Model/ListRealTimeDimensionsResponse.md @@ -4,10 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**data** | [**\MuxPhp\Models\ListRealTimeDimensionsResponseData[]**](ListRealTimeDimensionsResponseData.md) | | [optional] -**total_row_count** | **int** | | [optional] -**timeframe** | **int[]** | | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**data** | [**\MuxPhp\Models\ListRealTimeDimensionsResponseData[]**](ListRealTimeDimensionsResponseData.md) | | [optional] +**total_row_count** | **int** | | [optional] +**timeframe** | **int[]** | | [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/ListRealTimeDimensionsResponseData.md b/docs/Model/ListRealTimeDimensionsResponseData.md index 0558c57..302b5bd 100644 --- a/docs/Model/ListRealTimeDimensionsResponseData.md +++ b/docs/Model/ListRealTimeDimensionsResponseData.md @@ -4,9 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**name** | **string** | | [optional] -**display_name** | **string** | | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**name** | **string** | | [optional] +**display_name** | **string** | | [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/ListRealTimeMetricsResponse.md b/docs/Model/ListRealTimeMetricsResponse.md index 9fec385..ad69bea 100644 --- a/docs/Model/ListRealTimeMetricsResponse.md +++ b/docs/Model/ListRealTimeMetricsResponse.md @@ -4,10 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**data** | [**\MuxPhp\Models\ListRealTimeDimensionsResponseData[]**](ListRealTimeDimensionsResponseData.md) | | [optional] -**total_row_count** | **int** | | [optional] -**timeframe** | **int[]** | | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**data** | [**\MuxPhp\Models\ListRealTimeDimensionsResponseData[]**](ListRealTimeDimensionsResponseData.md) | | [optional] +**total_row_count** | **int** | | [optional] +**timeframe** | **int[]** | | [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/ListRelatedIncidentsResponse.md b/docs/Model/ListRelatedIncidentsResponse.md index 25e5c4d..759116e 100644 --- a/docs/Model/ListRelatedIncidentsResponse.md +++ b/docs/Model/ListRelatedIncidentsResponse.md @@ -4,10 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**data** | [**\MuxPhp\Models\Incident[]**](Incident.md) | | [optional] -**total_row_count** | **int** | | [optional] -**timeframe** | **int[]** | | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**data** | [**\MuxPhp\Models\Incident[]**](Incident.md) | | [optional] +**total_row_count** | **int** | | [optional] +**timeframe** | **int[]** | | [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/ListSigningKeysResponse.md b/docs/Model/ListSigningKeysResponse.md index 1101e30..f28217c 100644 --- a/docs/Model/ListSigningKeysResponse.md +++ b/docs/Model/ListSigningKeysResponse.md @@ -4,8 +4,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**data** | [**\MuxPhp\Models\SigningKey[]**](SigningKey.md) | | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**data** | [**\MuxPhp\Models\SigningKey[]**](SigningKey.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/ListUploadsResponse.md b/docs/Model/ListUploadsResponse.md index 84cf6ed..f5a3c17 100644 --- a/docs/Model/ListUploadsResponse.md +++ b/docs/Model/ListUploadsResponse.md @@ -4,8 +4,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**data** | [**\MuxPhp\Models\Upload[]**](Upload.md) | | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**data** | [**\MuxPhp\Models\Upload[]**](Upload.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/ListVideoViewsResponse.md b/docs/Model/ListVideoViewsResponse.md index abd6c87..08559e7 100644 --- a/docs/Model/ListVideoViewsResponse.md +++ b/docs/Model/ListVideoViewsResponse.md @@ -4,10 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**data** | [**\MuxPhp\Models\AbridgedVideoView[]**](AbridgedVideoView.md) | | [optional] -**total_row_count** | **int** | | [optional] -**timeframe** | **int[]** | | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**data** | [**\MuxPhp\Models\AbridgedVideoView[]**](AbridgedVideoView.md) | | [optional] +**total_row_count** | **int** | | [optional] +**timeframe** | **int[]** | | [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/LiveStream.md b/docs/Model/LiveStream.md index 45c7adb..c87a32a 100644 --- a/docs/Model/LiveStream.md +++ b/docs/Model/LiveStream.md @@ -4,20 +4,18 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **string** | | [optional] -**created_at** | **string** | | [optional] -**stream_key** | **string** | | [optional] -**active_asset_id** | **string** | | [optional] -**recent_asset_ids** | **string[]** | | [optional] -**status** | **string** | | [optional] -**playback_ids** | [**\MuxPhp\Models\PlaybackID[]**](PlaybackID.md) | | [optional] -**new_asset_settings** | [**\MuxPhp\Models\CreateAssetRequest**](CreateAssetRequest.md) | | [optional] -**passthrough** | **string** | | [optional] -**reconnect_window** | **float** | | [optional] -**reduced_latency** | **bool** | | [optional] -**simulcast_targets** | [**\MuxPhp\Models\SimulcastTarget[]**](SimulcastTarget.md) | | [optional] -**test** | **bool** | | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**id** | **string** | | [optional] +**created_at** | **string** | | [optional] +**stream_key** | **string** | | [optional] +**active_asset_id** | **string** | | [optional] +**recent_asset_ids** | **string[]** | | [optional] +**status** | **string** | | [optional] +**playback_ids** | [**\MuxPhp\Models\PlaybackID[]**](PlaybackID.md) | | [optional] +**new_asset_settings** | [**\MuxPhp\Models\CreateAssetRequest**](CreateAssetRequest.md) | | [optional] +**passthrough** | **string** | | [optional] +**reconnect_window** | **float** | | [optional] +**reduced_latency** | **bool** | | [optional] +**simulcast_targets** | [**\MuxPhp\Models\SimulcastTarget[]**](SimulcastTarget.md) | | [optional] +**test** | **bool** | | [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/LiveStreamResponse.md b/docs/Model/LiveStreamResponse.md index 2878a94..998bf8e 100644 --- a/docs/Model/LiveStreamResponse.md +++ b/docs/Model/LiveStreamResponse.md @@ -4,8 +4,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**data** | [**\MuxPhp\Models\LiveStream**](.md) | | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**data** | [**\MuxPhp\Models\LiveStream**](.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/Metric.md b/docs/Model/Metric.md index 0a90538..18c75cf 100644 --- a/docs/Model/Metric.md +++ b/docs/Model/Metric.md @@ -4,12 +4,10 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**value** | **double** | | [optional] -**type** | **string** | | [optional] -**name** | **string** | | [optional] -**metric** | **string** | | [optional] -**measurement** | **string** | | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**value** | **double** | | [optional] +**type** | **string** | | [optional] +**name** | **string** | | [optional] +**metric** | **string** | | [optional] +**measurement** | **string** | | [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/NotificationRule.md b/docs/Model/NotificationRule.md index f1451ac..723f3ba 100644 --- a/docs/Model/NotificationRule.md +++ b/docs/Model/NotificationRule.md @@ -4,10 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**value** | **string** | | [optional] -**name** | **string** | | [optional] -**id** | **string** | | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**value** | **string** | | [optional] +**name** | **string** | | [optional] +**id** | **string** | | [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/OverallValues.md b/docs/Model/OverallValues.md index 5a41f13..2d2b23a 100644 --- a/docs/Model/OverallValues.md +++ b/docs/Model/OverallValues.md @@ -4,11 +4,9 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**value** | **double** | | [optional] -**total_watch_time** | **int** | | [optional] -**total_views** | **int** | | [optional] -**global_value** | **double** | | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**value** | **double** | | [optional] +**total_watch_time** | **int** | | [optional] +**total_views** | **int** | | [optional] +**global_value** | **double** | | [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/PlaybackID.md b/docs/Model/PlaybackID.md index de61de1..d7324be 100644 --- a/docs/Model/PlaybackID.md +++ b/docs/Model/PlaybackID.md @@ -4,9 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **string** | Unique identifier for the PlaybackID | [optional] -**policy** | [**\MuxPhp\Models\PlaybackPolicy**](PlaybackPolicy.md) | | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**id** | **string** | Unique identifier for the PlaybackID | [optional] +**policy** | [**\MuxPhp\Models\PlaybackPolicy**](PlaybackPolicy.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/PlaybackPolicy.md b/docs/Model/PlaybackPolicy.md index ec3510f..57ff1e6 100644 --- a/docs/Model/PlaybackPolicy.md +++ b/docs/Model/PlaybackPolicy.md @@ -5,6 +5,4 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.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/RealTimeBreakdownValue.md b/docs/Model/RealTimeBreakdownValue.md index 70e51ae..e079549 100644 --- a/docs/Model/RealTimeBreakdownValue.md +++ b/docs/Model/RealTimeBreakdownValue.md @@ -4,12 +4,10 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**value** | **string** | | [optional] -**negative_impact** | **int** | | [optional] -**metric_value** | **double** | | [optional] -**display_value** | **string** | | [optional] -**concurent_viewers** | **int** | | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**value** | **string** | | [optional] +**negative_impact** | **int** | | [optional] +**metric_value** | **double** | | [optional] +**display_value** | **string** | | [optional] +**concurent_viewers** | **int** | | [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/RealTimeHistogramTimeseriesBucket.md b/docs/Model/RealTimeHistogramTimeseriesBucket.md index acb2b4d..3168cdb 100644 --- a/docs/Model/RealTimeHistogramTimeseriesBucket.md +++ b/docs/Model/RealTimeHistogramTimeseriesBucket.md @@ -4,9 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**start** | **int** | | [optional] -**end** | **int** | | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**start** | **int** | | [optional] +**end** | **int** | | [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/RealTimeHistogramTimeseriesBucketValues.md b/docs/Model/RealTimeHistogramTimeseriesBucketValues.md index 85da7f1..607e256 100644 --- a/docs/Model/RealTimeHistogramTimeseriesBucketValues.md +++ b/docs/Model/RealTimeHistogramTimeseriesBucketValues.md @@ -4,9 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**percentage** | **double** | | [optional] -**count** | **int** | | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**percentage** | **double** | | [optional] +**count** | **int** | | [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/RealTimeHistogramTimeseriesDatapoint.md b/docs/Model/RealTimeHistogramTimeseriesDatapoint.md index c2597b4..fb62047 100644 --- a/docs/Model/RealTimeHistogramTimeseriesDatapoint.md +++ b/docs/Model/RealTimeHistogramTimeseriesDatapoint.md @@ -4,14 +4,12 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**timestamp** | **string** | | [optional] -**sum** | **int** | | [optional] -**p95** | **double** | | [optional] -**median** | **double** | | [optional] -**max_percentage** | **double** | | [optional] -**bucket_values** | [**\MuxPhp\Models\RealTimeHistogramTimeseriesBucketValues[]**](RealTimeHistogramTimeseriesBucketValues.md) | | [optional] -**average** | **double** | | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - +**timestamp** | **string** | | [optional] +**sum** | **int** | | [optional] +**p95** | **double** | | [optional] +**median** | **double** | | [optional] +**max_percentage** | **double** | | [optional] +**bucket_values** | [**\MuxPhp\Models\RealTimeHistogramTimeseriesBucketValues[]**](RealTimeHistogramTimeseriesBucketValues.md) | | [optional] +**average** | **double** | | [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/RealTimeTimeseriesDatapoint.md b/docs/Model/RealTimeTimeseriesDatapoint.md index a5ab243..b761a21 100644 --- a/docs/Model/RealTimeTimeseriesDatapoint.md +++ b/docs/Model/RealTimeTimeseriesDatapoint.md @@ -4,10 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**value** | **double** | | [optional] -**date** | **string** | | [optional] -**concurent_viewers** | **int** | | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**value** | **double** | | [optional] +**date** | **string** | | [optional] +**concurent_viewers** | **int** | | [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/Score.md b/docs/Model/Score.md index 3d2fdd2..dbb471d 100644 --- a/docs/Model/Score.md +++ b/docs/Model/Score.md @@ -4,13 +4,11 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**watch_time** | **int** | | [optional] -**view_count** | **int** | | [optional] -**name** | **string** | | [optional] -**value** | **double** | | [optional] -**metric** | **string** | | [optional] -**items** | [**\MuxPhp\Models\Metric[]**](Metric.md) | | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - +**watch_time** | **int** | | [optional] +**view_count** | **int** | | [optional] +**name** | **string** | | [optional] +**value** | **double** | | [optional] +**metric** | **string** | | [optional] +**items** | [**\MuxPhp\Models\Metric[]**](Metric.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/SignalLiveStreamCompleteResponse.md b/docs/Model/SignalLiveStreamCompleteResponse.md index 24d70d8..edc5c3a 100644 --- a/docs/Model/SignalLiveStreamCompleteResponse.md +++ b/docs/Model/SignalLiveStreamCompleteResponse.md @@ -4,8 +4,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**data** | [**object**](.md) | | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**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/SigningKey.md b/docs/Model/SigningKey.md index aef22c0..62d17eb 100644 --- a/docs/Model/SigningKey.md +++ b/docs/Model/SigningKey.md @@ -4,10 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **string** | | [optional] -**created_at** | **string** | | [optional] -**private_key** | **string** | | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**id** | **string** | | [optional] +**created_at** | **string** | | [optional] +**private_key** | **string** | | [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/SigningKeyResponse.md b/docs/Model/SigningKeyResponse.md index 77c6385..a797b8e 100644 --- a/docs/Model/SigningKeyResponse.md +++ b/docs/Model/SigningKeyResponse.md @@ -4,8 +4,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**data** | [**\MuxPhp\Models\SigningKey**](.md) | | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**data** | [**\MuxPhp\Models\SigningKey**](.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/SimulcastTarget.md b/docs/Model/SimulcastTarget.md index 0017219..590e014 100644 --- a/docs/Model/SimulcastTarget.md +++ b/docs/Model/SimulcastTarget.md @@ -4,12 +4,10 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **string** | ID of the Simulcast Target | [optional] -**passthrough** | **string** | Arbitrary Metadata set when creating a simulcast target. | [optional] -**status** | **string** | The current status of the simulcast target. See Statuses below for detailed description. * `idle`: Default status. When the parent live stream is in disconnected status, simulcast targets will be idle state. * `starting`: The simulcast target transitions into this state when the parent live stream transition into connected state. * `broadcasting`: The simulcast target has successfully connected to the third party live streaming service and is pushing video to that service. * `errored`: The simulcast target encountered an error either while attempting to connect to the third party live streaming service, or mid-broadcasting. Compared to other errored statuses in the Mux Video API, a simulcast may transition back into the broadcasting state if a connection with the service can be re-established. | [optional] -**stream_key** | **string** | Stream Key represents an stream identifier for the third party live streaming service to simulcast the parent live stream too. | [optional] -**url** | **string** | RTMP hostname including the application name for the third party live streaming service. | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**id** | **string** | ID of the Simulcast Target | [optional] +**passthrough** | **string** | Arbitrary Metadata set when creating a simulcast target. | [optional] +**status** | **string** | The current status of the simulcast target. See Statuses below for detailed description. * `idle`: Default status. When the parent live stream is in disconnected status, simulcast targets will be idle state. * `starting`: The simulcast target transitions into this state when the parent live stream transition into connected state. * `broadcasting`: The simulcast target has successfully connected to the third party live streaming service and is pushing video to that service. * `errored`: The simulcast target encountered an error either while attempting to connect to the third party live streaming service, or mid-broadcasting. Compared to other errored statuses in the Mux Video API, a simulcast may transition back into the broadcasting state if a connection with the service can be re-established. | [optional] +**stream_key** | **string** | Stream Key represents an stream identifier for the third party live streaming service to simulcast the parent live stream too. | [optional] +**url** | **string** | RTMP hostname including the application name for the third party live streaming service. | [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/SimulcastTargetResponse.md b/docs/Model/SimulcastTargetResponse.md index efa88cd..0eb1f34 100644 --- a/docs/Model/SimulcastTargetResponse.md +++ b/docs/Model/SimulcastTargetResponse.md @@ -4,8 +4,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**data** | [**\MuxPhp\Models\SimulcastTarget**](.md) | | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**data** | [**\MuxPhp\Models\SimulcastTarget**](.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/Track.md b/docs/Model/Track.md index 8f5001f..c91319d 100644 --- a/docs/Model/Track.md +++ b/docs/Model/Track.md @@ -4,20 +4,18 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **string** | Unique identifier for the Track | [optional] -**type** | **string** | The type of track | [optional] -**duration** | **double** | The duration in seconds of the track media. This parameter is not set for the `text` type track. This field is optional and may not be set. The top level `duration` field of an asset will always be set. | [optional] -**max_width** | **int** | The maximum width in pixels available for the track. Only set for the `video` type track. | [optional] -**max_height** | **int** | The maximum height in pixels available for the track. Only set for the `video` type track. | [optional] -**max_frame_rate** | **double** | The maximum frame rate available for the track. Only set for the `video` type track. This field may return `-1` if the frame rate of the input cannot be reliably determined. | [optional] -**max_channels** | **int** | The maximum number of audio channels the track supports. Only set for the `audio` type track. | [optional] -**max_channel_layout** | **string** | Only set for the `audio` type track. | [optional] -**text_type** | **string** | This parameter is set only for the `text` type track. | [optional] -**language_code** | **string** | The language code value represents [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 set for `text` type and `subtitles` text type track. | [optional] -**name** | **string** | The name of the track containing a human-readable description. The hls manifest will associate a subtitle text track with this value. For example, the value is \"English\" for subtitles text track for the `language_code` value of `en-US`. This parameter is set for the `text` type and `subtitles` text type track. | [optional] -**closed_captions** | **bool** | Indicates the track provides Subtitles for the Deaf or Hard-of-hearing (SDH). This parameter is set for the `text` type and `subtitles` text type track. | [optional] -**passthrough** | **string** | Arbitrary metadata set for the track either when creating the asset or track. This parameter is set for `text` type and `subtitles` text type track. Max 255 characters. | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**id** | **string** | Unique identifier for the Track | [optional] +**type** | **string** | The type of track | [optional] +**duration** | **double** | The duration in seconds of the track media. This parameter is not set for the `text` type track. This field is optional and may not be set. The top level `duration` field of an asset will always be set. | [optional] +**max_width** | **int** | The maximum width in pixels available for the track. Only set for the `video` type track. | [optional] +**max_height** | **int** | The maximum height in pixels available for the track. Only set for the `video` type track. | [optional] +**max_frame_rate** | **double** | The maximum frame rate available for the track. Only set for the `video` type track. This field may return `-1` if the frame rate of the input cannot be reliably determined. | [optional] +**max_channels** | **int** | The maximum number of audio channels the track supports. Only set for the `audio` type track. | [optional] +**max_channel_layout** | **string** | Only set for the `audio` type track. | [optional] +**text_type** | **string** | This parameter is set only for the `text` type track. | [optional] +**language_code** | **string** | The language code value represents [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 set for `text` type and `subtitles` text type track. | [optional] +**name** | **string** | The name of the track containing a human-readable description. The hls manifest will associate a subtitle text track with this value. For example, the value is \"English\" for subtitles text track for the `language_code` value of `en-US`. This parameter is set for the `text` type and `subtitles` text type track. | [optional] +**closed_captions** | **bool** | Indicates the track provides Subtitles for the Deaf or Hard-of-hearing (SDH). This parameter is set for the `text` type and `subtitles` text type track. | [optional] +**passthrough** | **string** | Arbitrary metadata set for the track either when creating the asset or track. This parameter is set for `text` type and `subtitles` text type track. 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/UpdateAssetMP4SupportRequest.md b/docs/Model/UpdateAssetMP4SupportRequest.md index 57f9a26..0f5c825 100644 --- a/docs/Model/UpdateAssetMP4SupportRequest.md +++ b/docs/Model/UpdateAssetMP4SupportRequest.md @@ -4,8 +4,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**mp4_support** | **string** | String value for the level of mp4 support | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**mp4_support** | **string** | String value for the level of mp4 support | [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/UpdateAssetMasterAccessRequest.md b/docs/Model/UpdateAssetMasterAccessRequest.md index 75f01c0..815c763 100644 --- a/docs/Model/UpdateAssetMasterAccessRequest.md +++ b/docs/Model/UpdateAssetMasterAccessRequest.md @@ -4,8 +4,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**master_access** | **string** | Add or remove access to the master version of the video. | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**master_access** | **string** | Add or remove access to the master version of the video. | [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/Upload.md b/docs/Model/Upload.md index 268ef56..f35a270 100644 --- a/docs/Model/Upload.md +++ b/docs/Model/Upload.md @@ -4,16 +4,14 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **string** | | [optional] +**id** | **string** | | [optional] **timeout** | **int** | Max time in seconds for the signed upload URL to be valid. If a successful upload has not occurred before the timeout limit, the direct upload is marked `timed_out` | [optional] [default to 3600] -**status** | **string** | | [optional] -**new_asset_settings** | [**\MuxPhp\Models\Asset**](Asset.md) | | [optional] -**asset_id** | **string** | Only set once the upload is in the `asset_created` state. | [optional] -**error** | [**\MuxPhp\Models\UploadError**](UploadError.md) | | [optional] -**cors_origin** | **string** | If the upload URL will be used in a browser, you must specify the origin in order for the signed URL to have the correct CORS headers. | [optional] -**url** | **string** | The URL to upload the associated source media to. | [optional] -**test** | **bool** | | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**status** | **string** | | [optional] +**new_asset_settings** | [**\MuxPhp\Models\Asset**](Asset.md) | | [optional] +**asset_id** | **string** | Only set once the upload is in the `asset_created` state. | [optional] +**error** | [**\MuxPhp\Models\UploadError**](UploadError.md) | | [optional] +**cors_origin** | **string** | If the upload URL will be used in a browser, you must specify the origin in order for the signed URL to have the correct CORS headers. | [optional] +**url** | **string** | The URL to upload the associated source media to. | [optional] +**test** | **bool** | | [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/UploadError.md b/docs/Model/UploadError.md index a2c60c8..3366106 100644 --- a/docs/Model/UploadError.md +++ b/docs/Model/UploadError.md @@ -4,9 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**type** | **string** | | [optional] -**message** | **string** | | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**type** | **string** | | [optional] +**message** | **string** | | [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/UploadResponse.md b/docs/Model/UploadResponse.md index bbe5923..0de714f 100644 --- a/docs/Model/UploadResponse.md +++ b/docs/Model/UploadResponse.md @@ -4,8 +4,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**data** | [**\MuxPhp\Models\Upload**](.md) | | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**data** | [**\MuxPhp\Models\Upload**](.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 5643f83..7b26269 100644 --- a/docs/Model/VideoView.md +++ b/docs/Model/VideoView.md @@ -4,119 +4,117 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**view_total_upscaling** | **string** | | [optional] -**preroll_ad_asset_hostname** | **string** | | [optional] -**player_source_domain** | **string** | | [optional] -**region** | **string** | | [optional] -**viewer_user_agent** | **string** | | [optional] -**preroll_requested** | **bool** | | [optional] -**page_type** | **string** | | [optional] -**startup_score** | **string** | | [optional] -**view_seek_duration** | **int** | | [optional] -**country_name** | **string** | | [optional] -**player_source_height** | **int** | | [optional] -**longitude** | **string** | | [optional] -**buffering_count** | **int** | | [optional] -**video_duration** | **int** | | [optional] -**player_source_type** | **string** | | [optional] -**city** | **string** | | [optional] -**view_id** | **string** | | [optional] -**platform_description** | **string** | | [optional] -**video_startup_preroll_request_time** | **int** | | [optional] -**viewer_device_name** | **string** | | [optional] -**video_series** | **string** | | [optional] -**viewer_application_name** | **string** | | [optional] -**updated_at** | **string** | | [optional] -**view_total_content_playback_time** | **int** | | [optional] -**cdn** | **string** | | [optional] -**player_instance_id** | **string** | | [optional] -**video_language** | **string** | | [optional] -**player_source_width** | **int** | | [optional] -**player_error_message** | **string** | | [optional] -**player_mux_plugin_version** | **string** | | [optional] -**watched** | **bool** | | [optional] -**playback_score** | **string** | | [optional] -**page_url** | **string** | | [optional] -**metro** | **string** | | [optional] -**view_max_request_latency** | **int** | | [optional] -**requests_for_first_preroll** | **int** | | [optional] -**view_total_downscaling** | **string** | | [optional] -**latitude** | **string** | | [optional] -**player_source_host_name** | **string** | | [optional] -**inserted_at** | **string** | | [optional] -**view_end** | **string** | | [optional] -**mux_embed_version** | **string** | | [optional] -**player_language** | **string** | | [optional] -**page_load_time** | **int** | | [optional] -**viewer_device_category** | **string** | | [optional] -**video_startup_preroll_load_time** | **int** | | [optional] -**player_version** | **string** | | [optional] -**watch_time** | **int** | | [optional] -**player_source_stream_type** | **string** | | [optional] -**preroll_ad_tag_hostname** | **string** | | [optional] -**viewer_device_manufacturer** | **string** | | [optional] -**rebuffering_score** | **string** | | [optional] -**experiment_name** | **string** | | [optional] -**viewer_os_version** | **string** | | [optional] -**player_preload** | **bool** | | [optional] -**buffering_duration** | **int** | | [optional] -**player_view_count** | **int** | | [optional] -**player_software** | **string** | | [optional] -**player_load_time** | **int** | | [optional] -**platform_summary** | **string** | | [optional] -**video_encoding_variant** | **string** | | [optional] -**player_width** | **int** | | [optional] -**view_seek_count** | **int** | | [optional] -**viewer_experience_score** | **string** | | [optional] -**view_error_id** | **int** | | [optional] -**video_variant_name** | **string** | | [optional] -**preroll_played** | **bool** | | [optional] -**viewer_application_engine** | **string** | | [optional] -**viewer_os_architecture** | **string** | | [optional] -**player_error_code** | **string** | | [optional] -**buffering_rate** | **string** | | [optional] -**events** | [**\MuxPhp\Models\VideoViewEvent[]**](VideoViewEvent.md) | | [optional] -**player_name** | **string** | | [optional] -**view_start** | **string** | | [optional] -**view_average_request_throughput** | **int** | | [optional] -**video_producer** | **string** | | [optional] -**error_type_id** | **int** | | [optional] -**mux_viewer_id** | **string** | | [optional] -**video_id** | **string** | | [optional] -**continent_code** | **string** | | [optional] -**session_id** | **string** | | [optional] -**exit_before_video_start** | **bool** | | [optional] -**video_content_type** | **string** | | [optional] -**viewer_os_family** | **string** | | [optional] -**player_poster** | **string** | | [optional] -**view_average_request_latency** | **int** | | [optional] -**video_variant_id** | **string** | | [optional] -**player_source_duration** | **int** | | [optional] -**player_source_url** | **string** | | [optional] -**mux_api_version** | **string** | | [optional] -**video_title** | **string** | | [optional] -**id** | **string** | | [optional] -**short_time** | **string** | | [optional] -**rebuffer_percentage** | **string** | | [optional] -**time_to_first_frame** | **int** | | [optional] -**viewer_user_id** | **string** | | [optional] -**video_stream_type** | **string** | | [optional] -**player_startup_time** | **int** | | [optional] -**viewer_application_version** | **string** | | [optional] -**view_max_downscale_percentage** | **string** | | [optional] -**view_max_upscale_percentage** | **string** | | [optional] -**country_code** | **string** | | [optional] -**used_fullscreen** | **bool** | | [optional] -**isp** | **string** | | [optional] -**property_id** | **int** | | [optional] -**player_autoplay** | **bool** | | [optional] -**player_height** | **int** | | [optional] -**asn** | **int** | | [optional] -**asn_name** | **string** | | [optional] -**quality_score** | **string** | | [optional] -**player_software_version** | **string** | | [optional] -**player_mux_plugin_name** | **string** | | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**view_total_upscaling** | **string** | | [optional] +**preroll_ad_asset_hostname** | **string** | | [optional] +**player_source_domain** | **string** | | [optional] +**region** | **string** | | [optional] +**viewer_user_agent** | **string** | | [optional] +**preroll_requested** | **bool** | | [optional] +**page_type** | **string** | | [optional] +**startup_score** | **string** | | [optional] +**view_seek_duration** | **int** | | [optional] +**country_name** | **string** | | [optional] +**player_source_height** | **int** | | [optional] +**longitude** | **string** | | [optional] +**buffering_count** | **int** | | [optional] +**video_duration** | **int** | | [optional] +**player_source_type** | **string** | | [optional] +**city** | **string** | | [optional] +**view_id** | **string** | | [optional] +**platform_description** | **string** | | [optional] +**video_startup_preroll_request_time** | **int** | | [optional] +**viewer_device_name** | **string** | | [optional] +**video_series** | **string** | | [optional] +**viewer_application_name** | **string** | | [optional] +**updated_at** | **string** | | [optional] +**view_total_content_playback_time** | **int** | | [optional] +**cdn** | **string** | | [optional] +**player_instance_id** | **string** | | [optional] +**video_language** | **string** | | [optional] +**player_source_width** | **int** | | [optional] +**player_error_message** | **string** | | [optional] +**player_mux_plugin_version** | **string** | | [optional] +**watched** | **bool** | | [optional] +**playback_score** | **string** | | [optional] +**page_url** | **string** | | [optional] +**metro** | **string** | | [optional] +**view_max_request_latency** | **int** | | [optional] +**requests_for_first_preroll** | **int** | | [optional] +**view_total_downscaling** | **string** | | [optional] +**latitude** | **string** | | [optional] +**player_source_host_name** | **string** | | [optional] +**inserted_at** | **string** | | [optional] +**view_end** | **string** | | [optional] +**mux_embed_version** | **string** | | [optional] +**player_language** | **string** | | [optional] +**page_load_time** | **int** | | [optional] +**viewer_device_category** | **string** | | [optional] +**video_startup_preroll_load_time** | **int** | | [optional] +**player_version** | **string** | | [optional] +**watch_time** | **int** | | [optional] +**player_source_stream_type** | **string** | | [optional] +**preroll_ad_tag_hostname** | **string** | | [optional] +**viewer_device_manufacturer** | **string** | | [optional] +**rebuffering_score** | **string** | | [optional] +**experiment_name** | **string** | | [optional] +**viewer_os_version** | **string** | | [optional] +**player_preload** | **bool** | | [optional] +**buffering_duration** | **int** | | [optional] +**player_view_count** | **int** | | [optional] +**player_software** | **string** | | [optional] +**player_load_time** | **int** | | [optional] +**platform_summary** | **string** | | [optional] +**video_encoding_variant** | **string** | | [optional] +**player_width** | **int** | | [optional] +**view_seek_count** | **int** | | [optional] +**viewer_experience_score** | **string** | | [optional] +**view_error_id** | **int** | | [optional] +**video_variant_name** | **string** | | [optional] +**preroll_played** | **bool** | | [optional] +**viewer_application_engine** | **string** | | [optional] +**viewer_os_architecture** | **string** | | [optional] +**player_error_code** | **string** | | [optional] +**buffering_rate** | **string** | | [optional] +**events** | [**\MuxPhp\Models\VideoViewEvent[]**](VideoViewEvent.md) | | [optional] +**player_name** | **string** | | [optional] +**view_start** | **string** | | [optional] +**view_average_request_throughput** | **int** | | [optional] +**video_producer** | **string** | | [optional] +**error_type_id** | **int** | | [optional] +**mux_viewer_id** | **string** | | [optional] +**video_id** | **string** | | [optional] +**continent_code** | **string** | | [optional] +**session_id** | **string** | | [optional] +**exit_before_video_start** | **bool** | | [optional] +**video_content_type** | **string** | | [optional] +**viewer_os_family** | **string** | | [optional] +**player_poster** | **string** | | [optional] +**view_average_request_latency** | **int** | | [optional] +**video_variant_id** | **string** | | [optional] +**player_source_duration** | **int** | | [optional] +**player_source_url** | **string** | | [optional] +**mux_api_version** | **string** | | [optional] +**video_title** | **string** | | [optional] +**id** | **string** | | [optional] +**short_time** | **string** | | [optional] +**rebuffer_percentage** | **string** | | [optional] +**time_to_first_frame** | **int** | | [optional] +**viewer_user_id** | **string** | | [optional] +**video_stream_type** | **string** | | [optional] +**player_startup_time** | **int** | | [optional] +**viewer_application_version** | **string** | | [optional] +**view_max_downscale_percentage** | **string** | | [optional] +**view_max_upscale_percentage** | **string** | | [optional] +**country_code** | **string** | | [optional] +**used_fullscreen** | **bool** | | [optional] +**isp** | **string** | | [optional] +**property_id** | **int** | | [optional] +**player_autoplay** | **bool** | | [optional] +**player_height** | **int** | | [optional] +**asn** | **int** | | [optional] +**asn_name** | **string** | | [optional] +**quality_score** | **string** | | [optional] +**player_software_version** | **string** | | [optional] +**player_mux_plugin_name** | **string** | | [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/VideoViewEvent.md b/docs/Model/VideoViewEvent.md index 3439197..99ef411 100644 --- a/docs/Model/VideoViewEvent.md +++ b/docs/Model/VideoViewEvent.md @@ -4,11 +4,9 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**viewer_time** | **int** | | [optional] -**playback_time** | **int** | | [optional] -**name** | **string** | | [optional] -**event_time** | **int** | | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**viewer_time** | **int** | | [optional] +**playback_time** | **int** | | [optional] +**name** | **string** | | [optional] +**event_time** | **int** | | [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/VideoViewResponse.md b/docs/Model/VideoViewResponse.md index 883c1df..d7cc4c7 100644 --- a/docs/Model/VideoViewResponse.md +++ b/docs/Model/VideoViewResponse.md @@ -4,9 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**data** | [**\MuxPhp\Models\VideoView**](.md) | | [optional] -**timeframe** | **int[]** | | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**data** | [**\MuxPhp\Models\VideoView**](.md) | | [optional] +**timeframe** | **int[]** | | [optional] +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/gen/templates/api.mustache b/gen/templates/api.mustache index 058b251..cb2fdaa 100644 --- a/gen/templates/api.mustache +++ b/gen/templates/api.mustache @@ -472,7 +472,20 @@ use {{invokerPackage}}\ObjectSerializer; $multipart = false; {{#queryParams}} - // query params + // Query Param: {{baseName}} + {{#collectionFormat}} + if (${{paramName}} !== null) { + if (is_array(${{paramName}})) { + foreach (${{paramName}} as $p) { + array_push($queryParams, "{{baseName}}=$p"); + } + } + else { + throw new \InvalidArgumentException('Did not receive an array when expecting one for query parameter {{baseName}}'); + } + } + {{/collectionFormat}} + {{^collectionFormat}} {{#isExplode}} if (${{paramName}} !== null) { {{#style}} @@ -498,6 +511,7 @@ use {{invokerPackage}}\ObjectSerializer; $queryParams['{{baseName}}'] = ${{paramName}}; } {{/isExplode}} + {{/collectionFormat}} {{/queryParams}} {{#headerParams}} diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 9a5a78b..d8fe4df 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -11,11 +11,13 @@ ./test/Model - ./MuxPhp/Api ./MuxPhp/Models + + + diff --git a/test/Api/AssetsApiTest.php b/test/Api/AssetsApiTest.php new file mode 100644 index 0000000..c2d4898 --- /dev/null +++ b/test/Api/AssetsApiTest.php @@ -0,0 +1,218 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test case for createAssetPlaybackId + * + * Create a playback ID. + * + */ + public function testCreateAssetPlaybackId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for createAssetTrack + * + * Create an asset track. + * + */ + public function testCreateAssetTrack() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for deleteAsset + * + * Delete an asset. + * + */ + public function testDeleteAsset() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for deleteAssetPlaybackId + * + * Delete a playback ID. + * + */ + public function testDeleteAssetPlaybackId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for deleteAssetTrack + * + * Delete an asset track. + * + */ + public function testDeleteAssetTrack() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for getAsset + * + * Retrieve an asset. + * + */ + public function testGetAsset() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for getAssetInputInfo + * + * Retrieve asset input info. + * + */ + public function testGetAssetInputInfo() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for getAssetPlaybackId + * + * Retrieve a playback ID. + * + */ + public function testGetAssetPlaybackId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for listAssets + * + * List assets. + * + */ + public function testListAssets() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for updateAssetMasterAccess + * + * Update master access. + * + */ + public function testUpdateAssetMasterAccess() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for updateAssetMp4Support + * + * Update MP4 support. + * + */ + public function testUpdateAssetMp4Support() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Api/DeliveryUsageApiTest.php b/test/Api/DeliveryUsageApiTest.php new file mode 100644 index 0000000..84a0723 --- /dev/null +++ b/test/Api/DeliveryUsageApiTest.php @@ -0,0 +1,86 @@ +markTestIncomplete('Not implemented'); + } +} diff --git a/test/Api/DimensionsApiTest.php b/test/Api/DimensionsApiTest.php new file mode 100644 index 0000000..953c452 --- /dev/null +++ b/test/Api/DimensionsApiTest.php @@ -0,0 +1,98 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test case for listDimensions + * + * List Dimensions. + * + */ + public function testListDimensions() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Api/DirectUploadsApiTest.php b/test/Api/DirectUploadsApiTest.php new file mode 100644 index 0000000..32fe857 --- /dev/null +++ b/test/Api/DirectUploadsApiTest.php @@ -0,0 +1,122 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test case for createDirectUpload + * + * Create a new direct upload URL. + * + */ + public function testCreateDirectUpload() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for getDirectUpload + * + * Retrieve a single direct upload's info. + * + */ + public function testGetDirectUpload() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for listDirectUploads + * + * List direct uploads. + * + */ + public function testListDirectUploads() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Api/ErrorsApiTest.php b/test/Api/ErrorsApiTest.php new file mode 100644 index 0000000..2ecfe18 --- /dev/null +++ b/test/Api/ErrorsApiTest.php @@ -0,0 +1,86 @@ +markTestIncomplete('Not implemented'); + } +} diff --git a/test/Api/ExportsApiTest.php b/test/Api/ExportsApiTest.php new file mode 100644 index 0000000..cca5102 --- /dev/null +++ b/test/Api/ExportsApiTest.php @@ -0,0 +1,86 @@ +markTestIncomplete('Not implemented'); + } +} diff --git a/test/Api/FiltersApiTest.php b/test/Api/FiltersApiTest.php new file mode 100644 index 0000000..83d530d --- /dev/null +++ b/test/Api/FiltersApiTest.php @@ -0,0 +1,98 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test case for listFilters + * + * List Filters. + * + */ + public function testListFilters() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Api/IncidentsApiTest.php b/test/Api/IncidentsApiTest.php new file mode 100644 index 0000000..6aff091 --- /dev/null +++ b/test/Api/IncidentsApiTest.php @@ -0,0 +1,110 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test case for listIncidents + * + * List Incidents. + * + */ + public function testListIncidents() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for listRelatedIncidents + * + * List Related Incidents. + * + */ + public function testListRelatedIncidents() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Api/LiveStreamsApiTest.php b/test/Api/LiveStreamsApiTest.php new file mode 100644 index 0000000..f90cf68 --- /dev/null +++ b/test/Api/LiveStreamsApiTest.php @@ -0,0 +1,230 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test case for createLiveStreamPlaybackId + * + * Create a live stream playback ID. + * + */ + public function testCreateLiveStreamPlaybackId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for createLiveStreamSimulcastTarget + * + * Create a live stream simulcast target. + * + */ + public function testCreateLiveStreamSimulcastTarget() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for deleteLiveStream + * + * Delete a live stream. + * + */ + public function testDeleteLiveStream() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for deleteLiveStreamPlaybackId + * + * Delete a live stream playback ID. + * + */ + public function testDeleteLiveStreamPlaybackId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for deleteLiveStreamSimulcastTarget + * + * Delete a Live Stream Simulcast Target. + * + */ + public function testDeleteLiveStreamSimulcastTarget() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for disableLiveStream + * + * Disable a live stream. + * + */ + public function testDisableLiveStream() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for enableLiveStream + * + * Enable a live stream. + * + */ + public function testEnableLiveStream() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for getLiveStream + * + * Retrieve a live stream. + * + */ + public function testGetLiveStream() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for getLiveStreamSimulcastTarget + * + * Retrieve a Live Stream Simulcast Target. + * + */ + public function testGetLiveStreamSimulcastTarget() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for listLiveStreams + * + * List live streams. + * + */ + public function testListLiveStreams() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for resetStreamKey + * + * Reset a live stream’s stream key. + * + */ + public function testResetStreamKey() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for signalLiveStreamComplete + * + * Signal a live stream is finished. + * + */ + public function testSignalLiveStreamComplete() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Api/MetricsApiTest.php b/test/Api/MetricsApiTest.php new file mode 100644 index 0000000..0c6df99 --- /dev/null +++ b/test/Api/MetricsApiTest.php @@ -0,0 +1,134 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test case for getOverallValues + * + * Get Overall values. + * + */ + public function testGetOverallValues() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for listAllMetricValues + * + * List all metric values. + * + */ + public function testListAllMetricValues() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for listBreakdownValues + * + * List breakdown values. + * + */ + public function testListBreakdownValues() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for listInsights + * + * List Insights. + * + */ + public function testListInsights() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Api/PlaybackIDApiTest.php b/test/Api/PlaybackIDApiTest.php new file mode 100644 index 0000000..c1882c2 --- /dev/null +++ b/test/Api/PlaybackIDApiTest.php @@ -0,0 +1,86 @@ +markTestIncomplete('Not implemented'); + } +} diff --git a/test/Api/RealTimeApiTest.php b/test/Api/RealTimeApiTest.php new file mode 100644 index 0000000..0ae342a --- /dev/null +++ b/test/Api/RealTimeApiTest.php @@ -0,0 +1,134 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test case for getRealtimeHistogramTimeseries + * + * Get Real-Time Histogram Timeseries. + * + */ + public function testGetRealtimeHistogramTimeseries() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for getRealtimeTimeseries + * + * Get Real-Time Timeseries. + * + */ + public function testGetRealtimeTimeseries() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for listRealtimeDimensions + * + * List Real-Time Dimensions. + * + */ + public function testListRealtimeDimensions() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for listRealtimeMetrics + * + * List Real-Time Metrics. + * + */ + public function testListRealtimeMetrics() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Api/URLSigningKeysApiTest.php b/test/Api/URLSigningKeysApiTest.php new file mode 100644 index 0000000..7caeb73 --- /dev/null +++ b/test/Api/URLSigningKeysApiTest.php @@ -0,0 +1,122 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test case for deleteUrlSigningKey + * + * Delete a URL signing key. + * + */ + public function testDeleteUrlSigningKey() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for getUrlSigningKey + * + * Retrieve a URL signing key. + * + */ + public function testGetUrlSigningKey() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for listUrlSigningKeys + * + * List URL signing keys. + * + */ + public function testListUrlSigningKeys() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Api/VideoViewsApiTest.php b/test/Api/VideoViewsApiTest.php new file mode 100644 index 0000000..694e9a7 --- /dev/null +++ b/test/Api/VideoViewsApiTest.php @@ -0,0 +1,98 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test case for listVideoViews + * + * List Video Views. + * + */ + public function testListVideoViews() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/AbridgedVideoViewTest.php b/test/Model/AbridgedVideoViewTest.php new file mode 100644 index 0000000..e5ba0f0 --- /dev/null +++ b/test/Model/AbridgedVideoViewTest.php @@ -0,0 +1,181 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "id" + */ + public function testPropertyId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "viewer_os_family" + */ + public function testPropertyViewerOsFamily() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "viewer_application_name" + */ + public function testPropertyViewerApplicationName() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "video_title" + */ + public function testPropertyVideoTitle() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "total_row_count" + */ + public function testPropertyTotalRowCount() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "player_error_message" + */ + public function testPropertyPlayerErrorMessage() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "player_error_code" + */ + public function testPropertyPlayerErrorCode() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "error_type_id" + */ + public function testPropertyErrorTypeId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "country_code" + */ + public function testPropertyCountryCode() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "view_start" + */ + public function testPropertyViewStart() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "view_end" + */ + public function testPropertyViewEnd() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/AssetErrorsTest.php b/test/Model/AssetErrorsTest.php new file mode 100644 index 0000000..ac0072b --- /dev/null +++ b/test/Model/AssetErrorsTest.php @@ -0,0 +1,100 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "type" + */ + public function testPropertyType() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "messages" + */ + public function testPropertyMessages() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/AssetMasterTest.php b/test/Model/AssetMasterTest.php new file mode 100644 index 0000000..9d6ceed --- /dev/null +++ b/test/Model/AssetMasterTest.php @@ -0,0 +1,100 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "status" + */ + public function testPropertyStatus() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "url" + */ + public function testPropertyUrl() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/AssetNonStandardInputReasonsTest.php b/test/Model/AssetNonStandardInputReasonsTest.php new file mode 100644 index 0000000..e8779cf --- /dev/null +++ b/test/Model/AssetNonStandardInputReasonsTest.php @@ -0,0 +1,163 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "video_codec" + */ + public function testPropertyVideoCodec() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "audio_codec" + */ + public function testPropertyAudioCodec() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "video_gop_size" + */ + public function testPropertyVideoGopSize() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "video_frame_rate" + */ + public function testPropertyVideoFrameRate() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "video_resolution" + */ + public function testPropertyVideoResolution() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "pixel_aspect_ratio" + */ + public function testPropertyPixelAspectRatio() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "video_edit_list" + */ + public function testPropertyVideoEditList() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "audio_edit_list" + */ + public function testPropertyAudioEditList() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "unexpected_media_file_parameters" + */ + public function testPropertyUnexpectedMediaFileParameters() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/AssetRecordingTimesTest.php b/test/Model/AssetRecordingTimesTest.php new file mode 100644 index 0000000..6239f1e --- /dev/null +++ b/test/Model/AssetRecordingTimesTest.php @@ -0,0 +1,100 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "started_at" + */ + public function testPropertyStartedAt() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "duration" + */ + public function testPropertyDuration() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/AssetResponseTest.php b/test/Model/AssetResponseTest.php new file mode 100644 index 0000000..23f38a5 --- /dev/null +++ b/test/Model/AssetResponseTest.php @@ -0,0 +1,91 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "data" + */ + public function testPropertyData() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/AssetStaticRenditionsFilesTest.php b/test/Model/AssetStaticRenditionsFilesTest.php new file mode 100644 index 0000000..a6a704e --- /dev/null +++ b/test/Model/AssetStaticRenditionsFilesTest.php @@ -0,0 +1,136 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "name" + */ + public function testPropertyName() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "ext" + */ + public function testPropertyExt() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "height" + */ + public function testPropertyHeight() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "width" + */ + public function testPropertyWidth() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "bitrate" + */ + public function testPropertyBitrate() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "filesize" + */ + public function testPropertyFilesize() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/AssetStaticRenditionsTest.php b/test/Model/AssetStaticRenditionsTest.php new file mode 100644 index 0000000..26fcd2a --- /dev/null +++ b/test/Model/AssetStaticRenditionsTest.php @@ -0,0 +1,100 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "status" + */ + public function testPropertyStatus() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "files" + */ + public function testPropertyFiles() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/AssetTest.php b/test/Model/AssetTest.php new file mode 100644 index 0000000..e432938 --- /dev/null +++ b/test/Model/AssetTest.php @@ -0,0 +1,298 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "id" + */ + public function testPropertyId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "created_at" + */ + public function testPropertyCreatedAt() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "deleted_at" + */ + public function testPropertyDeletedAt() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "status" + */ + public function testPropertyStatus() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "duration" + */ + public function testPropertyDuration() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "max_stored_resolution" + */ + public function testPropertyMaxStoredResolution() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "max_stored_frame_rate" + */ + public function testPropertyMaxStoredFrameRate() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "aspect_ratio" + */ + public function testPropertyAspectRatio() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "playback_ids" + */ + public function testPropertyPlaybackIds() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "tracks" + */ + public function testPropertyTracks() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "errors" + */ + public function testPropertyErrors() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "per_title_encode" + */ + public function testPropertyPerTitleEncode() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "is_live" + */ + public function testPropertyIsLive() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "passthrough" + */ + public function testPropertyPassthrough() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "live_stream_id" + */ + public function testPropertyLiveStreamId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "master" + */ + public function testPropertyMaster() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "master_access" + */ + public function testPropertyMasterAccess() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "mp4_support" + */ + public function testPropertyMp4Support() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "source_asset_id" + */ + public function testPropertySourceAssetId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "normalize_audio" + */ + public function testPropertyNormalizeAudio() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "static_renditions" + */ + public function testPropertyStaticRenditions() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "recording_times" + */ + public function testPropertyRecordingTimes() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "non_standard_input_reasons" + */ + public function testPropertyNonStandardInputReasons() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "test" + */ + public function testPropertyTest() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/BreakdownValueTest.php b/test/Model/BreakdownValueTest.php new file mode 100644 index 0000000..5ba0887 --- /dev/null +++ b/test/Model/BreakdownValueTest.php @@ -0,0 +1,127 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "views" + */ + public function testPropertyViews() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "value" + */ + public function testPropertyValue() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "total_watch_time" + */ + public function testPropertyTotalWatchTime() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "negative_impact" + */ + public function testPropertyNegativeImpact() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "field" + */ + public function testPropertyField() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/CreateAssetRequestTest.php b/test/Model/CreateAssetRequestTest.php new file mode 100644 index 0000000..9e71095 --- /dev/null +++ b/test/Model/CreateAssetRequestTest.php @@ -0,0 +1,154 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "input" + */ + public function testPropertyInput() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "playback_policy" + */ + public function testPropertyPlaybackPolicy() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "per_title_encode" + */ + public function testPropertyPerTitleEncode() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "passthrough" + */ + public function testPropertyPassthrough() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "mp4_support" + */ + public function testPropertyMp4Support() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "normalize_audio" + */ + public function testPropertyNormalizeAudio() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "master_access" + */ + public function testPropertyMasterAccess() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "test" + */ + public function testPropertyTest() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/CreateLiveStreamRequestTest.php b/test/Model/CreateLiveStreamRequestTest.php new file mode 100644 index 0000000..2bf5f72 --- /dev/null +++ b/test/Model/CreateLiveStreamRequestTest.php @@ -0,0 +1,145 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "playback_policy" + */ + public function testPropertyPlaybackPolicy() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "new_asset_settings" + */ + public function testPropertyNewAssetSettings() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "reconnect_window" + */ + public function testPropertyReconnectWindow() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "passthrough" + */ + public function testPropertyPassthrough() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "reduced_latency" + */ + public function testPropertyReducedLatency() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "test" + */ + public function testPropertyTest() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "simulcast_targets" + */ + public function testPropertySimulcastTargets() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/CreatePlaybackIDRequestTest.php b/test/Model/CreatePlaybackIDRequestTest.php new file mode 100644 index 0000000..d3d8ab4 --- /dev/null +++ b/test/Model/CreatePlaybackIDRequestTest.php @@ -0,0 +1,91 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "policy" + */ + public function testPropertyPolicy() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/CreatePlaybackIDResponseTest.php b/test/Model/CreatePlaybackIDResponseTest.php new file mode 100644 index 0000000..99d72b7 --- /dev/null +++ b/test/Model/CreatePlaybackIDResponseTest.php @@ -0,0 +1,91 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "data" + */ + public function testPropertyData() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/CreateSimulcastTargetRequestTest.php b/test/Model/CreateSimulcastTargetRequestTest.php new file mode 100644 index 0000000..2eb6e51 --- /dev/null +++ b/test/Model/CreateSimulcastTargetRequestTest.php @@ -0,0 +1,109 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "passthrough" + */ + public function testPropertyPassthrough() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "stream_key" + */ + public function testPropertyStreamKey() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "url" + */ + public function testPropertyUrl() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/CreateTrackRequestTest.php b/test/Model/CreateTrackRequestTest.php new file mode 100644 index 0000000..5189654 --- /dev/null +++ b/test/Model/CreateTrackRequestTest.php @@ -0,0 +1,145 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "url" + */ + public function testPropertyUrl() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "type" + */ + public function testPropertyType() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "text_type" + */ + public function testPropertyTextType() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "language_code" + */ + public function testPropertyLanguageCode() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "name" + */ + public function testPropertyName() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "closed_captions" + */ + public function testPropertyClosedCaptions() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "passthrough" + */ + public function testPropertyPassthrough() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/CreateTrackResponseTest.php b/test/Model/CreateTrackResponseTest.php new file mode 100644 index 0000000..a28c9b8 --- /dev/null +++ b/test/Model/CreateTrackResponseTest.php @@ -0,0 +1,91 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "data" + */ + public function testPropertyData() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/CreateUploadRequestTest.php b/test/Model/CreateUploadRequestTest.php new file mode 100644 index 0000000..85b557a --- /dev/null +++ b/test/Model/CreateUploadRequestTest.php @@ -0,0 +1,118 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "timeout" + */ + public function testPropertyTimeout() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "cors_origin" + */ + public function testPropertyCorsOrigin() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "new_asset_settings" + */ + public function testPropertyNewAssetSettings() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "test" + */ + public function testPropertyTest() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/DeliveryReportTest.php b/test/Model/DeliveryReportTest.php new file mode 100644 index 0000000..1817402 --- /dev/null +++ b/test/Model/DeliveryReportTest.php @@ -0,0 +1,145 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "live_stream_id" + */ + public function testPropertyLiveStreamId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "asset_id" + */ + public function testPropertyAssetId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "passthrough" + */ + public function testPropertyPassthrough() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "created_at" + */ + public function testPropertyCreatedAt() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "asset_state" + */ + public function testPropertyAssetState() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "asset_duration" + */ + public function testPropertyAssetDuration() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "delivered_seconds" + */ + public function testPropertyDeliveredSeconds() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/DimensionValueTest.php b/test/Model/DimensionValueTest.php new file mode 100644 index 0000000..87b35fd --- /dev/null +++ b/test/Model/DimensionValueTest.php @@ -0,0 +1,100 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "value" + */ + public function testPropertyValue() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "total_count" + */ + public function testPropertyTotalCount() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/DisableLiveStreamResponseTest.php b/test/Model/DisableLiveStreamResponseTest.php new file mode 100644 index 0000000..59ff336 --- /dev/null +++ b/test/Model/DisableLiveStreamResponseTest.php @@ -0,0 +1,91 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "data" + */ + public function testPropertyData() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/EnableLiveStreamResponseTest.php b/test/Model/EnableLiveStreamResponseTest.php new file mode 100644 index 0000000..8c1572a --- /dev/null +++ b/test/Model/EnableLiveStreamResponseTest.php @@ -0,0 +1,91 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "data" + */ + public function testPropertyData() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ErrorTest.php b/test/Model/ErrorTest.php new file mode 100644 index 0000000..93c67d2 --- /dev/null +++ b/test/Model/ErrorTest.php @@ -0,0 +1,154 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "id" + */ + public function testPropertyId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "percentage" + */ + public function testPropertyPercentage() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "notes" + */ + public function testPropertyNotes() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "message" + */ + public function testPropertyMessage() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "last_seen" + */ + public function testPropertyLastSeen() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "description" + */ + public function testPropertyDescription() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "count" + */ + public function testPropertyCount() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "code" + */ + public function testPropertyCode() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/FilterValueTest.php b/test/Model/FilterValueTest.php new file mode 100644 index 0000000..f84f387 --- /dev/null +++ b/test/Model/FilterValueTest.php @@ -0,0 +1,100 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "value" + */ + public function testPropertyValue() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "total_count" + */ + public function testPropertyTotalCount() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/GetAssetInputInfoResponseTest.php b/test/Model/GetAssetInputInfoResponseTest.php new file mode 100644 index 0000000..52fc782 --- /dev/null +++ b/test/Model/GetAssetInputInfoResponseTest.php @@ -0,0 +1,91 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "data" + */ + public function testPropertyData() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/GetAssetOrLiveStreamIdResponseDataObjectTest.php b/test/Model/GetAssetOrLiveStreamIdResponseDataObjectTest.php new file mode 100644 index 0000000..9eb2319 --- /dev/null +++ b/test/Model/GetAssetOrLiveStreamIdResponseDataObjectTest.php @@ -0,0 +1,100 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "id" + */ + public function testPropertyId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "type" + */ + public function testPropertyType() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/GetAssetOrLiveStreamIdResponseDataTest.php b/test/Model/GetAssetOrLiveStreamIdResponseDataTest.php new file mode 100644 index 0000000..cd9e315 --- /dev/null +++ b/test/Model/GetAssetOrLiveStreamIdResponseDataTest.php @@ -0,0 +1,109 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "id" + */ + public function testPropertyId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "policy" + */ + public function testPropertyPolicy() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "object" + */ + public function testPropertyObject() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/GetAssetOrLiveStreamIdResponseTest.php b/test/Model/GetAssetOrLiveStreamIdResponseTest.php new file mode 100644 index 0000000..dfc02ea --- /dev/null +++ b/test/Model/GetAssetOrLiveStreamIdResponseTest.php @@ -0,0 +1,91 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "data" + */ + public function testPropertyData() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/GetAssetPlaybackIDResponseTest.php b/test/Model/GetAssetPlaybackIDResponseTest.php new file mode 100644 index 0000000..b499f89 --- /dev/null +++ b/test/Model/GetAssetPlaybackIDResponseTest.php @@ -0,0 +1,91 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "data" + */ + public function testPropertyData() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/GetMetricTimeseriesDataResponseTest.php b/test/Model/GetMetricTimeseriesDataResponseTest.php new file mode 100644 index 0000000..71b853a --- /dev/null +++ b/test/Model/GetMetricTimeseriesDataResponseTest.php @@ -0,0 +1,109 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "data" + */ + public function testPropertyData() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "total_row_count" + */ + public function testPropertyTotalRowCount() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "timeframe" + */ + public function testPropertyTimeframe() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/GetOverallValuesResponseTest.php b/test/Model/GetOverallValuesResponseTest.php new file mode 100644 index 0000000..1a43522 --- /dev/null +++ b/test/Model/GetOverallValuesResponseTest.php @@ -0,0 +1,109 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "data" + */ + public function testPropertyData() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "total_row_count" + */ + public function testPropertyTotalRowCount() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "timeframe" + */ + public function testPropertyTimeframe() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/GetRealTimeBreakdownResponseTest.php b/test/Model/GetRealTimeBreakdownResponseTest.php new file mode 100644 index 0000000..4536887 --- /dev/null +++ b/test/Model/GetRealTimeBreakdownResponseTest.php @@ -0,0 +1,109 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "data" + */ + public function testPropertyData() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "total_row_count" + */ + public function testPropertyTotalRowCount() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "timeframe" + */ + public function testPropertyTimeframe() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/GetRealTimeHistogramTimeseriesResponseMetaTest.php b/test/Model/GetRealTimeHistogramTimeseriesResponseMetaTest.php new file mode 100644 index 0000000..fa22857 --- /dev/null +++ b/test/Model/GetRealTimeHistogramTimeseriesResponseMetaTest.php @@ -0,0 +1,91 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "buckets" + */ + public function testPropertyBuckets() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/GetRealTimeHistogramTimeseriesResponseTest.php b/test/Model/GetRealTimeHistogramTimeseriesResponseTest.php new file mode 100644 index 0000000..0acea59 --- /dev/null +++ b/test/Model/GetRealTimeHistogramTimeseriesResponseTest.php @@ -0,0 +1,118 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "meta" + */ + public function testPropertyMeta() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "data" + */ + public function testPropertyData() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "total_row_count" + */ + public function testPropertyTotalRowCount() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "timeframe" + */ + public function testPropertyTimeframe() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/GetRealTimeTimeseriesResponseTest.php b/test/Model/GetRealTimeTimeseriesResponseTest.php new file mode 100644 index 0000000..5c36ea6 --- /dev/null +++ b/test/Model/GetRealTimeTimeseriesResponseTest.php @@ -0,0 +1,109 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "data" + */ + public function testPropertyData() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "total_row_count" + */ + public function testPropertyTotalRowCount() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "timeframe" + */ + public function testPropertyTimeframe() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/IncidentBreakdownTest.php b/test/Model/IncidentBreakdownTest.php new file mode 100644 index 0000000..643709c --- /dev/null +++ b/test/Model/IncidentBreakdownTest.php @@ -0,0 +1,109 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "value" + */ + public function testPropertyValue() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "name" + */ + public function testPropertyName() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "id" + */ + public function testPropertyId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/IncidentNotificationRuleTest.php b/test/Model/IncidentNotificationRuleTest.php new file mode 100644 index 0000000..e0aa17e --- /dev/null +++ b/test/Model/IncidentNotificationRuleTest.php @@ -0,0 +1,127 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "status" + */ + public function testPropertyStatus() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "rules" + */ + public function testPropertyRules() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "property_id" + */ + public function testPropertyPropertyId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "id" + */ + public function testPropertyId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "action" + */ + public function testPropertyAction() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/IncidentNotificationTest.php b/test/Model/IncidentNotificationTest.php new file mode 100644 index 0000000..88ed9b5 --- /dev/null +++ b/test/Model/IncidentNotificationTest.php @@ -0,0 +1,109 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "queued_at" + */ + public function testPropertyQueuedAt() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "id" + */ + public function testPropertyId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "attempted_at" + */ + public function testPropertyAttemptedAt() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/IncidentResponseTest.php b/test/Model/IncidentResponseTest.php new file mode 100644 index 0000000..5825e03 --- /dev/null +++ b/test/Model/IncidentResponseTest.php @@ -0,0 +1,100 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "data" + */ + public function testPropertyData() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "timeframe" + */ + public function testPropertyTimeframe() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/IncidentTest.php b/test/Model/IncidentTest.php new file mode 100644 index 0000000..61860a0 --- /dev/null +++ b/test/Model/IncidentTest.php @@ -0,0 +1,271 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "threshold" + */ + public function testPropertyThreshold() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "status" + */ + public function testPropertyStatus() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "started_at" + */ + public function testPropertyStartedAt() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "severity" + */ + public function testPropertySeverity() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "sample_size_unit" + */ + public function testPropertySampleSizeUnit() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "sample_size" + */ + public function testPropertySampleSize() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "resolved_at" + */ + public function testPropertyResolvedAt() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "notifications" + */ + public function testPropertyNotifications() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "notification_rules" + */ + public function testPropertyNotificationRules() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "measurement" + */ + public function testPropertyMeasurement() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "measured_value_on_close" + */ + public function testPropertyMeasuredValueOnClose() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "measured_value" + */ + public function testPropertyMeasuredValue() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "incident_key" + */ + public function testPropertyIncidentKey() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "impact" + */ + public function testPropertyImpact() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "id" + */ + public function testPropertyId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "error_description" + */ + public function testPropertyErrorDescription() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "description" + */ + public function testPropertyDescription() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "breakdowns" + */ + public function testPropertyBreakdowns() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "affected_views_per_hour_on_open" + */ + public function testPropertyAffectedViewsPerHourOnOpen() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "affected_views_per_hour" + */ + public function testPropertyAffectedViewsPerHour() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "affected_views" + */ + public function testPropertyAffectedViews() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/InputFileTest.php b/test/Model/InputFileTest.php new file mode 100644 index 0000000..a6fe62f --- /dev/null +++ b/test/Model/InputFileTest.php @@ -0,0 +1,100 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "container_format" + */ + public function testPropertyContainerFormat() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "tracks" + */ + public function testPropertyTracks() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/InputInfoTest.php b/test/Model/InputInfoTest.php new file mode 100644 index 0000000..891e864 --- /dev/null +++ b/test/Model/InputInfoTest.php @@ -0,0 +1,100 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "settings" + */ + public function testPropertySettings() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "file" + */ + public function testPropertyFile() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/InputSettingsOverlaySettingsTest.php b/test/Model/InputSettingsOverlaySettingsTest.php new file mode 100644 index 0000000..9470e8b --- /dev/null +++ b/test/Model/InputSettingsOverlaySettingsTest.php @@ -0,0 +1,145 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "vertical_align" + */ + public function testPropertyVerticalAlign() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "vertical_margin" + */ + public function testPropertyVerticalMargin() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "horizontal_align" + */ + public function testPropertyHorizontalAlign() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "horizontal_margin" + */ + public function testPropertyHorizontalMargin() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "width" + */ + public function testPropertyWidth() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "height" + */ + public function testPropertyHeight() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "opacity" + */ + public function testPropertyOpacity() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/InputSettingsTest.php b/test/Model/InputSettingsTest.php new file mode 100644 index 0000000..61a8af1 --- /dev/null +++ b/test/Model/InputSettingsTest.php @@ -0,0 +1,172 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "url" + */ + public function testPropertyUrl() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "overlay_settings" + */ + public function testPropertyOverlaySettings() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "start_time" + */ + public function testPropertyStartTime() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "end_time" + */ + public function testPropertyEndTime() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "type" + */ + public function testPropertyType() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "text_type" + */ + public function testPropertyTextType() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "language_code" + */ + public function testPropertyLanguageCode() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "name" + */ + public function testPropertyName() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "closed_captions" + */ + public function testPropertyClosedCaptions() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "passthrough" + */ + public function testPropertyPassthrough() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/InputTrackTest.php b/test/Model/InputTrackTest.php new file mode 100644 index 0000000..3617ed0 --- /dev/null +++ b/test/Model/InputTrackTest.php @@ -0,0 +1,163 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "type" + */ + public function testPropertyType() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "duration" + */ + public function testPropertyDuration() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "encoding" + */ + public function testPropertyEncoding() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "width" + */ + public function testPropertyWidth() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "height" + */ + public function testPropertyHeight() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "frame_rate" + */ + public function testPropertyFrameRate() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "sample_rate" + */ + public function testPropertySampleRate() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "sample_size" + */ + public function testPropertySampleSize() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "channels" + */ + public function testPropertyChannels() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/InsightTest.php b/test/Model/InsightTest.php new file mode 100644 index 0000000..bd6465a --- /dev/null +++ b/test/Model/InsightTest.php @@ -0,0 +1,136 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "total_watch_time" + */ + public function testPropertyTotalWatchTime() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "total_views" + */ + public function testPropertyTotalViews() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "negative_impact_score" + */ + public function testPropertyNegativeImpactScore() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "metric" + */ + public function testPropertyMetric() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "filter_value" + */ + public function testPropertyFilterValue() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "filter_column" + */ + public function testPropertyFilterColumn() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ListAllMetricValuesResponseTest.php b/test/Model/ListAllMetricValuesResponseTest.php new file mode 100644 index 0000000..c8b3299 --- /dev/null +++ b/test/Model/ListAllMetricValuesResponseTest.php @@ -0,0 +1,109 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "data" + */ + public function testPropertyData() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "total_row_count" + */ + public function testPropertyTotalRowCount() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "timeframe" + */ + public function testPropertyTimeframe() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ListAssetsResponseTest.php b/test/Model/ListAssetsResponseTest.php new file mode 100644 index 0000000..ac34ad4 --- /dev/null +++ b/test/Model/ListAssetsResponseTest.php @@ -0,0 +1,91 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "data" + */ + public function testPropertyData() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ListBreakdownValuesResponseTest.php b/test/Model/ListBreakdownValuesResponseTest.php new file mode 100644 index 0000000..bb79193 --- /dev/null +++ b/test/Model/ListBreakdownValuesResponseTest.php @@ -0,0 +1,109 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "data" + */ + public function testPropertyData() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "total_row_count" + */ + public function testPropertyTotalRowCount() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "timeframe" + */ + public function testPropertyTimeframe() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ListDeliveryUsageResponseTest.php b/test/Model/ListDeliveryUsageResponseTest.php new file mode 100644 index 0000000..b36b465 --- /dev/null +++ b/test/Model/ListDeliveryUsageResponseTest.php @@ -0,0 +1,118 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "data" + */ + public function testPropertyData() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "total_row_count" + */ + public function testPropertyTotalRowCount() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "timeframe" + */ + public function testPropertyTimeframe() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "limit" + */ + public function testPropertyLimit() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ListDimensionValuesResponseTest.php b/test/Model/ListDimensionValuesResponseTest.php new file mode 100644 index 0000000..42a20f4 --- /dev/null +++ b/test/Model/ListDimensionValuesResponseTest.php @@ -0,0 +1,109 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "data" + */ + public function testPropertyData() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "total_row_count" + */ + public function testPropertyTotalRowCount() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "timeframe" + */ + public function testPropertyTimeframe() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ListDimensionsResponseTest.php b/test/Model/ListDimensionsResponseTest.php new file mode 100644 index 0000000..b5c66dd --- /dev/null +++ b/test/Model/ListDimensionsResponseTest.php @@ -0,0 +1,109 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "data" + */ + public function testPropertyData() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "total_row_count" + */ + public function testPropertyTotalRowCount() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "timeframe" + */ + public function testPropertyTimeframe() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ListErrorsResponseTest.php b/test/Model/ListErrorsResponseTest.php new file mode 100644 index 0000000..f7d40fc --- /dev/null +++ b/test/Model/ListErrorsResponseTest.php @@ -0,0 +1,109 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "data" + */ + public function testPropertyData() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "total_row_count" + */ + public function testPropertyTotalRowCount() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "timeframe" + */ + public function testPropertyTimeframe() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ListExportsResponseTest.php b/test/Model/ListExportsResponseTest.php new file mode 100644 index 0000000..9bb8897 --- /dev/null +++ b/test/Model/ListExportsResponseTest.php @@ -0,0 +1,109 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "data" + */ + public function testPropertyData() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "total_row_count" + */ + public function testPropertyTotalRowCount() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "timeframe" + */ + public function testPropertyTimeframe() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ListFilterValuesResponseTest.php b/test/Model/ListFilterValuesResponseTest.php new file mode 100644 index 0000000..54f0e2e --- /dev/null +++ b/test/Model/ListFilterValuesResponseTest.php @@ -0,0 +1,109 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "data" + */ + public function testPropertyData() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "total_row_count" + */ + public function testPropertyTotalRowCount() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "timeframe" + */ + public function testPropertyTimeframe() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ListFiltersResponseDataTest.php b/test/Model/ListFiltersResponseDataTest.php new file mode 100644 index 0000000..475e94d --- /dev/null +++ b/test/Model/ListFiltersResponseDataTest.php @@ -0,0 +1,100 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "basic" + */ + public function testPropertyBasic() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "advanced" + */ + public function testPropertyAdvanced() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ListFiltersResponseTest.php b/test/Model/ListFiltersResponseTest.php new file mode 100644 index 0000000..9621dce --- /dev/null +++ b/test/Model/ListFiltersResponseTest.php @@ -0,0 +1,109 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "data" + */ + public function testPropertyData() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "total_row_count" + */ + public function testPropertyTotalRowCount() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "timeframe" + */ + public function testPropertyTimeframe() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ListIncidentsResponseTest.php b/test/Model/ListIncidentsResponseTest.php new file mode 100644 index 0000000..81b64e8 --- /dev/null +++ b/test/Model/ListIncidentsResponseTest.php @@ -0,0 +1,109 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "data" + */ + public function testPropertyData() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "total_row_count" + */ + public function testPropertyTotalRowCount() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "timeframe" + */ + public function testPropertyTimeframe() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ListInsightsResponseTest.php b/test/Model/ListInsightsResponseTest.php new file mode 100644 index 0000000..725007a --- /dev/null +++ b/test/Model/ListInsightsResponseTest.php @@ -0,0 +1,109 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "data" + */ + public function testPropertyData() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "total_row_count" + */ + public function testPropertyTotalRowCount() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "timeframe" + */ + public function testPropertyTimeframe() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ListLiveStreamsResponseTest.php b/test/Model/ListLiveStreamsResponseTest.php new file mode 100644 index 0000000..fbc4760 --- /dev/null +++ b/test/Model/ListLiveStreamsResponseTest.php @@ -0,0 +1,91 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "data" + */ + public function testPropertyData() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ListRealTimeDimensionsResponseDataTest.php b/test/Model/ListRealTimeDimensionsResponseDataTest.php new file mode 100644 index 0000000..6353ec8 --- /dev/null +++ b/test/Model/ListRealTimeDimensionsResponseDataTest.php @@ -0,0 +1,100 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "name" + */ + public function testPropertyName() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "display_name" + */ + public function testPropertyDisplayName() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ListRealTimeDimensionsResponseTest.php b/test/Model/ListRealTimeDimensionsResponseTest.php new file mode 100644 index 0000000..ca37aa9 --- /dev/null +++ b/test/Model/ListRealTimeDimensionsResponseTest.php @@ -0,0 +1,109 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "data" + */ + public function testPropertyData() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "total_row_count" + */ + public function testPropertyTotalRowCount() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "timeframe" + */ + public function testPropertyTimeframe() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ListRealTimeMetricsResponseTest.php b/test/Model/ListRealTimeMetricsResponseTest.php new file mode 100644 index 0000000..3f09055 --- /dev/null +++ b/test/Model/ListRealTimeMetricsResponseTest.php @@ -0,0 +1,109 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "data" + */ + public function testPropertyData() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "total_row_count" + */ + public function testPropertyTotalRowCount() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "timeframe" + */ + public function testPropertyTimeframe() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ListRelatedIncidentsResponseTest.php b/test/Model/ListRelatedIncidentsResponseTest.php new file mode 100644 index 0000000..3cbc42b --- /dev/null +++ b/test/Model/ListRelatedIncidentsResponseTest.php @@ -0,0 +1,109 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "data" + */ + public function testPropertyData() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "total_row_count" + */ + public function testPropertyTotalRowCount() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "timeframe" + */ + public function testPropertyTimeframe() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ListSigningKeysResponseTest.php b/test/Model/ListSigningKeysResponseTest.php new file mode 100644 index 0000000..7a38a53 --- /dev/null +++ b/test/Model/ListSigningKeysResponseTest.php @@ -0,0 +1,91 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "data" + */ + public function testPropertyData() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ListUploadsResponseTest.php b/test/Model/ListUploadsResponseTest.php new file mode 100644 index 0000000..2fb50bb --- /dev/null +++ b/test/Model/ListUploadsResponseTest.php @@ -0,0 +1,91 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "data" + */ + public function testPropertyData() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ListVideoViewsResponseTest.php b/test/Model/ListVideoViewsResponseTest.php new file mode 100644 index 0000000..47d762d --- /dev/null +++ b/test/Model/ListVideoViewsResponseTest.php @@ -0,0 +1,109 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "data" + */ + public function testPropertyData() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "total_row_count" + */ + public function testPropertyTotalRowCount() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "timeframe" + */ + public function testPropertyTimeframe() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/LiveStreamResponseTest.php b/test/Model/LiveStreamResponseTest.php new file mode 100644 index 0000000..d3d98dd --- /dev/null +++ b/test/Model/LiveStreamResponseTest.php @@ -0,0 +1,91 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "data" + */ + public function testPropertyData() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/LiveStreamTest.php b/test/Model/LiveStreamTest.php new file mode 100644 index 0000000..df9072e --- /dev/null +++ b/test/Model/LiveStreamTest.php @@ -0,0 +1,199 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "id" + */ + public function testPropertyId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "created_at" + */ + public function testPropertyCreatedAt() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "stream_key" + */ + public function testPropertyStreamKey() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "active_asset_id" + */ + public function testPropertyActiveAssetId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "recent_asset_ids" + */ + public function testPropertyRecentAssetIds() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "status" + */ + public function testPropertyStatus() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "playback_ids" + */ + public function testPropertyPlaybackIds() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "new_asset_settings" + */ + public function testPropertyNewAssetSettings() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "passthrough" + */ + public function testPropertyPassthrough() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "reconnect_window" + */ + public function testPropertyReconnectWindow() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "reduced_latency" + */ + public function testPropertyReducedLatency() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "simulcast_targets" + */ + public function testPropertySimulcastTargets() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "test" + */ + public function testPropertyTest() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/MetricTest.php b/test/Model/MetricTest.php new file mode 100644 index 0000000..5efa0e2 --- /dev/null +++ b/test/Model/MetricTest.php @@ -0,0 +1,127 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "value" + */ + public function testPropertyValue() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "type" + */ + public function testPropertyType() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "name" + */ + public function testPropertyName() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "metric" + */ + public function testPropertyMetric() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "measurement" + */ + public function testPropertyMeasurement() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/NotificationRuleTest.php b/test/Model/NotificationRuleTest.php new file mode 100644 index 0000000..3c247ee --- /dev/null +++ b/test/Model/NotificationRuleTest.php @@ -0,0 +1,109 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "value" + */ + public function testPropertyValue() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "name" + */ + public function testPropertyName() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "id" + */ + public function testPropertyId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/OverallValuesTest.php b/test/Model/OverallValuesTest.php new file mode 100644 index 0000000..874d119 --- /dev/null +++ b/test/Model/OverallValuesTest.php @@ -0,0 +1,118 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "value" + */ + public function testPropertyValue() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "total_watch_time" + */ + public function testPropertyTotalWatchTime() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "total_views" + */ + public function testPropertyTotalViews() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "global_value" + */ + public function testPropertyGlobalValue() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/PlaybackIDTest.php b/test/Model/PlaybackIDTest.php new file mode 100644 index 0000000..18a01f6 --- /dev/null +++ b/test/Model/PlaybackIDTest.php @@ -0,0 +1,100 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "id" + */ + public function testPropertyId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "policy" + */ + public function testPropertyPolicy() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/PlaybackPolicyTest.php b/test/Model/PlaybackPolicyTest.php new file mode 100644 index 0000000..021dff5 --- /dev/null +++ b/test/Model/PlaybackPolicyTest.php @@ -0,0 +1,82 @@ +markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/RealTimeBreakdownValueTest.php b/test/Model/RealTimeBreakdownValueTest.php new file mode 100644 index 0000000..ee62376 --- /dev/null +++ b/test/Model/RealTimeBreakdownValueTest.php @@ -0,0 +1,127 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "value" + */ + public function testPropertyValue() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "negative_impact" + */ + public function testPropertyNegativeImpact() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "metric_value" + */ + public function testPropertyMetricValue() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "display_value" + */ + public function testPropertyDisplayValue() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "concurent_viewers" + */ + public function testPropertyConcurentViewers() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/RealTimeHistogramTimeseriesBucketTest.php b/test/Model/RealTimeHistogramTimeseriesBucketTest.php new file mode 100644 index 0000000..49bef95 --- /dev/null +++ b/test/Model/RealTimeHistogramTimeseriesBucketTest.php @@ -0,0 +1,100 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "start" + */ + public function testPropertyStart() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "end" + */ + public function testPropertyEnd() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/RealTimeHistogramTimeseriesBucketValuesTest.php b/test/Model/RealTimeHistogramTimeseriesBucketValuesTest.php new file mode 100644 index 0000000..b006119 --- /dev/null +++ b/test/Model/RealTimeHistogramTimeseriesBucketValuesTest.php @@ -0,0 +1,100 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "percentage" + */ + public function testPropertyPercentage() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "count" + */ + public function testPropertyCount() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/RealTimeHistogramTimeseriesDatapointTest.php b/test/Model/RealTimeHistogramTimeseriesDatapointTest.php new file mode 100644 index 0000000..3736b51 --- /dev/null +++ b/test/Model/RealTimeHistogramTimeseriesDatapointTest.php @@ -0,0 +1,145 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "timestamp" + */ + public function testPropertyTimestamp() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "sum" + */ + public function testPropertySum() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "p95" + */ + public function testPropertyP95() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "median" + */ + public function testPropertyMedian() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "max_percentage" + */ + public function testPropertyMaxPercentage() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "bucket_values" + */ + public function testPropertyBucketValues() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "average" + */ + public function testPropertyAverage() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/RealTimeTimeseriesDatapointTest.php b/test/Model/RealTimeTimeseriesDatapointTest.php new file mode 100644 index 0000000..82cc834 --- /dev/null +++ b/test/Model/RealTimeTimeseriesDatapointTest.php @@ -0,0 +1,109 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "value" + */ + public function testPropertyValue() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "date" + */ + public function testPropertyDate() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "concurent_viewers" + */ + public function testPropertyConcurentViewers() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ScoreTest.php b/test/Model/ScoreTest.php new file mode 100644 index 0000000..d549171 --- /dev/null +++ b/test/Model/ScoreTest.php @@ -0,0 +1,136 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "watch_time" + */ + public function testPropertyWatchTime() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "view_count" + */ + public function testPropertyViewCount() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "name" + */ + public function testPropertyName() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "value" + */ + public function testPropertyValue() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "metric" + */ + public function testPropertyMetric() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "items" + */ + public function testPropertyItems() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/SignalLiveStreamCompleteResponseTest.php b/test/Model/SignalLiveStreamCompleteResponseTest.php new file mode 100644 index 0000000..cb6fe79 --- /dev/null +++ b/test/Model/SignalLiveStreamCompleteResponseTest.php @@ -0,0 +1,91 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "data" + */ + public function testPropertyData() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/SigningKeyResponseTest.php b/test/Model/SigningKeyResponseTest.php new file mode 100644 index 0000000..3e8e955 --- /dev/null +++ b/test/Model/SigningKeyResponseTest.php @@ -0,0 +1,91 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "data" + */ + public function testPropertyData() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/SigningKeyTest.php b/test/Model/SigningKeyTest.php new file mode 100644 index 0000000..ac4e5f0 --- /dev/null +++ b/test/Model/SigningKeyTest.php @@ -0,0 +1,109 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "id" + */ + public function testPropertyId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "created_at" + */ + public function testPropertyCreatedAt() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "private_key" + */ + public function testPropertyPrivateKey() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/SimulcastTargetResponseTest.php b/test/Model/SimulcastTargetResponseTest.php new file mode 100644 index 0000000..b6b3b3d --- /dev/null +++ b/test/Model/SimulcastTargetResponseTest.php @@ -0,0 +1,91 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "data" + */ + public function testPropertyData() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/SimulcastTargetTest.php b/test/Model/SimulcastTargetTest.php new file mode 100644 index 0000000..1ca1e30 --- /dev/null +++ b/test/Model/SimulcastTargetTest.php @@ -0,0 +1,127 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "id" + */ + public function testPropertyId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "passthrough" + */ + public function testPropertyPassthrough() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "status" + */ + public function testPropertyStatus() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "stream_key" + */ + public function testPropertyStreamKey() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "url" + */ + public function testPropertyUrl() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/TrackTest.php b/test/Model/TrackTest.php new file mode 100644 index 0000000..a63b255 --- /dev/null +++ b/test/Model/TrackTest.php @@ -0,0 +1,199 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "id" + */ + public function testPropertyId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "type" + */ + public function testPropertyType() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "duration" + */ + public function testPropertyDuration() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "max_width" + */ + public function testPropertyMaxWidth() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "max_height" + */ + public function testPropertyMaxHeight() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "max_frame_rate" + */ + public function testPropertyMaxFrameRate() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "max_channels" + */ + public function testPropertyMaxChannels() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "max_channel_layout" + */ + public function testPropertyMaxChannelLayout() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "text_type" + */ + public function testPropertyTextType() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "language_code" + */ + public function testPropertyLanguageCode() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "name" + */ + public function testPropertyName() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "closed_captions" + */ + public function testPropertyClosedCaptions() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "passthrough" + */ + public function testPropertyPassthrough() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/UpdateAssetMP4SupportRequestTest.php b/test/Model/UpdateAssetMP4SupportRequestTest.php new file mode 100644 index 0000000..8cd7a81 --- /dev/null +++ b/test/Model/UpdateAssetMP4SupportRequestTest.php @@ -0,0 +1,91 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "mp4_support" + */ + public function testPropertyMp4Support() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/UpdateAssetMasterAccessRequestTest.php b/test/Model/UpdateAssetMasterAccessRequestTest.php new file mode 100644 index 0000000..c04ec40 --- /dev/null +++ b/test/Model/UpdateAssetMasterAccessRequestTest.php @@ -0,0 +1,91 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "master_access" + */ + public function testPropertyMasterAccess() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/UploadErrorTest.php b/test/Model/UploadErrorTest.php new file mode 100644 index 0000000..e28a030 --- /dev/null +++ b/test/Model/UploadErrorTest.php @@ -0,0 +1,100 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "type" + */ + public function testPropertyType() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "message" + */ + public function testPropertyMessage() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/UploadResponseTest.php b/test/Model/UploadResponseTest.php new file mode 100644 index 0000000..66d252f --- /dev/null +++ b/test/Model/UploadResponseTest.php @@ -0,0 +1,91 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "data" + */ + public function testPropertyData() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/UploadTest.php b/test/Model/UploadTest.php new file mode 100644 index 0000000..1bdcf9a --- /dev/null +++ b/test/Model/UploadTest.php @@ -0,0 +1,163 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "id" + */ + public function testPropertyId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "timeout" + */ + public function testPropertyTimeout() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "status" + */ + public function testPropertyStatus() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "new_asset_settings" + */ + public function testPropertyNewAssetSettings() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "asset_id" + */ + public function testPropertyAssetId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "error" + */ + public function testPropertyError() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "cors_origin" + */ + public function testPropertyCorsOrigin() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "url" + */ + public function testPropertyUrl() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "test" + */ + public function testPropertyTest() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/VideoViewEventTest.php b/test/Model/VideoViewEventTest.php new file mode 100644 index 0000000..b885994 --- /dev/null +++ b/test/Model/VideoViewEventTest.php @@ -0,0 +1,118 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "viewer_time" + */ + public function testPropertyViewerTime() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "playback_time" + */ + public function testPropertyPlaybackTime() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "name" + */ + public function testPropertyName() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "event_time" + */ + public function testPropertyEventTime() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/VideoViewResponseTest.php b/test/Model/VideoViewResponseTest.php new file mode 100644 index 0000000..1c45649 --- /dev/null +++ b/test/Model/VideoViewResponseTest.php @@ -0,0 +1,100 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "data" + */ + public function testPropertyData() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "timeframe" + */ + public function testPropertyTimeframe() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/VideoViewTest.php b/test/Model/VideoViewTest.php new file mode 100644 index 0000000..0b39635 --- /dev/null +++ b/test/Model/VideoViewTest.php @@ -0,0 +1,1090 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "view_total_upscaling" + */ + public function testPropertyViewTotalUpscaling() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "preroll_ad_asset_hostname" + */ + public function testPropertyPrerollAdAssetHostname() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "player_source_domain" + */ + public function testPropertyPlayerSourceDomain() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "region" + */ + public function testPropertyRegion() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "viewer_user_agent" + */ + public function testPropertyViewerUserAgent() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "preroll_requested" + */ + public function testPropertyPrerollRequested() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "page_type" + */ + public function testPropertyPageType() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "startup_score" + */ + public function testPropertyStartupScore() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "view_seek_duration" + */ + public function testPropertyViewSeekDuration() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "country_name" + */ + public function testPropertyCountryName() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "player_source_height" + */ + public function testPropertyPlayerSourceHeight() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "longitude" + */ + public function testPropertyLongitude() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "buffering_count" + */ + public function testPropertyBufferingCount() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "video_duration" + */ + public function testPropertyVideoDuration() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "player_source_type" + */ + public function testPropertyPlayerSourceType() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "city" + */ + public function testPropertyCity() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "view_id" + */ + public function testPropertyViewId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "platform_description" + */ + public function testPropertyPlatformDescription() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "video_startup_preroll_request_time" + */ + public function testPropertyVideoStartupPrerollRequestTime() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "viewer_device_name" + */ + public function testPropertyViewerDeviceName() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "video_series" + */ + public function testPropertyVideoSeries() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "viewer_application_name" + */ + public function testPropertyViewerApplicationName() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "updated_at" + */ + public function testPropertyUpdatedAt() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "view_total_content_playback_time" + */ + public function testPropertyViewTotalContentPlaybackTime() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "cdn" + */ + public function testPropertyCdn() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "player_instance_id" + */ + public function testPropertyPlayerInstanceId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "video_language" + */ + public function testPropertyVideoLanguage() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "player_source_width" + */ + public function testPropertyPlayerSourceWidth() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "player_error_message" + */ + public function testPropertyPlayerErrorMessage() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "player_mux_plugin_version" + */ + public function testPropertyPlayerMuxPluginVersion() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "watched" + */ + public function testPropertyWatched() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "playback_score" + */ + public function testPropertyPlaybackScore() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "page_url" + */ + public function testPropertyPageUrl() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "metro" + */ + public function testPropertyMetro() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "view_max_request_latency" + */ + public function testPropertyViewMaxRequestLatency() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "requests_for_first_preroll" + */ + public function testPropertyRequestsForFirstPreroll() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "view_total_downscaling" + */ + public function testPropertyViewTotalDownscaling() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "latitude" + */ + public function testPropertyLatitude() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "player_source_host_name" + */ + public function testPropertyPlayerSourceHostName() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "inserted_at" + */ + public function testPropertyInsertedAt() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "view_end" + */ + public function testPropertyViewEnd() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "mux_embed_version" + */ + public function testPropertyMuxEmbedVersion() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "player_language" + */ + public function testPropertyPlayerLanguage() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "page_load_time" + */ + public function testPropertyPageLoadTime() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "viewer_device_category" + */ + public function testPropertyViewerDeviceCategory() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "video_startup_preroll_load_time" + */ + public function testPropertyVideoStartupPrerollLoadTime() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "player_version" + */ + public function testPropertyPlayerVersion() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "watch_time" + */ + public function testPropertyWatchTime() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "player_source_stream_type" + */ + public function testPropertyPlayerSourceStreamType() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "preroll_ad_tag_hostname" + */ + public function testPropertyPrerollAdTagHostname() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "viewer_device_manufacturer" + */ + public function testPropertyViewerDeviceManufacturer() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "rebuffering_score" + */ + public function testPropertyRebufferingScore() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "experiment_name" + */ + public function testPropertyExperimentName() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "viewer_os_version" + */ + public function testPropertyViewerOsVersion() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "player_preload" + */ + public function testPropertyPlayerPreload() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "buffering_duration" + */ + public function testPropertyBufferingDuration() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "player_view_count" + */ + public function testPropertyPlayerViewCount() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "player_software" + */ + public function testPropertyPlayerSoftware() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "player_load_time" + */ + public function testPropertyPlayerLoadTime() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "platform_summary" + */ + public function testPropertyPlatformSummary() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "video_encoding_variant" + */ + public function testPropertyVideoEncodingVariant() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "player_width" + */ + public function testPropertyPlayerWidth() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "view_seek_count" + */ + public function testPropertyViewSeekCount() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "viewer_experience_score" + */ + public function testPropertyViewerExperienceScore() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "view_error_id" + */ + public function testPropertyViewErrorId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "video_variant_name" + */ + public function testPropertyVideoVariantName() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "preroll_played" + */ + public function testPropertyPrerollPlayed() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "viewer_application_engine" + */ + public function testPropertyViewerApplicationEngine() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "viewer_os_architecture" + */ + public function testPropertyViewerOsArchitecture() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "player_error_code" + */ + public function testPropertyPlayerErrorCode() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "buffering_rate" + */ + public function testPropertyBufferingRate() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "events" + */ + public function testPropertyEvents() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "player_name" + */ + public function testPropertyPlayerName() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "view_start" + */ + public function testPropertyViewStart() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "view_average_request_throughput" + */ + public function testPropertyViewAverageRequestThroughput() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "video_producer" + */ + public function testPropertyVideoProducer() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "error_type_id" + */ + public function testPropertyErrorTypeId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "mux_viewer_id" + */ + public function testPropertyMuxViewerId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "video_id" + */ + public function testPropertyVideoId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "continent_code" + */ + public function testPropertyContinentCode() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "session_id" + */ + public function testPropertySessionId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "exit_before_video_start" + */ + public function testPropertyExitBeforeVideoStart() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "video_content_type" + */ + public function testPropertyVideoContentType() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "viewer_os_family" + */ + public function testPropertyViewerOsFamily() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "player_poster" + */ + public function testPropertyPlayerPoster() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "view_average_request_latency" + */ + public function testPropertyViewAverageRequestLatency() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "video_variant_id" + */ + public function testPropertyVideoVariantId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "player_source_duration" + */ + public function testPropertyPlayerSourceDuration() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "player_source_url" + */ + public function testPropertyPlayerSourceUrl() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "mux_api_version" + */ + public function testPropertyMuxApiVersion() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "video_title" + */ + public function testPropertyVideoTitle() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "id" + */ + public function testPropertyId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "short_time" + */ + public function testPropertyShortTime() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "rebuffer_percentage" + */ + public function testPropertyRebufferPercentage() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "time_to_first_frame" + */ + public function testPropertyTimeToFirstFrame() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "viewer_user_id" + */ + public function testPropertyViewerUserId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "video_stream_type" + */ + public function testPropertyVideoStreamType() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "player_startup_time" + */ + public function testPropertyPlayerStartupTime() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "viewer_application_version" + */ + public function testPropertyViewerApplicationVersion() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "view_max_downscale_percentage" + */ + public function testPropertyViewMaxDownscalePercentage() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "view_max_upscale_percentage" + */ + public function testPropertyViewMaxUpscalePercentage() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "country_code" + */ + public function testPropertyCountryCode() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "used_fullscreen" + */ + public function testPropertyUsedFullscreen() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "isp" + */ + public function testPropertyIsp() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "property_id" + */ + public function testPropertyPropertyId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "player_autoplay" + */ + public function testPropertyPlayerAutoplay() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "player_height" + */ + public function testPropertyPlayerHeight() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "asn" + */ + public function testPropertyAsn() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "asn_name" + */ + public function testPropertyAsnName() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "quality_score" + */ + public function testPropertyQualityScore() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "player_software_version" + */ + public function testPropertyPlayerSoftwareVersion() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "player_mux_plugin_name" + */ + public function testPropertyPlayerMuxPluginName() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +}