File manager - Edit - /var/www/payraty/helpdesk/vendor/muxinc/mux-php/MuxPhp/Models/CreateUploadRequest.php
Back
<?php /** * CreateUploadRequest * * 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; /** * CreateUploadRequest 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 CreateUploadRequest implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** * The original name of the model. * * @var string */ protected static $openAPIModelName = 'CreateUploadRequest'; /** * Array of property to type mappings. Used for (de)serialization * * @var string[] */ protected static $openAPITypes = [ 'timeout' => 'int', 'cors_origin' => 'string', 'new_asset_settings' => '\MuxPhp\Models\CreateAssetRequest', 'test' => 'bool' ]; /** * 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 = [ 'timeout' => 'int32', 'cors_origin' => null, 'new_asset_settings' => null, 'test' => 'boolean' ]; /** * Array of nullable properties. Used for (de)serialization * * @var boolean[] */ protected static array $openAPINullables = [ 'timeout' => false, 'cors_origin' => false, 'new_asset_settings' => false, 'test' => 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 = [ 'timeout' => 'timeout', 'cors_origin' => 'cors_origin', 'new_asset_settings' => 'new_asset_settings', 'test' => 'test' ]; /** * Array of attributes to setter functions (for deserialization of responses) * * @var string[] */ protected static $setters = [ 'timeout' => 'setTimeout', 'cors_origin' => 'setCorsOrigin', 'new_asset_settings' => 'setNewAssetSettings', 'test' => 'setTest' ]; /** * Array of attributes to getter functions (for serialization of requests) * * @var string[] */ protected static $getters = [ 'timeout' => 'getTimeout', 'cors_origin' => 'getCorsOrigin', 'new_asset_settings' => 'getNewAssetSettings', 'test' => 'getTest' ]; /** * 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('timeout', $data ?? [], 3600); $this->setIfExists('cors_origin', $data ?? [], null); $this->setIfExists('new_asset_settings', $data ?? [], null); $this->setIfExists('test', $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['timeout']) && ($this->container['timeout'] > 604800)) { $invalidProperties[] = "invalid value for 'timeout', must be smaller than or equal to 604800."; } if (!is_null($this->container['timeout']) && ($this->container['timeout'] < 60)) { $invalidProperties[] = "invalid value for 'timeout', must be bigger than or equal to 60."; } 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 timeout * * @return int|null */ public function getTimeout() { return $this->container['timeout']; } /** * Sets timeout * * @param int|null $timeout Max time in seconds for the signed upload URL to be valid. If a successful upload has not occurred before the timeout limit, the direct upload is marked `timed_out` * * @return self */ public function setTimeout($timeout) { if (!is_null($timeout) && ($timeout > 604800)) { throw new \InvalidArgumentException('invalid value for $timeout when calling CreateUploadRequest., must be smaller than or equal to 604800.'); } if (!is_null($timeout) && ($timeout < 60)) { throw new \InvalidArgumentException('invalid value for $timeout when calling CreateUploadRequest., must be bigger than or equal to 60.'); } if (is_null($timeout)) { throw new \InvalidArgumentException('non-nullable timeout cannot be null'); } $this->container['timeout'] = $timeout; return $this; } /** * Gets cors_origin * * @return string|null */ public function getCorsOrigin() { return $this->container['cors_origin']; } /** * Sets cors_origin * * @param string|null $cors_origin If the upload URL will be used in a browser, you must specify the origin in order for the signed URL to have the correct CORS headers. * * @return self */ public function setCorsOrigin($cors_origin) { if (is_null($cors_origin)) { throw new \InvalidArgumentException('non-nullable cors_origin cannot be null'); } $this->container['cors_origin'] = $cors_origin; return $this; } /** * Gets new_asset_settings * * @return \MuxPhp\Models\CreateAssetRequest|null */ public function getNewAssetSettings() { return $this->container['new_asset_settings']; } /** * Sets new_asset_settings * * @param \MuxPhp\Models\CreateAssetRequest|null $new_asset_settings new_asset_settings * * @return self */ public function setNewAssetSettings($new_asset_settings) { if (is_null($new_asset_settings)) { throw new \InvalidArgumentException('non-nullable new_asset_settings cannot be null'); } $this->container['new_asset_settings'] = $new_asset_settings; return $this; } /** * Gets test * * @return bool|null */ public function getTest() { return $this->container['test']; } /** * Sets test * * @param bool|null $test Indicates if this is a test Direct Upload, in which case the Asset that gets created will be a `test` Asset. * * @return self */ public function setTest($test) { if (is_null($test)) { throw new \InvalidArgumentException('non-nullable test cannot be null'); } $this->container['test'] = $test; 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