diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index 7c39b86..b185fe2 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -28,6 +28,7 @@ MuxPhp/Models/Asset.php MuxPhp/Models/AssetErrors.php MuxPhp/Models/AssetGeneratedSubtitleSettings.php MuxPhp/Models/AssetMaster.php +MuxPhp/Models/AssetMetadata.php MuxPhp/Models/AssetNonStandardInputReasons.php MuxPhp/Models/AssetRecordingTimes.php MuxPhp/Models/AssetResponse.php @@ -205,6 +206,7 @@ docs/Model/Asset.md docs/Model/AssetErrors.md docs/Model/AssetGeneratedSubtitleSettings.md docs/Model/AssetMaster.md +docs/Model/AssetMetadata.md docs/Model/AssetNonStandardInputReasons.md docs/Model/AssetRecordingTimes.md docs/Model/AssetResponse.md diff --git a/MuxPhp/Configuration.php b/MuxPhp/Configuration.php index 746c322..55025c0 100644 --- a/MuxPhp/Configuration.php +++ b/MuxPhp/Configuration.php @@ -91,7 +91,7 @@ class Configuration * * @var string */ - protected $userAgent = 'Mux PHP | 4.0.0'; + protected $userAgent = 'Mux PHP | 5.0.0'; /** * Debug switch (default set to false) @@ -400,7 +400,7 @@ public static function toDebugReport() $report .= ' OS: ' . php_uname() . PHP_EOL; $report .= ' PHP Version: ' . PHP_VERSION . PHP_EOL; $report .= ' The version of the OpenAPI document: v1' . PHP_EOL; - $report .= ' SDK Package Version: 4.0.0' . PHP_EOL; + $report .= ' SDK Package Version: 5.0.0' . PHP_EOL; $report .= ' Temp Folder Path: ' . self::getDefaultConfiguration()->getTempFolderPath() . PHP_EOL; return $report; diff --git a/MuxPhp/Models/Asset.php b/MuxPhp/Models/Asset.php index 89f59fa..696936d 100644 --- a/MuxPhp/Models/Asset.php +++ b/MuxPhp/Models/Asset.php @@ -88,7 +88,8 @@ class Asset implements ModelInterface, ArrayAccess, \JsonSerializable 'recording_times' => '\MuxPhp\Models\AssetRecordingTimes[]', 'non_standard_input_reasons' => '\MuxPhp\Models\AssetNonStandardInputReasons', 'test' => 'bool', - 'ingest_type' => 'string' + 'ingest_type' => 'string', + 'meta' => '\MuxPhp\Models\AssetMetadata' ]; /** @@ -127,7 +128,8 @@ class Asset implements ModelInterface, ArrayAccess, \JsonSerializable 'recording_times' => null, 'non_standard_input_reasons' => null, 'test' => 'boolean', - 'ingest_type' => null + 'ingest_type' => null, + 'meta' => null ]; /** @@ -164,7 +166,8 @@ class Asset implements ModelInterface, ArrayAccess, \JsonSerializable 'recording_times' => false, 'non_standard_input_reasons' => false, 'test' => false, - 'ingest_type' => false + 'ingest_type' => false, + 'meta' => false ]; /** @@ -271,7 +274,8 @@ public function isNullableSetToNull(string $property): bool 'recording_times' => 'recording_times', 'non_standard_input_reasons' => 'non_standard_input_reasons', 'test' => 'test', - 'ingest_type' => 'ingest_type' + 'ingest_type' => 'ingest_type', + 'meta' => 'meta' ]; /** @@ -308,7 +312,8 @@ public function isNullableSetToNull(string $property): bool 'recording_times' => 'setRecordingTimes', 'non_standard_input_reasons' => 'setNonStandardInputReasons', 'test' => 'setTest', - 'ingest_type' => 'setIngestType' + 'ingest_type' => 'setIngestType', + 'meta' => 'setMeta' ]; /** @@ -345,7 +350,8 @@ public function isNullableSetToNull(string $property): bool 'recording_times' => 'getRecordingTimes', 'non_standard_input_reasons' => 'getNonStandardInputReasons', 'test' => 'getTest', - 'ingest_type' => 'getIngestType' + 'ingest_type' => 'getIngestType', + 'meta' => 'getMeta' ]; /** @@ -604,6 +610,7 @@ public function __construct(array $data = null) $this->setIfExists('non_standard_input_reasons', $data ?? [], null); $this->setIfExists('test', $data ?? [], null); $this->setIfExists('ingest_type', $data ?? [], null); + $this->setIfExists('meta', $data ?? [], null); } /** @@ -1301,7 +1308,7 @@ public function getPassthrough() /** * Sets passthrough * - * @param string|null $passthrough Arbitrary user-supplied metadata set for the asset. Max 255 characters. + * @param string|null $passthrough You can set this field to anything you want. It will be included in the asset details and related webhooks. If you're looking for more structured metadata, such as `title` or `external_id` , you can use the `meta` object instead. **Max: 255 characters**. * * @return self */ @@ -1667,6 +1674,35 @@ public function setIngestType($ingest_type) return $this; } + + /** + * Gets meta + * + * @return \MuxPhp\Models\AssetMetadata|null + */ + public function getMeta() + { + return $this->container['meta']; + } + + /** + * Sets meta + * + * @param \MuxPhp\Models\AssetMetadata|null $meta meta + * + * @return self + */ + public function setMeta($meta) + { + + if (is_null($meta)) { + throw new \InvalidArgumentException('non-nullable meta cannot be null'); + } + + $this->container['meta'] = $meta; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/MuxPhp/Models/AssetMetadata.php b/MuxPhp/Models/AssetMetadata.php new file mode 100644 index 0000000..c5c39dd --- /dev/null +++ b/MuxPhp/Models/AssetMetadata.php @@ -0,0 +1,503 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class AssetMetadata implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'AssetMetadata'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'title' => 'string', + 'creator_id' => 'string', + 'external_id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'title' => null, + 'creator_id' => null, + 'external_id' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'title' => false, + 'creator_id' => false, + 'external_id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'title' => 'title', + 'creator_id' => 'creator_id', + 'external_id' => 'external_id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'title' => 'setTitle', + 'creator_id' => 'setCreatorId', + 'external_id' => 'setExternalId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'title' => 'getTitle', + 'creator_id' => 'getCreatorId', + 'external_id' => 'getExternalId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + // MUX: enum hack (self::) due to OAS emitting problems. + // please re-integrate with mainline when possible. + // src: https://github.com/OpenAPITools/openapi-generator/issues/9038 + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('creator_id', $data ?? [], null); + $this->setIfExists('external_id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!is_null($this->container['title']) && (mb_strlen($this->container['title']) > 512)) { + $invalidProperties[] = "invalid value for 'title', the character length must be smaller than or equal to 512."; + } + + if (!is_null($this->container['creator_id']) && (mb_strlen($this->container['creator_id']) > 128)) { + $invalidProperties[] = "invalid value for 'creator_id', the character length must be smaller than or equal to 128."; + } + + if (!is_null($this->container['external_id']) && (mb_strlen($this->container['external_id']) > 128)) { + $invalidProperties[] = "invalid value for 'external_id', the character length must be smaller than or equal to 128."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets title + * + * @return string|null + */ + public function getTitle() + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param string|null $title The video title. Max 512 code points. + * + * @return self + */ + public function setTitle($title) + { + if (!is_null($title) && (mb_strlen($title) > 512)) { + throw new \InvalidArgumentException('invalid length for $title when calling AssetMetadata., must be smaller than or equal to 512.'); + } + + + if (is_null($title)) { + throw new \InvalidArgumentException('non-nullable title cannot be null'); + } + + $this->container['title'] = $title; + + return $this; + } + + /** + * Gets creator_id + * + * @return string|null + */ + public function getCreatorId() + { + return $this->container['creator_id']; + } + + /** + * Sets creator_id + * + * @param string|null $creator_id This is an identifier you provide to keep track of the creator of the video. Max 128 code points. + * + * @return self + */ + public function setCreatorId($creator_id) + { + if (!is_null($creator_id) && (mb_strlen($creator_id) > 128)) { + throw new \InvalidArgumentException('invalid length for $creator_id when calling AssetMetadata., must be smaller than or equal to 128.'); + } + + + if (is_null($creator_id)) { + throw new \InvalidArgumentException('non-nullable creator_id cannot be null'); + } + + $this->container['creator_id'] = $creator_id; + + return $this; + } + + /** + * Gets external_id + * + * @return string|null + */ + public function getExternalId() + { + return $this->container['external_id']; + } + + /** + * Sets external_id + * + * @param string|null $external_id This is an identifier you provide to link the video to your own data. Max 128 code points. + * + * @return self + */ + public function setExternalId($external_id) + { + if (!is_null($external_id) && (mb_strlen($external_id) > 128)) { + throw new \InvalidArgumentException('invalid length for $external_id when calling AssetMetadata., must be smaller than or equal to 128.'); + } + + + if (is_null($external_id)) { + throw new \InvalidArgumentException('non-nullable external_id cannot be null'); + } + + $this->container['external_id'] = $external_id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/MuxPhp/Models/CreateAssetRequest.php b/MuxPhp/Models/CreateAssetRequest.php index edc2fcf..7df1b59 100644 --- a/MuxPhp/Models/CreateAssetRequest.php +++ b/MuxPhp/Models/CreateAssetRequest.php @@ -61,7 +61,9 @@ class CreateAssetRequest implements ModelInterface, ArrayAccess, \JsonSerializab */ protected static $openAPITypes = [ 'input' => '\MuxPhp\Models\InputSettings[]', + 'inputs' => '\MuxPhp\Models\InputSettings[]', 'playback_policy' => '\MuxPhp\Models\PlaybackPolicy[]', + 'playback_policies' => '\MuxPhp\Models\PlaybackPolicy[]', 'advanced_playback_policies' => '\MuxPhp\Models\CreatePlaybackIDRequest[]', 'per_title_encode' => 'bool', 'passthrough' => 'string', @@ -72,7 +74,8 @@ class CreateAssetRequest implements ModelInterface, ArrayAccess, \JsonSerializab 'max_resolution_tier' => 'string', 'encoding_tier' => 'string', 'video_quality' => 'string', - 'static_renditions' => '\MuxPhp\Models\CreateStaticRenditionRequest[]' + 'static_renditions' => '\MuxPhp\Models\CreateStaticRenditionRequest[]', + 'meta' => '\MuxPhp\Models\AssetMetadata' ]; /** @@ -84,7 +87,9 @@ class CreateAssetRequest implements ModelInterface, ArrayAccess, \JsonSerializab */ protected static $openAPIFormats = [ 'input' => null, + 'inputs' => null, 'playback_policy' => null, + 'playback_policies' => null, 'advanced_playback_policies' => null, 'per_title_encode' => 'boolean', 'passthrough' => null, @@ -95,7 +100,8 @@ class CreateAssetRequest implements ModelInterface, ArrayAccess, \JsonSerializab 'max_resolution_tier' => null, 'encoding_tier' => null, 'video_quality' => null, - 'static_renditions' => null + 'static_renditions' => null, + 'meta' => null ]; /** @@ -105,7 +111,9 @@ class CreateAssetRequest implements ModelInterface, ArrayAccess, \JsonSerializab */ protected static array $openAPINullables = [ 'input' => false, + 'inputs' => false, 'playback_policy' => false, + 'playback_policies' => false, 'advanced_playback_policies' => false, 'per_title_encode' => false, 'passthrough' => false, @@ -116,7 +124,8 @@ class CreateAssetRequest implements ModelInterface, ArrayAccess, \JsonSerializab 'max_resolution_tier' => false, 'encoding_tier' => false, 'video_quality' => false, - 'static_renditions' => false + 'static_renditions' => false, + 'meta' => false ]; /** @@ -196,7 +205,9 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'input' => 'input', + 'inputs' => 'inputs', 'playback_policy' => 'playback_policy', + 'playback_policies' => 'playback_policies', 'advanced_playback_policies' => 'advanced_playback_policies', 'per_title_encode' => 'per_title_encode', 'passthrough' => 'passthrough', @@ -207,7 +218,8 @@ public function isNullableSetToNull(string $property): bool 'max_resolution_tier' => 'max_resolution_tier', 'encoding_tier' => 'encoding_tier', 'video_quality' => 'video_quality', - 'static_renditions' => 'static_renditions' + 'static_renditions' => 'static_renditions', + 'meta' => 'meta' ]; /** @@ -217,7 +229,9 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'input' => 'setInput', + 'inputs' => 'setInputs', 'playback_policy' => 'setPlaybackPolicy', + 'playback_policies' => 'setPlaybackPolicies', 'advanced_playback_policies' => 'setAdvancedPlaybackPolicies', 'per_title_encode' => 'setPerTitleEncode', 'passthrough' => 'setPassthrough', @@ -228,7 +242,8 @@ public function isNullableSetToNull(string $property): bool 'max_resolution_tier' => 'setMaxResolutionTier', 'encoding_tier' => 'setEncodingTier', 'video_quality' => 'setVideoQuality', - 'static_renditions' => 'setStaticRenditions' + 'static_renditions' => 'setStaticRenditions', + 'meta' => 'setMeta' ]; /** @@ -238,7 +253,9 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'input' => 'getInput', + 'inputs' => 'getInputs', 'playback_policy' => 'getPlaybackPolicy', + 'playback_policies' => 'getPlaybackPolicies', 'advanced_playback_policies' => 'getAdvancedPlaybackPolicies', 'per_title_encode' => 'getPerTitleEncode', 'passthrough' => 'getPassthrough', @@ -249,7 +266,8 @@ public function isNullableSetToNull(string $property): bool 'max_resolution_tier' => 'getMaxResolutionTier', 'encoding_tier' => 'getEncodingTier', 'video_quality' => 'getVideoQuality', - 'static_renditions' => 'getStaticRenditions' + 'static_renditions' => 'getStaticRenditions', + 'meta' => 'getMeta' ]; /** @@ -400,7 +418,9 @@ public function __construct(array $data = null) // please re-integrate with mainline when possible. // src: https://github.com/OpenAPITools/openapi-generator/issues/9038 $this->setIfExists('input', $data ?? [], null); + $this->setIfExists('inputs', $data ?? [], null); $this->setIfExists('playback_policy', $data ?? [], null); + $this->setIfExists('playback_policies', $data ?? [], null); $this->setIfExists('advanced_playback_policies', $data ?? [], null); $this->setIfExists('per_title_encode', $data ?? [], null); $this->setIfExists('passthrough', $data ?? [], null); @@ -412,6 +432,7 @@ public function __construct(array $data = null) $this->setIfExists('encoding_tier', $data ?? [], null); $this->setIfExists('video_quality', $data ?? [], null); $this->setIfExists('static_renditions', $data ?? [], null); + $this->setIfExists('meta', $data ?? [], null); } /** @@ -505,6 +526,7 @@ public function valid() * Gets input * * @return \MuxPhp\Models\InputSettings[]|null + * @deprecated */ public function getInput() { @@ -514,9 +536,10 @@ public function getInput() /** * Sets input * - * @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. + * @param \MuxPhp\Models\InputSettings[]|null $input Deprecated. Use `inputs` instead, which accepts an identical type. * * @return self + * @deprecated */ public function setInput($input) { @@ -530,10 +553,40 @@ public function setInput($input) return $this; } + /** + * Gets inputs + * + * @return \MuxPhp\Models\InputSettings[]|null + */ + public function getInputs() + { + return $this->container['inputs']; + } + + /** + * Sets inputs + * + * @param \MuxPhp\Models\InputSettings[]|null $inputs 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 self + */ + public function setInputs($inputs) + { + + if (is_null($inputs)) { + throw new \InvalidArgumentException('non-nullable inputs cannot be null'); + } + + $this->container['inputs'] = $inputs; + + return $this; + } + /** * Gets playback_policy * * @return \MuxPhp\Models\PlaybackPolicy[]|null + * @deprecated */ public function getPlaybackPolicy() { @@ -543,9 +596,10 @@ public function getPlaybackPolicy() /** * Sets playback_policy * - * @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). * `\"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. + * @param \MuxPhp\Models\PlaybackPolicy[]|null $playback_policy Deprecated. Use `playback_policies` instead, which accepts an identical type. * * @return self + * @deprecated */ public function setPlaybackPolicy($playback_policy) { @@ -559,6 +613,35 @@ public function setPlaybackPolicy($playback_policy) return $this; } + /** + * Gets playback_policies + * + * @return \MuxPhp\Models\PlaybackPolicy[]|null + */ + public function getPlaybackPolicies() + { + return $this->container['playback_policies']; + } + + /** + * Sets playback_policies + * + * @param \MuxPhp\Models\PlaybackPolicy[]|null $playback_policies 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). * `\"signed\"` (an additional access token is required to play the asset). If no `playback_policies` are 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 self + */ + public function setPlaybackPolicies($playback_policies) + { + + if (is_null($playback_policies)) { + throw new \InvalidArgumentException('non-nullable playback_policies cannot be null'); + } + + $this->container['playback_policies'] = $playback_policies; + + return $this; + } + /** * Gets advanced_playback_policies * @@ -572,7 +655,7 @@ public function getAdvancedPlaybackPolicies() /** * Sets advanced_playback_policies * - * @param \MuxPhp\Models\CreatePlaybackIDRequest[]|null $advanced_playback_policies An array of playback policy objects that you want applied to this asset and available through `playback_ids`. `advanced_playback_policies` must be used instead of `playback_policy` when creating a DRM playback ID. + * @param \MuxPhp\Models\CreatePlaybackIDRequest[]|null $advanced_playback_policies An array of playback policy objects that you want applied to this asset and available through `playback_ids`. `advanced_playback_policies` must be used instead of `playback_policies` when creating a DRM playback ID. * * @return self */ @@ -632,7 +715,7 @@ public function getPassthrough() /** * Sets passthrough * - * @param string|null $passthrough Arbitrary user-supplied metadata that will be included in the asset details and related webhooks. Can be used to store your own ID for a video along with the asset. **Max: 255 characters**. + * @param string|null $passthrough You can set this field to anything you want. It will be included in the asset details and related webhooks. If you're looking for more structured metadata, such as `title` or `external_id`, you can use the `meta` object instead. **Max: 255 characters**. * * @return self */ @@ -933,6 +1016,35 @@ public function setStaticRenditions($static_renditions) return $this; } + + /** + * Gets meta + * + * @return \MuxPhp\Models\AssetMetadata|null + */ + public function getMeta() + { + return $this->container['meta']; + } + + /** + * Sets meta + * + * @param \MuxPhp\Models\AssetMetadata|null $meta meta + * + * @return self + */ + public function setMeta($meta) + { + + if (is_null($meta)) { + throw new \InvalidArgumentException('non-nullable meta cannot be null'); + } + + $this->container['meta'] = $meta; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/MuxPhp/Models/CreateLiveStreamRequest.php b/MuxPhp/Models/CreateLiveStreamRequest.php index 215f70d..89838bb 100644 --- a/MuxPhp/Models/CreateLiveStreamRequest.php +++ b/MuxPhp/Models/CreateLiveStreamRequest.php @@ -61,6 +61,7 @@ class CreateLiveStreamRequest implements ModelInterface, ArrayAccess, \JsonSeria */ protected static $openAPITypes = [ 'playback_policy' => '\MuxPhp\Models\PlaybackPolicy[]', + 'playback_policies' => '\MuxPhp\Models\PlaybackPolicy[]', 'advanced_playback_policies' => '\MuxPhp\Models\CreatePlaybackIDRequest[]', 'new_asset_settings' => '\MuxPhp\Models\CreateAssetRequest', 'reconnect_window' => 'float', @@ -87,6 +88,7 @@ class CreateLiveStreamRequest implements ModelInterface, ArrayAccess, \JsonSeria */ protected static $openAPIFormats = [ 'playback_policy' => null, + 'playback_policies' => null, 'advanced_playback_policies' => null, 'new_asset_settings' => null, 'reconnect_window' => 'float', @@ -111,6 +113,7 @@ class CreateLiveStreamRequest implements ModelInterface, ArrayAccess, \JsonSeria */ protected static array $openAPINullables = [ 'playback_policy' => false, + 'playback_policies' => false, 'advanced_playback_policies' => false, 'new_asset_settings' => false, 'reconnect_window' => false, @@ -205,6 +208,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'playback_policy' => 'playback_policy', + 'playback_policies' => 'playback_policies', 'advanced_playback_policies' => 'advanced_playback_policies', 'new_asset_settings' => 'new_asset_settings', 'reconnect_window' => 'reconnect_window', @@ -229,6 +233,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'playback_policy' => 'setPlaybackPolicy', + 'playback_policies' => 'setPlaybackPolicies', 'advanced_playback_policies' => 'setAdvancedPlaybackPolicies', 'new_asset_settings' => 'setNewAssetSettings', 'reconnect_window' => 'setReconnectWindow', @@ -253,6 +258,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'playback_policy' => 'getPlaybackPolicy', + 'playback_policies' => 'getPlaybackPolicies', 'advanced_playback_policies' => 'getAdvancedPlaybackPolicies', 'new_asset_settings' => 'getNewAssetSettings', 'reconnect_window' => 'getReconnectWindow', @@ -348,6 +354,7 @@ public function __construct(array $data = null) // please re-integrate with mainline when possible. // src: https://github.com/OpenAPITools/openapi-generator/issues/9038 $this->setIfExists('playback_policy', $data ?? [], null); + $this->setIfExists('playback_policies', $data ?? [], null); $this->setIfExists('advanced_playback_policies', $data ?? [], null); $this->setIfExists('new_asset_settings', $data ?? [], null); $this->setIfExists('reconnect_window', $data ?? [], 60); @@ -436,6 +443,7 @@ public function valid() * Gets playback_policy * * @return \MuxPhp\Models\PlaybackPolicy[]|null + * @deprecated */ public function getPlaybackPolicy() { @@ -445,9 +453,10 @@ public function getPlaybackPolicy() /** * Sets playback_policy * - * @param \MuxPhp\Models\PlaybackPolicy[]|null $playback_policy playback_policy + * @param \MuxPhp\Models\PlaybackPolicy[]|null $playback_policy Deprecated. Use `playback_policies` instead, which accepts an identical type. * * @return self + * @deprecated */ public function setPlaybackPolicy($playback_policy) { @@ -461,6 +470,37 @@ public function setPlaybackPolicy($playback_policy) return $this; } + /** + * Gets playback_policies + * + * @return \MuxPhp\Models\PlaybackPolicy[]|null + * @deprecated + */ + public function getPlaybackPolicies() + { + return $this->container['playback_policies']; + } + + /** + * Sets playback_policies + * + * @param \MuxPhp\Models\PlaybackPolicy[]|null $playback_policies An array of playback policy names that you want applied to this live stream and available through `playback_ids`. Options include: * `\"public\"` (anyone with the playback URL can stream the live stream). * `\"signed\"` (an additional access token is required to play the live stream). If no `playback_policies` is set, the live stream 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 self + * @deprecated + */ + public function setPlaybackPolicies($playback_policies) + { + + if (is_null($playback_policies)) { + throw new \InvalidArgumentException('non-nullable playback_policies cannot be null'); + } + + $this->container['playback_policies'] = $playback_policies; + + return $this; + } + /** * Gets advanced_playback_policies * @@ -474,7 +514,7 @@ public function getAdvancedPlaybackPolicies() /** * Sets advanced_playback_policies * - * @param \MuxPhp\Models\CreatePlaybackIDRequest[]|null $advanced_playback_policies An array of playback policy objects that you want applied to this asset and available through `playback_ids`. `advanced_playback_policies` must be used instead of `playback_policy` when creating a DRM playback ID. + * @param \MuxPhp\Models\CreatePlaybackIDRequest[]|null $advanced_playback_policies An array of playback policy objects that you want applied on this live stream and available through `playback_ids`. `advanced_playback_policies` must be used instead of `playback_policies` when creating a DRM playback ID. * * @return self */ diff --git a/MuxPhp/Models/UpdateAssetRequest.php b/MuxPhp/Models/UpdateAssetRequest.php index 81948b0..deb6ccf 100644 --- a/MuxPhp/Models/UpdateAssetRequest.php +++ b/MuxPhp/Models/UpdateAssetRequest.php @@ -60,7 +60,8 @@ class UpdateAssetRequest implements ModelInterface, ArrayAccess, \JsonSerializab * @var string[] */ protected static $openAPITypes = [ - 'passthrough' => 'string' + 'passthrough' => 'string', + 'meta' => '\MuxPhp\Models\AssetMetadata' ]; /** @@ -71,7 +72,8 @@ class UpdateAssetRequest implements ModelInterface, ArrayAccess, \JsonSerializab * @psalm-var array */ protected static $openAPIFormats = [ - 'passthrough' => null + 'passthrough' => null, + 'meta' => null ]; /** @@ -80,7 +82,8 @@ class UpdateAssetRequest implements ModelInterface, ArrayAccess, \JsonSerializab * @var boolean[] */ protected static array $openAPINullables = [ - 'passthrough' => false + 'passthrough' => false, + 'meta' => false ]; /** @@ -159,7 +162,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'passthrough' => 'passthrough' + 'passthrough' => 'passthrough', + 'meta' => 'meta' ]; /** @@ -168,7 +172,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'passthrough' => 'setPassthrough' + 'passthrough' => 'setPassthrough', + 'meta' => 'setMeta' ]; /** @@ -177,7 +182,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'passthrough' => 'getPassthrough' + 'passthrough' => 'getPassthrough', + 'meta' => 'getMeta' ]; /** @@ -241,6 +247,7 @@ public function __construct(array $data = null) // please re-integrate with mainline when possible. // src: https://github.com/OpenAPITools/openapi-generator/issues/9038 $this->setIfExists('passthrough', $data ?? [], null); + $this->setIfExists('meta', $data ?? [], null); } /** @@ -298,7 +305,7 @@ public function getPassthrough() /** * Sets passthrough * - * @param string|null $passthrough Arbitrary metadata set for the Asset. Max 255 characters. In order to clear this value, the field should be included with an empty string value. + * @param string|null $passthrough You can set this field to anything you want. It will be included in the asset details and related webhooks. If you're looking for more structured metadata, such as `title` or `external_id` , you can use the `meta` object instead. **Max: 255 characters**. In order to clear this value, the field should be included with an empty string value. * * @return self */ @@ -313,6 +320,35 @@ public function setPassthrough($passthrough) return $this; } + + /** + * Gets meta + * + * @return \MuxPhp\Models\AssetMetadata|null + */ + public function getMeta() + { + return $this->container['meta']; + } + + /** + * Sets meta + * + * @param \MuxPhp\Models\AssetMetadata|null $meta meta + * + * @return self + */ + public function setMeta($meta) + { + + if (is_null($meta)) { + throw new \InvalidArgumentException('non-nullable meta cannot be null'); + } + + $this->container['meta'] = $meta; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/MuxPhp/Models/UpdateLiveStreamNewAssetSettings.php b/MuxPhp/Models/UpdateLiveStreamNewAssetSettings.php index 78de56d..12d3d0a 100644 --- a/MuxPhp/Models/UpdateLiveStreamNewAssetSettings.php +++ b/MuxPhp/Models/UpdateLiveStreamNewAssetSettings.php @@ -63,7 +63,8 @@ class UpdateLiveStreamNewAssetSettings implements ModelInterface, ArrayAccess, \ protected static $openAPITypes = [ 'mp4_support' => 'string', 'master_access' => 'string', - 'video_quality' => 'string' + 'video_quality' => 'string', + 'meta' => '\MuxPhp\Models\AssetMetadata' ]; /** @@ -76,7 +77,8 @@ class UpdateLiveStreamNewAssetSettings implements ModelInterface, ArrayAccess, \ protected static $openAPIFormats = [ 'mp4_support' => null, 'master_access' => null, - 'video_quality' => null + 'video_quality' => null, + 'meta' => null ]; /** @@ -87,7 +89,8 @@ class UpdateLiveStreamNewAssetSettings implements ModelInterface, ArrayAccess, \ protected static array $openAPINullables = [ 'mp4_support' => false, 'master_access' => false, - 'video_quality' => false + 'video_quality' => false, + 'meta' => false ]; /** @@ -168,7 +171,8 @@ public function isNullableSetToNull(string $property): bool protected static $attributeMap = [ 'mp4_support' => 'mp4_support', 'master_access' => 'master_access', - 'video_quality' => 'video_quality' + 'video_quality' => 'video_quality', + 'meta' => 'meta' ]; /** @@ -179,7 +183,8 @@ public function isNullableSetToNull(string $property): bool protected static $setters = [ 'mp4_support' => 'setMp4Support', 'master_access' => 'setMasterAccess', - 'video_quality' => 'setVideoQuality' + 'video_quality' => 'setVideoQuality', + 'meta' => 'setMeta' ]; /** @@ -190,7 +195,8 @@ public function isNullableSetToNull(string $property): bool protected static $getters = [ 'mp4_support' => 'getMp4Support', 'master_access' => 'getMasterAccess', - 'video_quality' => 'getVideoQuality' + 'video_quality' => 'getVideoQuality', + 'meta' => 'getMeta' ]; /** @@ -307,6 +313,7 @@ public function __construct(array $data = null) $this->setIfExists('mp4_support', $data ?? [], null); $this->setIfExists('master_access', $data ?? [], null); $this->setIfExists('video_quality', $data ?? [], null); + $this->setIfExists('meta', $data ?? [], null); } /** @@ -496,6 +503,35 @@ public function setVideoQuality($video_quality) return $this; } + + /** + * Gets meta + * + * @return \MuxPhp\Models\AssetMetadata|null + */ + public function getMeta() + { + return $this->container['meta']; + } + + /** + * Sets meta + * + * @param \MuxPhp\Models\AssetMetadata|null $meta meta + * + * @return self + */ + public function setMeta($meta) + { + + if (is_null($meta)) { + throw new \InvalidArgumentException('non-nullable meta cannot be null'); + } + + $this->container['meta'] = $meta; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/MuxPhp/Models/UpdateReferrerDomainRestrictionRequest.php b/MuxPhp/Models/UpdateReferrerDomainRestrictionRequest.php index c90240e..b60b6b4 100644 --- a/MuxPhp/Models/UpdateReferrerDomainRestrictionRequest.php +++ b/MuxPhp/Models/UpdateReferrerDomainRestrictionRequest.php @@ -36,6 +36,7 @@ * UpdateReferrerDomainRestrictionRequest Class Doc Comment * * @category Class + * @description A list of domains allowed to play your videos. * @package MuxPhp * @author Mux API team * @link https://docs.mux.com diff --git a/MuxPhp/Models/Upload.php b/MuxPhp/Models/Upload.php index 5192310..0f5f3e5 100644 --- a/MuxPhp/Models/Upload.php +++ b/MuxPhp/Models/Upload.php @@ -63,7 +63,7 @@ class Upload implements ModelInterface, ArrayAccess, \JsonSerializable 'id' => 'string', 'timeout' => 'int', 'status' => 'string', - 'new_asset_settings' => '\MuxPhp\Models\Asset', + 'new_asset_settings' => '\MuxPhp\Models\CreateAssetRequest', 'asset_id' => 'string', 'error' => '\MuxPhp\Models\UploadError', 'cors_origin' => 'string', @@ -487,7 +487,7 @@ public function setStatus($status) /** * Gets new_asset_settings * - * @return \MuxPhp\Models\Asset|null + * @return \MuxPhp\Models\CreateAssetRequest|null */ public function getNewAssetSettings() { @@ -497,7 +497,7 @@ public function getNewAssetSettings() /** * Sets new_asset_settings * - * @param \MuxPhp\Models\Asset|null $new_asset_settings new_asset_settings + * @param \MuxPhp\Models\CreateAssetRequest|null $new_asset_settings new_asset_settings * * @return self */ diff --git a/MuxPhp/Models/VideoView.php b/MuxPhp/Models/VideoView.php index 9d34c3e..332543f 100644 --- a/MuxPhp/Models/VideoView.php +++ b/MuxPhp/Models/VideoView.php @@ -237,7 +237,8 @@ class VideoView implements ModelInterface, ArrayAccess, \JsonSerializable 'audio_codec' => 'string', 'video_dynamic_range_type' => 'string', 'view_cdn_edge_pop' => 'string', - 'view_cdn_origin' => 'string' + 'view_cdn_origin' => 'string', + 'video_creator_id' => 'string' ]; /** @@ -425,7 +426,8 @@ class VideoView implements ModelInterface, ArrayAccess, \JsonSerializable 'audio_codec' => null, 'video_dynamic_range_type' => null, 'view_cdn_edge_pop' => null, - 'view_cdn_origin' => null + 'view_cdn_origin' => null, + 'video_creator_id' => null ]; /** @@ -611,7 +613,8 @@ class VideoView implements ModelInterface, ArrayAccess, \JsonSerializable 'audio_codec' => true, 'video_dynamic_range_type' => true, 'view_cdn_edge_pop' => true, - 'view_cdn_origin' => true + 'view_cdn_origin' => true, + 'video_creator_id' => true ]; /** @@ -867,7 +870,8 @@ public function isNullableSetToNull(string $property): bool 'audio_codec' => 'audio_codec', 'video_dynamic_range_type' => 'video_dynamic_range_type', 'view_cdn_edge_pop' => 'view_cdn_edge_pop', - 'view_cdn_origin' => 'view_cdn_origin' + 'view_cdn_origin' => 'view_cdn_origin', + 'video_creator_id' => 'video_creator_id' ]; /** @@ -1053,7 +1057,8 @@ public function isNullableSetToNull(string $property): bool 'audio_codec' => 'setAudioCodec', 'video_dynamic_range_type' => 'setVideoDynamicRangeType', 'view_cdn_edge_pop' => 'setViewCdnEdgePop', - 'view_cdn_origin' => 'setViewCdnOrigin' + 'view_cdn_origin' => 'setViewCdnOrigin', + 'video_creator_id' => 'setVideoCreatorId' ]; /** @@ -1239,7 +1244,8 @@ public function isNullableSetToNull(string $property): bool 'audio_codec' => 'getAudioCodec', 'video_dynamic_range_type' => 'getVideoDynamicRangeType', 'view_cdn_edge_pop' => 'getViewCdnEdgePop', - 'view_cdn_origin' => 'getViewCdnOrigin' + 'view_cdn_origin' => 'getViewCdnOrigin', + 'video_creator_id' => 'getVideoCreatorId' ]; /** @@ -1480,6 +1486,7 @@ public function __construct(array $data = null) $this->setIfExists('video_dynamic_range_type', $data ?? [], null); $this->setIfExists('view_cdn_edge_pop', $data ?? [], null); $this->setIfExists('view_cdn_origin', $data ?? [], null); + $this->setIfExists('video_creator_id', $data ?? [], null); } /** @@ -7742,6 +7749,42 @@ public function setViewCdnOrigin($view_cdn_origin) return $this; } + + /** + * Gets video_creator_id + * + * @return string|null + */ + public function getVideoCreatorId() + { + return $this->container['video_creator_id']; + } + + /** + * Sets video_creator_id + * + * @param string|null $video_creator_id video_creator_id + * + * @return self + */ + public function setVideoCreatorId($video_creator_id) + { + + if (is_null($video_creator_id)) { + array_push($this->openAPINullablesSetToNull, 'video_creator_id'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('video_creator_id', $nullablesSetToNull, true); + if ($index !== false) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + $this->container['video_creator_id'] = $video_creator_id; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/README.md b/README.md index 705941a..5f02436 100644 --- a/README.md +++ b/README.md @@ -254,6 +254,7 @@ Class | Method | HTTP request | Description - [AssetErrors](docs/Model/AssetErrors.md) - [AssetGeneratedSubtitleSettings](docs/Model/AssetGeneratedSubtitleSettings.md) - [AssetMaster](docs/Model/AssetMaster.md) +- [AssetMetadata](docs/Model/AssetMetadata.md) - [AssetNonStandardInputReasons](docs/Model/AssetNonStandardInputReasons.md) - [AssetRecordingTimes](docs/Model/AssetRecordingTimes.md) - [AssetResponse](docs/Model/AssetResponse.md) @@ -427,5 +428,5 @@ devex@mux.com This PHP package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: - API version: `v1` - - Package version: `4.0.0` + - Package version: `5.0.0` - Build package: `org.openapitools.codegen.languages.PhpClientCodegen` diff --git a/composer.json b/composer.json index cb2862d..ad2b34a 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "muxinc/mux-php", - "version": "4.0.0", + "version": "5.0.0", "description": "Mux is how developers build online video. This API encompasses both Mux Video and Mux Data functionality to help you build your video-related projects better and faster than ever before.", "keywords": [ "php", diff --git a/docs/Api/AssetsApi.md b/docs/Api/AssetsApi.md index 1fab218..9c410e9 100644 --- a/docs/Api/AssetsApi.md +++ b/docs/Api/AssetsApi.md @@ -61,7 +61,7 @@ $apiInstance = new MuxPhp\Api\AssetsApi( // // In your own code you should use an associative array, or // use a "new \MuxPhp\Models\CreateAssetRequest" directly. -$create_asset_request = json_decode('{"input":[{"url":"https://muxed.s3.amazonaws.com/leds.mp4"}],"playback_policy":["public"],"video_quality":"basic"}',true); // \MuxPhp\Models\CreateAssetRequest +$create_asset_request = json_decode('{"inputs":[{"url":"https://muxed.s3.amazonaws.com/leds.mp4"}],"playback_policies":["public"],"video_quality":"basic"}',true); // \MuxPhp\Models\CreateAssetRequest try { $result = $apiInstance->createAsset($create_asset_request); diff --git a/docs/Api/DirectUploadsApi.md b/docs/Api/DirectUploadsApi.md index 5647b4b..907bfa0 100644 --- a/docs/Api/DirectUploadsApi.md +++ b/docs/Api/DirectUploadsApi.md @@ -111,7 +111,7 @@ $apiInstance = new MuxPhp\Api\DirectUploadsApi( // // In your own code you should use an associative array, or // use a "new \MuxPhp\Models\CreateUploadRequest" directly. -$create_upload_request = json_decode('{"cors_origin":"https://example.com/","new_asset_settings":{"playback_policy":["public"]}}',true); // \MuxPhp\Models\CreateUploadRequest +$create_upload_request = json_decode('{"cors_origin":"https://example.com/","new_asset_settings":{"playback_policies":["public"]}}',true); // \MuxPhp\Models\CreateUploadRequest try { $result = $apiInstance->createDirectUpload($create_upload_request); diff --git a/docs/Api/LiveStreamsApi.md b/docs/Api/LiveStreamsApi.md index 48121a2..66f67dd 100644 --- a/docs/Api/LiveStreamsApi.md +++ b/docs/Api/LiveStreamsApi.md @@ -64,7 +64,7 @@ $apiInstance = new MuxPhp\Api\LiveStreamsApi( // // In your own code you should use an associative array, or // use a "new \MuxPhp\Models\CreateLiveStreamRequest" directly. -$create_live_stream_request = json_decode('{"playback_policy":["public"],"new_asset_settings":{"playback_policy":["public"]}}',true); // \MuxPhp\Models\CreateLiveStreamRequest +$create_live_stream_request = json_decode('{"playback_policies":["public"],"new_asset_settings":{"playback_policies":["public"]}}',true); // \MuxPhp\Models\CreateLiveStreamRequest try { $result = $apiInstance->createLiveStream($create_live_stream_request); diff --git a/docs/Model/Asset.md b/docs/Model/Asset.md index 6c1c0aa..39622bf 100644 --- a/docs/Model/Asset.md +++ b/docs/Model/Asset.md @@ -21,7 +21,7 @@ Name | Type | Description | Notes **per_title_encode** | **bool** | | [optional] **upload_id** | **string** | Unique identifier for the Direct Upload. This is an optional parameter added when the asset is created from a direct upload. | [optional] **is_live** | **bool** | Indicates whether the live stream that created this asset is currently `active` and not in `idle` state. This is an optional parameter added when the asset is created from a live stream. | [optional] -**passthrough** | **string** | Arbitrary user-supplied metadata set for the asset. Max 255 characters. | [optional] +**passthrough** | **string** | You can set this field to anything you want. It will be included in the asset details and related webhooks. If you're looking for more structured metadata, such as `title` or `external_id` , you can use the `meta` object instead. **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] @@ -33,5 +33,6 @@ Name | Type | Description | Notes **non_standard_input_reasons** | [**\MuxPhp\Models\AssetNonStandardInputReasons**](AssetNonStandardInputReasons.md) | | [optional] **test** | **bool** | True means this live stream is a test asset. 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] **ingest_type** | **string** | The type of ingest used to create the asset. | [optional] +**meta** | [**\MuxPhp\Models\AssetMetadata**](AssetMetadata.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/AssetMetadata.md b/docs/Model/AssetMetadata.md new file mode 100644 index 0000000..7cd4a6a --- /dev/null +++ b/docs/Model/AssetMetadata.md @@ -0,0 +1,11 @@ +# # AssetMetadata + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**title** | **string** | The video title. Max 512 code points. | [optional] +**creator_id** | **string** | This is an identifier you provide to keep track of the creator of the video. Max 128 code points. | [optional] +**external_id** | **string** | This is an identifier you provide to link the video to your own data. Max 128 code points. | [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 c68a032..3df627e 100644 --- a/docs/Model/CreateAssetRequest.md +++ b/docs/Model/CreateAssetRequest.md @@ -4,11 +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). * `\"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] -**advanced_playback_policies** | [**\MuxPhp\Models\CreatePlaybackIDRequest[]**](CreatePlaybackIDRequest.md) | An array of playback policy objects that you want applied to this asset and available through `playback_ids`. `advanced_playback_policies` must be used instead of `playback_policy` when creating a DRM playback ID. | [optional] +**input** | [**\MuxPhp\Models\InputSettings[]**](InputSettings.md) | Deprecated. Use `inputs` instead, which accepts an identical type. | [optional] +**inputs** | [**\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) | Deprecated. Use `playback_policies` instead, which accepts an identical type. | [optional] +**playback_policies** | [**\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). * `\"signed\"` (an additional access token is required to play the asset). If no `playback_policies` are 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] +**advanced_playback_policies** | [**\MuxPhp\Models\CreatePlaybackIDRequest[]**](CreatePlaybackIDRequest.md) | An array of playback policy objects that you want applied to this asset and available through `playback_ids`. `advanced_playback_policies` must be used instead of `playback_policies` when creating a DRM playback ID. | [optional] **per_title_encode** | **bool** | | [optional] -**passthrough** | **string** | Arbitrary user-supplied metadata that will be included in the asset details and related webhooks. Can be used to store your own ID for a video along with the asset. **Max: 255 characters**. | [optional] +**passthrough** | **string** | You can set this field to anything you want. It will be included in the asset details and related webhooks. If you're looking for more structured metadata, such as `title` or `external_id`, you can use the `meta` object instead. **Max: 255 characters**. | [optional] **mp4_support** | **string** | Deprecated. See the [Static Renditions API](https://www.mux.com/docs/guides/enable-static-mp4-renditions) for the updated API. Specify what level of support for mp4 playback. You may not enable both `mp4_support` and `static_renditions`. * The `capped-1080p` option produces a single MP4 file, called `capped-1080p.mp4`, with the video resolution capped at 1080p. This option produces an `audio.m4a` file for an audio-only asset. * The `audio-only` option produces a single M4A file, called `audio.m4a` for a video or an audio-only asset. MP4 generation will error when this option is specified for a video-only asset. * The `audio-only,capped-1080p` option produces both the `audio.m4a` and `capped-1080p.mp4` files. Only the `capped-1080p.mp4` file is produced for a video-only asset, while only the `audio.m4a` file is produced for an audio-only asset. The `standard`(deprecated) option produces up to three MP4 files with different levels of resolution (`high.mp4`, `medium.mp4`, `low.mp4`, or `audio.m4a` for an audio-only asset). MP4 files are not produced for `none` (default). In most cases you should use our default HLS-based streaming playback (`{playback_id}.m3u8`) which can automatically adjust to viewers' connection speeds, but an mp4 can be useful for some legacy devices or downloading for offline playback. See the [Download your videos guide](https://docs.mux.com/guides/enable-static-mp4-renditions) for more information. | [optional] **normalize_audio** | **bool** | Normalize the audio track loudness level. This parameter is only applicable to on-demand (not live) assets. | [optional] [default to false] **master_access** | **string** | Specify what level (if any) of support for master access. Master access can be enabled temporarily for your asset to be downloaded. See the [Download your videos guide](https://docs.mux.com/guides/enable-static-mp4-renditions) for more information. | [optional] @@ -17,5 +19,6 @@ Name | Type | Description | Notes **encoding_tier** | **string** | This field is deprecated. Please use `video_quality` instead. The encoding tier informs the cost, quality, and available platform features for the asset. The default encoding tier for an account can be set in the Mux Dashboard. [See the video quality guide for more details.](https://docs.mux.com/guides/use-video-quality-levels) | [optional] **video_quality** | **string** | The video quality controls the cost, quality, and available platform features for the asset. The default video quality for an account can be set in the Mux Dashboard. This field replaces the deprecated `encoding_tier` value. [See the video quality guide for more details.](https://docs.mux.com/guides/use-video-quality-levels) | [optional] **static_renditions** | [**\MuxPhp\Models\CreateStaticRenditionRequest[]**](CreateStaticRenditionRequest.md) | An array of static renditions to create for this asset. You may not enable both `static_renditions` and `mp4_support (the latter being deprecated)` | [optional] +**meta** | [**\MuxPhp\Models\AssetMetadata**](AssetMetadata.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/CreateLiveStreamRequest.md b/docs/Model/CreateLiveStreamRequest.md index b9e8ff2..8521ad9 100644 --- a/docs/Model/CreateLiveStreamRequest.md +++ b/docs/Model/CreateLiveStreamRequest.md @@ -4,8 +4,9 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**playback_policy** | [**\MuxPhp\Models\PlaybackPolicy[]**](PlaybackPolicy.md) | | [optional] -**advanced_playback_policies** | [**\MuxPhp\Models\CreatePlaybackIDRequest[]**](CreatePlaybackIDRequest.md) | An array of playback policy objects that you want applied to this asset and available through `playback_ids`. `advanced_playback_policies` must be used instead of `playback_policy` when creating a DRM playback ID. | [optional] +**playback_policy** | [**\MuxPhp\Models\PlaybackPolicy[]**](PlaybackPolicy.md) | Deprecated. Use `playback_policies` instead, which accepts an identical type. | [optional] +**playback_policies** | [**\MuxPhp\Models\PlaybackPolicy[]**](PlaybackPolicy.md) | An array of playback policy names that you want applied to this live stream and available through `playback_ids`. Options include: * `\"public\"` (anyone with the playback URL can stream the live stream). * `\"signed\"` (an additional access token is required to play the live stream). If no `playback_policies` is set, the live stream 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] +**advanced_playback_policies** | [**\MuxPhp\Models\CreatePlaybackIDRequest[]**](CreatePlaybackIDRequest.md) | An array of playback policy objects that you want applied on this live stream and available through `playback_ids`. `advanced_playback_policies` must be used instead of `playback_policies` when creating a DRM playback ID. | [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. If not specified directly, Standard Latency streams have a Reconnect Window of 60 seconds; Reduced and Low Latency streams have a default of 0 seconds, or no Reconnect Window. For that reason, we suggest specifying a value other than zero for Reduced and Low Latency streams. Reduced and Low Latency streams with a Reconnect Window greater than zero will insert slate media into the recorded asset while waiting for the streaming software to reconnect or when there are brief interruptions in the live stream media. When using a Reconnect Window setting higher than 60 seconds with a Standard Latency stream, we highly recommend enabling slate with the `use_slate_for_standard_latency` option. | [optional] [default to 60] **use_slate_for_standard_latency** | **bool** | By default, Standard Latency live streams do not have slate media inserted while waiting for live streaming software to reconnect to Mux. Setting this to true enables slate insertion on a Standard Latency stream. | [optional] [default to false] diff --git a/docs/Model/UpdateAssetRequest.md b/docs/Model/UpdateAssetRequest.md index f32c42f..1ec75e5 100644 --- a/docs/Model/UpdateAssetRequest.md +++ b/docs/Model/UpdateAssetRequest.md @@ -4,6 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**passthrough** | **string** | Arbitrary metadata set for the Asset. Max 255 characters. In order to clear this value, the field should be included with an empty string value. | [optional] +**passthrough** | **string** | You can set this field to anything you want. It will be included in the asset details and related webhooks. If you're looking for more structured metadata, such as `title` or `external_id` , you can use the `meta` object instead. **Max: 255 characters**. In order to clear this value, the field should be included with an empty string value. | [optional] +**meta** | [**\MuxPhp\Models\AssetMetadata**](AssetMetadata.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/UpdateLiveStreamNewAssetSettings.md b/docs/Model/UpdateLiveStreamNewAssetSettings.md index 9db55b7..24e49b5 100644 --- a/docs/Model/UpdateLiveStreamNewAssetSettings.md +++ b/docs/Model/UpdateLiveStreamNewAssetSettings.md @@ -7,5 +7,6 @@ Name | Type | Description | Notes **mp4_support** | **string** | Deprecated. See the [Static Renditions API](https://www.mux.com/docs/guides/enable-static-mp4-renditions#during-live-stream-creation) for the updated API. Specify what level of support for mp4 playback should be added to new assets generated from this live stream. * The `none` option disables MP4 support for new assets. MP4 files will not be produced for an asset generated from this live stream. * The `capped-1080p` option produces a single MP4 file, called `capped-1080p.mp4`, with the video resolution capped at 1080p. This option produces an `audio.m4a` file for an audio-only asset. * The `audio-only` option produces a single M4A file, called `audio.m4a` for a video or an audio-only asset. MP4 generation will error when this option is specified for a video-only asset. * The `audio-only,capped-1080p` option produces both the `audio.m4a` and `capped-1080p.mp4` files. Only the `capped-1080p.mp4` file is produced for a video-only asset, while only the `audio.m4a` file is produced for an audio-only asset. * The `standard`(deprecated) option produces up to three MP4 files with different levels of resolution (`high.mp4`, `medium.mp4`, `low.mp4`, or `audio.m4a` for an audio-only asset). | [optional] **master_access** | **string** | Add or remove access to the master version of the video. | [optional] **video_quality** | **string** | The video quality controls the cost, quality, and available platform features for the asset. [See the video quality guide for more details.](https://docs.mux.com/guides/use-video-quality-levels) | [optional] +**meta** | [**\MuxPhp\Models\AssetMetadata**](AssetMetadata.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/Upload.md b/docs/Model/Upload.md index 673e0fa..e4420db 100644 --- a/docs/Model/Upload.md +++ b/docs/Model/Upload.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes **id** | **string** | Unique identifier for the Direct Upload. | [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] +**new_asset_settings** | [**\MuxPhp\Models\CreateAssetRequest**](CreateAssetRequest.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] diff --git a/docs/Model/VideoView.md b/docs/Model/VideoView.md index c74f683..144bd49 100644 --- a/docs/Model/VideoView.md +++ b/docs/Model/VideoView.md @@ -182,5 +182,6 @@ Name | Type | Description | Notes **video_dynamic_range_type** | **string** | | [optional] **view_cdn_edge_pop** | **string** | | [optional] **view_cdn_origin** | **string** | | [optional] +**video_creator_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/gen/generator-config.json b/gen/generator-config.json index ca35dd9..cea376b 100644 --- a/gen/generator-config.json +++ b/gen/generator-config.json @@ -5,7 +5,7 @@ "apiPackage": "Api", "srcBasePath": "MuxPhp", "invokerPackage": "MuxPhp", - "artifactVersion": "4.0.0", + "artifactVersion": "5.0.0", "gitUserId": "muxinc", "gitRepoId": "mux-php" }