File manager - Edit - /var/www/payraty/helpdesk/vendor/muxinc/mux-php/MuxPhp/Models/AssetStaticRenditionsFiles.php
Back
<?php /** * AssetStaticRenditionsFiles * * PHP version 7.2 * * @category Class * @package MuxPhp * @author Mux API team * @link https://docs.mux.com */ /** * Mux API * * 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. * * The version of the OpenAPI document: v1 * Contact: devex@mux.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 5.0.1 */ /** * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ namespace MuxPhp\Models; use \ArrayAccess; use \MuxPhp\ObjectSerializer; /** * AssetStaticRenditionsFiles Class Doc Comment * * @category Class * @package MuxPhp * @author Mux API team * @link https://docs.mux.com * @implements \ArrayAccess<TKey, TValue> * @template TKey int|null * @template TValue mixed|null */ class AssetStaticRenditionsFiles implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** * 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[] */ protected static $openAPITypes = [ 'name' => 'string', 'ext' => 'string', 'height' => 'int', 'width' => 'int', 'bitrate' => 'int', 'filesize' => 'string' ]; /** * Array of property to format mappings. Used for (de)serialization * * @var string[] * @phpstan-var array<string, string|null> * @psalm-var array<string, string|null> */ protected static $openAPIFormats = [ 'name' => null, 'ext' => null, 'height' => 'int32', 'width' => 'int32', 'bitrate' => 'int64', 'filesize' => 'int64' ]; /** * Array of nullable properties. Used for (de)serialization * * @var boolean[] */ protected static array $openAPINullables = [ 'name' => false, 'ext' => false, 'height' => false, 'width' => false, 'bitrate' => false, 'filesize' => false ]; /** * If a nullable field gets set to null, insert it here * * @var boolean[] */ protected array $openAPINullablesSetToNull = []; /** * Array of property to type mappings. Used for (de)serialization * * @return array */ public static function openAPITypes() { return self::$openAPITypes; } /** * Array of property to format mappings. Used for (de)serialization * * @return array */ public static function openAPIFormats() { return self::$openAPIFormats; } /** * Array of nullable properties * * @return array */ protected static function openAPINullables(): array { return self::$openAPINullables; } /** * Array of nullable field names deliberately set to null * * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { return $this->openAPINullablesSetToNull; } /** * Checks if a property is nullable * * @param string $property * @return bool */ public static function isNullable(string $property): bool { return self::openAPINullables()[$property] ?? false; } /** * Checks if a nullable property is set to null. * * @param string $property * @return bool */ public function isNullableSetToNull(string $property): bool { return in_array($property, $this->getOpenAPINullablesSetToNull(), true); } /** * Array of attributes where the key is the local name, * and the value is the original name * * @var string[] */ protected static $attributeMap = [ 'name' => 'name', 'ext' => 'ext', 'height' => 'height', 'width' => 'width', 'bitrate' => 'bitrate', 'filesize' => 'filesize' ]; /** * Array of attributes to setter functions (for deserialization of responses) * * @var string[] */ protected static $setters = [ 'name' => 'setName', 'ext' => 'setExt', 'height' => 'setHeight', 'width' => 'setWidth', 'bitrate' => 'setBitrate', 'filesize' => 'setFilesize' ]; /** * Array of attributes to getter functions (for serialization of requests) * * @var string[] */ protected static $getters = [ 'name' => 'getName', 'ext' => 'getExt', 'height' => 'getHeight', 'width' => 'getWidth', 'bitrate' => 'getBitrate', 'filesize' => 'getFilesize' ]; /** * Array of attributes where the key is the local name, * and the value is the original name * * @return array */ public static function attributeMap() { return self::$attributeMap; } /** * Array of attributes to setter functions (for deserialization of responses) * * @return array */ public static function setters() { return self::$setters; } /** * Array of attributes to getter functions (for serialization of requests) * * @return array */ public static function getters() { return self::$getters; } /** * The original name of the model. * * @return string */ public function getModelName() { return self::$openAPIModelName; } public const NAME_LOW_MP4 = 'low.mp4'; public const NAME_MEDIUM_MP4 = 'medium.mp4'; public const NAME_HIGH_MP4 = 'high.mp4'; public const NAME_AUDIO_M4A = 'audio.m4a'; public const NAME_CAPPED_1080P_MP4 = 'capped-1080p.mp4'; public const EXT_MP4 = 'mp4'; public const EXT_M4A = 'm4a'; /** * Gets allowable values of the enum * * @return string[] */ public function getNameAllowableValues() { return [ self::NAME_LOW_MP4, self::NAME_MEDIUM_MP4, self::NAME_HIGH_MP4, self::NAME_AUDIO_M4A, self::NAME_CAPPED_1080P_MP4, ]; } /** * Gets allowable values of the enum * * @return string[] */ public function getExtAllowableValues() { return [ self::EXT_MP4, self::EXT_M4A, ]; } /** * Associative array for storing property values * * @var mixed[] */ protected $container = []; /** * Constructor * * @param mixed[] $data Associated array of property values * initializing the model */ public function __construct(array $data = null) { // MUX: enum hack (self::) due to OAS emitting problems. // please re-integrate with mainline when possible. // src: https://github.com/OpenAPITools/openapi-generator/issues/9038 $this->setIfExists('name', $data ?? [], null); $this->setIfExists('ext', $data ?? [], null); $this->setIfExists('height', $data ?? [], null); $this->setIfExists('width', $data ?? [], null); $this->setIfExists('bitrate', $data ?? [], null); $this->setIfExists('filesize', $data ?? [], null); } /** * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the * $this->openAPINullablesSetToNull array * * @param string $variableName * @param array $fields * @param mixed $defaultValue */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { $this->openAPINullablesSetToNull[] = $variableName; } $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { $invalidProperties = []; $allowedValues = $this->getNameAllowableValues(); if (!is_null($this->container['name']) && !in_array($this->container['name'], $allowedValues, true)) { $invalidProperties[] = sprintf( "invalid value '%s' for 'name', must be one of '%s'", $this->container['name'], implode("', '", $allowedValues) ); } $allowedValues = $this->getExtAllowableValues(); if (!is_null($this->container['ext']) && !in_array($this->container['ext'], $allowedValues, true)) { $invalidProperties[] = sprintf( "invalid value '%s' for 'ext', must be one of '%s'", $this->container['ext'], implode("', '", $allowedValues) ); } return $invalidProperties; } /** * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid */ public function valid() { return count($this->listInvalidProperties()) === 0; } /** * Gets name * * @return string|null */ public function getName() { return $this->container['name']; } /** * Sets name * * @param string|null $name name * * @return self */ public function setName($name) { $allowedValues = $this->getNameAllowableValues(); if (!is_null($name) && !in_array($name, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( "Invalid value '%s' for 'name', must be one of '%s'", $name, implode("', '", $allowedValues) ) ); } if (is_null($name)) { throw new \InvalidArgumentException('non-nullable name cannot be null'); } $this->container['name'] = $name; return $this; } /** * Gets ext * * @return string|null */ public function getExt() { return $this->container['ext']; } /** * Sets ext * * @param string|null $ext Extension of the static rendition file * * @return self */ public function setExt($ext) { $allowedValues = $this->getExtAllowableValues(); if (!is_null($ext) && !in_array($ext, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( "Invalid value '%s' for 'ext', must be one of '%s'", $ext, implode("', '", $allowedValues) ) ); } if (is_null($ext)) { throw new \InvalidArgumentException('non-nullable ext cannot be null'); } $this->container['ext'] = $ext; return $this; } /** * Gets height * * @return int|null */ public function getHeight() { return $this->container['height']; } /** * Sets height * * @param int|null $height The height of the static rendition's file in pixels * * @return self */ public function setHeight($height) { if (is_null($height)) { throw new \InvalidArgumentException('non-nullable height cannot be null'); } $this->container['height'] = $height; return $this; } /** * Gets width * * @return int|null */ public function getWidth() { return $this->container['width']; } /** * Sets width * * @param int|null $width The width of the static rendition's file in pixels * * @return self */ public function setWidth($width) { if (is_null($width)) { throw new \InvalidArgumentException('non-nullable width cannot be null'); } $this->container['width'] = $width; return $this; } /** * Gets bitrate * * @return int|null */ public function getBitrate() { return $this->container['bitrate']; } /** * Sets bitrate * * @param int|null $bitrate The bitrate in bits per second * * @return self */ public function setBitrate($bitrate) { if (is_null($bitrate)) { throw new \InvalidArgumentException('non-nullable bitrate cannot be null'); } $this->container['bitrate'] = $bitrate; return $this; } /** * Gets filesize * * @return string|null */ public function getFilesize() { return $this->container['filesize']; } /** * Sets filesize * * @param string|null $filesize The file size in bytes * * @return self */ public function setFilesize($filesize) { if (is_null($filesize)) { throw new \InvalidArgumentException('non-nullable filesize cannot be null'); } $this->container['filesize'] = $filesize; return $this; } /** * 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)); } }
| ver. 1.4 |
Github
|
.
| PHP 8.3.30 | Generation time: 0 |
proxy
|
phpinfo
|
Settings