File manager - Edit - /var/www/payraty/helpdesk/vendor/muxinc/mux-php/MuxPhp/Models/WebInput.php
Back
<?php /** * WebInput * * 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; /** * WebInput 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 WebInput implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** * The original name of the model. * * @var string */ protected static $openAPIModelName = 'WebInput'; /** * Array of property to type mappings. Used for (de)serialization * * @var string[] */ protected static $openAPITypes = [ 'id' => 'string', 'created_at' => 'string', 'url' => 'string', 'auto_launch' => 'bool', 'live_stream_id' => 'string', 'status' => 'string', 'passthrough' => 'string', 'resolution' => 'string', 'timeout' => 'int' ]; /** * 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 = [ 'id' => null, 'created_at' => 'int64', 'url' => null, 'auto_launch' => null, 'live_stream_id' => null, 'status' => null, 'passthrough' => null, 'resolution' => null, 'timeout' => 'int32' ]; /** * Array of nullable properties. Used for (de)serialization * * @var boolean[] */ protected static array $openAPINullables = [ 'id' => false, 'created_at' => false, 'url' => false, 'auto_launch' => false, 'live_stream_id' => false, 'status' => false, 'passthrough' => false, 'resolution' => false, 'timeout' => 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 = [ 'id' => 'id', 'created_at' => 'created_at', 'url' => 'url', 'auto_launch' => 'auto_launch', 'live_stream_id' => 'live_stream_id', 'status' => 'status', 'passthrough' => 'passthrough', 'resolution' => 'resolution', 'timeout' => 'timeout' ]; /** * Array of attributes to setter functions (for deserialization of responses) * * @var string[] */ protected static $setters = [ 'id' => 'setId', 'created_at' => 'setCreatedAt', 'url' => 'setUrl', 'auto_launch' => 'setAutoLaunch', 'live_stream_id' => 'setLiveStreamId', 'status' => 'setStatus', 'passthrough' => 'setPassthrough', 'resolution' => 'setResolution', 'timeout' => 'setTimeout' ]; /** * Array of attributes to getter functions (for serialization of requests) * * @var string[] */ protected static $getters = [ 'id' => 'getId', 'created_at' => 'getCreatedAt', 'url' => 'getUrl', 'auto_launch' => 'getAutoLaunch', 'live_stream_id' => 'getLiveStreamId', 'status' => 'getStatus', 'passthrough' => 'getPassthrough', 'resolution' => 'getResolution', 'timeout' => 'getTimeout' ]; /** * 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 STATUS_IDLE = 'idle'; public const STATUS_LAUNCHING = 'launching'; public const STATUS_STREAMING = 'streaming'; public const RESOLUTION__1920X1080 = '1920x1080'; public const RESOLUTION__1280X720 = '1280x720'; public const RESOLUTION__1080X1920 = '1080x1920'; public const RESOLUTION__720X1280 = '720x1280'; public const RESOLUTION__1080X1080 = '1080x1080'; public const RESOLUTION__720X720 = '720x720'; /** * Gets allowable values of the enum * * @return string[] */ public function getStatusAllowableValues() { return [ self::STATUS_IDLE, self::STATUS_LAUNCHING, self::STATUS_STREAMING, ]; } /** * Gets allowable values of the enum * * @return string[] */ public function getResolutionAllowableValues() { return [ self::RESOLUTION__1920X1080, self::RESOLUTION__1280X720, self::RESOLUTION__1080X1920, self::RESOLUTION__720X1280, self::RESOLUTION__1080X1080, self::RESOLUTION__720X720, ]; } /** * 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('id', $data ?? [], null); $this->setIfExists('created_at', $data ?? [], null); $this->setIfExists('url', $data ?? [], null); $this->setIfExists('auto_launch', $data ?? [], null); $this->setIfExists('live_stream_id', $data ?? [], null); $this->setIfExists('status', $data ?? [], null); $this->setIfExists('passthrough', $data ?? [], null); $this->setIfExists('resolution', $data ?? [], self::RESOLUTION__1920X1080); $this->setIfExists('timeout', $data ?? [], 3600); } /** * 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->getStatusAllowableValues(); if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) { $invalidProperties[] = sprintf( "invalid value '%s' for 'status', must be one of '%s'", $this->container['status'], implode("', '", $allowedValues) ); } $allowedValues = $this->getResolutionAllowableValues(); if (!is_null($this->container['resolution']) && !in_array($this->container['resolution'], $allowedValues, true)) { $invalidProperties[] = sprintf( "invalid value '%s' for 'resolution', must be one of '%s'", $this->container['resolution'], implode("', '", $allowedValues) ); } return $invalidProperties; } /** * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid */ public function valid() { return count($this->listInvalidProperties()) === 0; } /** * Gets id * * @return string|null */ public function getId() { return $this->container['id']; } /** * Sets id * * @param string|null $id Unique identifier for the Web Input. * * @return self */ public function setId($id) { if (is_null($id)) { throw new \InvalidArgumentException('non-nullable id cannot be null'); } $this->container['id'] = $id; return $this; } /** * Gets created_at * * @return string|null */ public function getCreatedAt() { return $this->container['created_at']; } /** * Sets created_at * * @param string|null $created_at Time the Web Input was created, defined as a Unix timestamp (seconds since epoch). * * @return self */ public function setCreatedAt($created_at) { if (is_null($created_at)) { throw new \InvalidArgumentException('non-nullable created_at cannot be null'); } $this->container['created_at'] = $created_at; return $this; } /** * Gets url * * @return string|null */ public function getUrl() { return $this->container['url']; } /** * Sets url * * @param string|null $url The URL for the Web Input to load. * * @return self */ public function setUrl($url) { if (is_null($url)) { throw new \InvalidArgumentException('non-nullable url cannot be null'); } $this->container['url'] = $url; return $this; } /** * Gets auto_launch * * @return bool|null */ public function getAutoLaunch() { return $this->container['auto_launch']; } /** * Sets auto_launch * * @param bool|null $auto_launch When set to `true` the Web Input will automatically launch and start streaming immediately after creation * * @return self */ public function setAutoLaunch($auto_launch) { if (is_null($auto_launch)) { throw new \InvalidArgumentException('non-nullable auto_launch cannot be null'); } $this->container['auto_launch'] = $auto_launch; return $this; } /** * Gets live_stream_id * * @return string|null */ public function getLiveStreamId() { return $this->container['live_stream_id']; } /** * Sets live_stream_id * * @param string|null $live_stream_id The Live Stream ID to broadcast this Web Input to * * @return self */ public function setLiveStreamId($live_stream_id) { if (is_null($live_stream_id)) { throw new \InvalidArgumentException('non-nullable live_stream_id cannot be null'); } $this->container['live_stream_id'] = $live_stream_id; return $this; } /** * Gets status * * @return string|null */ public function getStatus() { return $this->container['status']; } /** * Sets status * * @param string|null $status status * * @return self */ public function setStatus($status) { $allowedValues = $this->getStatusAllowableValues(); if (!is_null($status) && !in_array($status, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( "Invalid value '%s' for 'status', must be one of '%s'", $status, implode("', '", $allowedValues) ) ); } if (is_null($status)) { throw new \InvalidArgumentException('non-nullable status cannot be null'); } $this->container['status'] = $status; return $this; } /** * Gets passthrough * * @return string|null */ public function getPassthrough() { return $this->container['passthrough']; } /** * Sets passthrough * * @param string|null $passthrough Arbitrary metadata that will be included in the Web Input details and related webhooks. Can be used to store your own ID for the Web Input. **Max: 255 characters**. * * @return self */ public function setPassthrough($passthrough) { if (is_null($passthrough)) { throw new \InvalidArgumentException('non-nullable passthrough cannot be null'); } $this->container['passthrough'] = $passthrough; return $this; } /** * Gets resolution * * @return string|null */ public function getResolution() { return $this->container['resolution']; } /** * Sets resolution * * @param string|null $resolution The resolution of the viewport of the Web Input's browser instance. Defaults to 1920x1080 if not set. * * @return self */ public function setResolution($resolution) { $allowedValues = $this->getResolutionAllowableValues(); if (!is_null($resolution) && !in_array($resolution, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( "Invalid value '%s' for 'resolution', must be one of '%s'", $resolution, implode("', '", $allowedValues) ) ); } if (is_null($resolution)) { throw new \InvalidArgumentException('non-nullable resolution cannot be null'); } $this->container['resolution'] = $resolution; return $this; } /** * Gets timeout * * @return int|null */ public function getTimeout() { return $this->container['timeout']; } /** * Sets timeout * * @param int|null $timeout The number of seconds that the Web Input should stream for before automatically shutting down. * * @return self */ public function setTimeout($timeout) { if (is_null($timeout)) { throw new \InvalidArgumentException('non-nullable timeout cannot be null'); } $this->container['timeout'] = $timeout; 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