diff --git a/CHANGELOG.md b/CHANGELOG.md index 22251d5..dd04167 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # Changelog All changes to this project will be documented in this file. +## [1.1.0] - 2021-12-06 +- Add `name` attribute in player themes + ## [1.0.0] - 2021-11-15 - Add support of `progressive uploads` \ No newline at end of file diff --git a/README.md b/README.md index dd73a8e..98c78a5 100644 --- a/README.md +++ b/README.md @@ -192,7 +192,7 @@ Method | HTTP request | Description ------------- | ------------- | ------------- [**delete**](docs/Api/PlayerThemesApi.md#delete) | **DELETE** `/players/{playerId}` | Delete a player [**deleteLogo**](docs/Api/PlayerThemesApi.md#deleteLogo) | **DELETE** `/players/{playerId}/logo` | Delete logo -[**list**](docs/Api/PlayerThemesApi.md#list) | **GET** `/players` | List all players +[**list**](docs/Api/PlayerThemesApi.md#list) | **GET** `/players` | List all player themes [**get**](docs/Api/PlayerThemesApi.md#get) | **GET** `/players/{playerId}` | Show a player [**update**](docs/Api/PlayerThemesApi.md#update) | **PATCH** `/players/{playerId}` | Update a player [**create**](docs/Api/PlayerThemesApi.md#create) | **POST** `/players` | Create a player diff --git a/docs/Api/PlayerThemesApi.md b/docs/Api/PlayerThemesApi.md index a6ab34a..9fd0380 100644 --- a/docs/Api/PlayerThemesApi.md +++ b/docs/Api/PlayerThemesApi.md @@ -6,7 +6,7 @@ Method | HTTP request | Description ------------- | ------------- | ------------- [**delete()**](PlayerThemesApi.md#delete) | **DELETE** `/players/{playerId}` | Delete a player [**deleteLogo()**](PlayerThemesApi.md#deleteLogo) | **DELETE** `/players/{playerId}/logo` | Delete logo -[**list()**](PlayerThemesApi.md#list) | **GET** `/players` | List all players +[**list()**](PlayerThemesApi.md#list) | **GET** `/players` | List all player themes [**get()**](PlayerThemesApi.md#get) | **GET** `/players/{playerId}` | Show a player [**update()**](PlayerThemesApi.md#update) | **PATCH** `/players/{playerId}` | Update a player [**create()**](PlayerThemesApi.md#create) | **POST** `/players` | Create a player @@ -63,7 +63,7 @@ void (empty response body) ## list() -Retrieve a list of all the players you created, as well as details about each one. Tutorials that use the [player endpoint](https://api.video/blog/endpoints/player). +Retrieve a list of all the player themes you created, as well as details about each one. Tutorials that use the [player endpoint](https://api.video/blog/endpoints/player). ### Arguments diff --git a/docs/Api/VideosApi.md b/docs/Api/VideosApi.md index 24f795f..6740c05 100644 --- a/docs/Api/VideosApi.md +++ b/docs/Api/VideosApi.md @@ -234,7 +234,7 @@ Name | Type | Description | Example | Notes ## uploadWithUploadToken() -When given a token, anyone can upload a file to the URI `https://ws.api.video/upload?token=`. Example with cURL: ```curl $ curl --request POST --url 'https://ws.api.video/upload?token=toXXX' --header 'content-type: multipart/form-data' -F file=@video.mp4 ``` Or in an HTML form, with a little JavaScript to convert the form into JSON: ```html

``` ### Dealing with large files We have created a tutorial to walk through the steps required. +When given a token, anyone can upload a file to the URI `https://ws.api.video/upload?token=`. Example with cURL: ```curl $ curl --request POST --url 'https://ws.api.video/upload?token=toXXX' --header 'content-type: multipart/form-data' -F file=@video.mp4 ``` Or in an HTML form, with a little JavaScript to convert the form into JSON: ```html

``` ### Dealing with large files You can upload large files on api.video with Progressive Upload. Alternatively, if you want to use regular upload, we have created a tutorial to walk through the steps required. ### Arguments @@ -310,7 +310,7 @@ Name | Type | Description | Example | Notes ## upload() -To upload a video to the videoId you created. Replace {videoId} with the id you'd like to use, {access_token} with your token, and /path/to/video.mp4 with the path to the video you'd like to upload. You can only upload your video to the videoId once.\\nWe offer 2 types of upload: * Regular uploads * Progressive uploads The latter allows you to split a video source into X chunks and send those chunks independently (concurrently or sequentially). The 2 main goals for our users are to * (1) allow the upload of video sources > 200 MiB (200 MiB = the max. allowed file size for regular upload) * (2) allow to send a video source \"progressively\", i.e., before before knowing the total size of the video.\\nOnce all chunks have been sent, they are reaggregated to one source file. The video source is considered as \"completely sent\" when the \"last\" chunk is sent (i.e., the chunk that \"completes\" the upload). ```bash curl https://ws.api.video/videos/{videoId}/source \\ -H 'Authorization: Bearer {access_token}' \\ -F file=@/path/to/video.mp4 ``` Tutorials using [video upload](https://api.video/blog/endpoints/video-upload). +To upload a video to the videoId you created. Replace {videoId} with the id you'd like to use, {access_token} with your token, and /path/to/video.mp4 with the path to the video you'd like to upload. You can only upload your video to the videoId once. We offer 2 types of upload: * Regular upload * Progressive upload The latter allows you to split a video source into X chunks and send those chunks independently (concurrently or sequentially). The 2 main goals for our users are to * allow the upload of video sources > 200 MiB (200 MiB = the max. allowed file size for regular upload) * allow to send a video source \"progressively\", i.e., before before knowing the total size of the video. Once all chunks have been sent, they are reaggregated to one source file. The video source is considered as \"completely sent\" when the \"last\" chunk is sent (i.e., the chunk that \"completes\" the upload). ```bash curl https://ws.api.video/videos/{videoId}/source \\ -H 'Authorization: Bearer {access_token}' \\ -F file=@/path/to/video.mp4 ``` Tutorials using [video upload](https://api.video/blog/endpoints/video-upload). ### Example @@ -352,7 +352,7 @@ Name | Type | Description | Example | Notes ------------- | ------------- | ------------- | ------------- | ------------- `videoId` | **string**| Enter the videoId you want to use to upload your video. | `vi4k0jvEUuaTdRAEjQ4Jfrgz` | `file` | **\SplFileObject**| The path to the video you would like to upload. The path must be local. If you want to use a video from an online source, you must use the \\\"/videos\\\" endpoint and add the \\\"source\\\" parameter when you create a new video. | `new \SplFileObject('path')` | - `contentRange` | **string**| Content-Range can be used if you want to split your file. You can do this by parts, or by chunk. * If you split your file by bytes, bear in mind byte ranges are inclusive, meaning that bytes 0-5242880 represents the first 5,242,880 bytes in a file or object.\\nAlso, the Content-Range header value must match the following pattern: bytes <from_byte>-<to_byte>/<total_bytes>: * <from_byte> is a positive integer or 0. It represents the range start (aka lower bound), i.e., the first byte of the chunk compared to the total bytes composing the full video source. The first sequential range always starts at 0. * <to_byte> is a positive integer representing the range end (aka upper bound), i.e., the last byte of the chunk compared to the total bytes composing the full video source. * <total_bytes> is a positive integer representing the total bytes composing the full video source. It can also be * if or as long as it is unknown. Technically, this value is required only one time and cannot differ in several requests. * If you split your file by part (recommended option), the `Content-Range` header value must match the following pattern: `part <part>/<total_parts>`: * `<part>` is a positive integer representing the part number. The first sequential part number is always 1. * `<total_parts>` is a positive integer representing the total parts of the video source. It can also be `*` if or as long as it is unknown. Technically, this value is required only one time and cannot differ in several requests. | `bytes 209715200-419430399/52428800 OR part 2/3` | [optional] + `contentRange` | **string**| Content-Range can be used if you want to split your file. You can do this by parts, or by chunk. * If you split your file by parts (recommended option), the `Content-Range` header value must match the following pattern: `part <part>/<total_parts>`: * `<part>` is a positive integer representing the part number. The first sequential part number is always 1. * `<total_parts>` is a positive integer representing the total parts of the video source. It can also be `*` if or as long as it is unknown. Technically, this value is required only one time and cannot differ in several requests. * If you split your file by bytes, bear in mind byte ranges are inclusive, meaning that bytes 0-5242879 represents the first 5,242,880 bytes in a file or object. Also, the Content-Range header value must match the following pattern: `bytes <from_byte>-<to_byte>/<total_bytes>`: * `<from_byte>` is a positive integer or 0. It represents the range start (aka lower bound), i.e., the first byte of the chunk compared to the total bytes composing the full video source. The first sequential range always starts at 0. * `<to_byte>` is a positive integer representing the range end (aka upper bound), i.e., the last byte of the chunk compared to the total bytes composing the full video source. * `<total_bytes>` is a positive integer representing the total bytes composing the full video source. It can also be `*` if or as long as it is unknown. Technically, this value is required only one time and cannot differ in several requests. * Ordering and chunk or part size * The order in which the chunks are received on our side does not matter. * Example: `part 3/_*` then `part 2/_*` then `part 1/3` works. * The chunks can be sent concurrently. We have a lock mechanism to ensure they are still technically processed one by one to ensure the \"completion\" check behaves as expected. * The only chunk that can be smaller than our minimum allowed chunk size (5 MiB) is the last sequential one (i.e., the last sequential range for the \"byte-range\" system and the last part for the \"part\" system. * For instance, if your video is 10.5 MiB big, your last chunk would be 500 KiB, and that would work. * Another example is if your video is 2 MiB big, then your first and last chunk will be 2MiB and that will work as well. | `bytes 209715200-419430399/524288000 OR part 2/3` | [optional] diff --git a/docs/Model/PlayerTheme.md b/docs/Model/PlayerTheme.md index ce8e2c9..6731ac1 100644 --- a/docs/Model/PlayerTheme.md +++ b/docs/Model/PlayerTheme.md @@ -4,6 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**name** | **string** | The name of the player theme | [optional] **text** | **string** | RGBA color for timer text. Default: rgba(255, 255, 255, 1) | [optional] **link** | **string** | RGBA color for all controls. Default: rgba(255, 255, 255, 1) | [optional] **linkHover** | **string** | RGBA color for all controls when hovered. Default: rgba(255, 255, 255, 1) | [optional] diff --git a/docs/Model/PlayerThemeCreationPayload.md b/docs/Model/PlayerThemeCreationPayload.md index 8433684..4359778 100644 --- a/docs/Model/PlayerThemeCreationPayload.md +++ b/docs/Model/PlayerThemeCreationPayload.md @@ -4,6 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**name** | **string** | Add a name for your player theme here. | [optional] **text** | **string** | RGBA color for timer text. Default: rgba(255, 255, 255, 1) | [optional] **link** | **string** | RGBA color for all controls. Default: rgba(255, 255, 255, 1) | [optional] **linkHover** | **string** | RGBA color for all controls when hovered. Default: rgba(255, 255, 255, 1) | [optional] diff --git a/docs/Model/PlayerThemeUpdatePayload.md b/docs/Model/PlayerThemeUpdatePayload.md index 66f3293..f42e375 100644 --- a/docs/Model/PlayerThemeUpdatePayload.md +++ b/docs/Model/PlayerThemeUpdatePayload.md @@ -4,6 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**name** | **string** | Add a name for your player theme here. | [optional] **text** | **string** | RGBA color for timer text. Default: rgba(255, 255, 255, 1) | [optional] **link** | **string** | RGBA color for all controls. Default: rgba(255, 255, 255, 1) | [optional] **linkHover** | **string** | RGBA color for all controls when hovered. Default: rgba(255, 255, 255, 1) | [optional] diff --git a/src/Api/PlayerThemesApi.php b/src/Api/PlayerThemesApi.php index 99a7c8e..3ce4427 100644 --- a/src/Api/PlayerThemesApi.php +++ b/src/Api/PlayerThemesApi.php @@ -167,7 +167,7 @@ private function buildDeleteLogoRequest(string $playerId): Request /** - * List all players + * List all player themes * * @param array $queryParams * diff --git a/src/Api/VideosApi.php b/src/Api/VideosApi.php index ecf0e9f..cb7d47b 100644 --- a/src/Api/VideosApi.php +++ b/src/Api/VideosApi.php @@ -676,7 +676,7 @@ private function buildCreateRequest(\ApiVideo\Client\Model\VideoCreationPayload * * @param string $videoId Enter the videoId you want to use to upload your video. (required) * @param \SplFileObject $file The path to the video you would like to upload. The path must be local. If you want to use a video from an online source, you must use the \\\"/videos\\\" endpoint and add the \\\"source\\\" parameter when you create a new video. (required) - * @param string $contentRange Content-Range can be used if you want to split your file. You can do this by parts, or by chunk. * If you split your file by bytes, bear in mind byte ranges are inclusive, meaning that bytes 0-5242880 represents the first 5,242,880 bytes in a file or object.\\nAlso, the Content-Range header value must match the following pattern: bytes <from_byte>-<to_byte>/<total_bytes>: * <from_byte> is a positive integer or 0. It represents the range start (aka lower bound), i.e., the first byte of the chunk compared to the total bytes composing the full video source. The first sequential range always starts at 0. * <to_byte> is a positive integer representing the range end (aka upper bound), i.e., the last byte of the chunk compared to the total bytes composing the full video source. * <total_bytes> is a positive integer representing the total bytes composing the full video source. It can also be * if or as long as it is unknown. Technically, this value is required only one time and cannot differ in several requests. * If you split your file by part (recommended option), the `Content-Range` header value must match the following pattern: `part <part>/<total_parts>`: * `<part>` is a positive integer representing the part number. The first sequential part number is always 1. * `<total_parts>` is a positive integer representing the total parts of the video source. It can also be `*` if or as long as it is unknown. Technically, this value is required only one time and cannot differ in several requests. (optional) + * @param string $contentRange Content-Range can be used if you want to split your file. You can do this by parts, or by chunk. * If you split your file by parts (recommended option), the `Content-Range` header value must match the following pattern: `part <part>/<total_parts>`: * `<part>` is a positive integer representing the part number. The first sequential part number is always 1. * `<total_parts>` is a positive integer representing the total parts of the video source. It can also be `*` if or as long as it is unknown. Technically, this value is required only one time and cannot differ in several requests. * If you split your file by bytes, bear in mind byte ranges are inclusive, meaning that bytes 0-5242879 represents the first 5,242,880 bytes in a file or object. Also, the Content-Range header value must match the following pattern: `bytes <from_byte>-<to_byte>/<total_bytes>`: * `<from_byte>` is a positive integer or 0. It represents the range start (aka lower bound), i.e., the first byte of the chunk compared to the total bytes composing the full video source. The first sequential range always starts at 0. * `<to_byte>` is a positive integer representing the range end (aka upper bound), i.e., the last byte of the chunk compared to the total bytes composing the full video source. * `<total_bytes>` is a positive integer representing the total bytes composing the full video source. It can also be `*` if or as long as it is unknown. Technically, this value is required only one time and cannot differ in several requests. * Ordering and chunk or part size * The order in which the chunks are received on our side does not matter. * Example: `part 3/_*` then `part 2/_*` then `part 1/3` works. * The chunks can be sent concurrently. We have a lock mechanism to ensure they are still technically processed one by one to ensure the \"completion\" check behaves as expected. * The only chunk that can be smaller than our minimum allowed chunk size (5 MiB) is the last sequential one (i.e., the last sequential range for the \"byte-range\" system and the last part for the \"part\" system. * For instance, if your video is 10.5 MiB big, your last chunk would be 500 KiB, and that would work. * Another example is if your video is 2 MiB big, then your first and last chunk will be 2MiB and that will work as well. (optional) * * @throws \ApiVideo\Client\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -695,7 +695,7 @@ public function upload(string $videoId, \SplFileObject $file, string $contentRan * * @param string $videoId Enter the videoId you want to use to upload your video. (required) * @param \SplFileObject $file The path to the video you would like to upload. The path must be local. If you want to use a video from an online source, you must use the \\\"/videos\\\" endpoint and add the \\\"source\\\" parameter when you create a new video. (required) - * @param string $contentRange Content-Range can be used if you want to split your file. You can do this by parts, or by chunk. * If you split your file by bytes, bear in mind byte ranges are inclusive, meaning that bytes 0-5242880 represents the first 5,242,880 bytes in a file or object.\\nAlso, the Content-Range header value must match the following pattern: bytes <from_byte>-<to_byte>/<total_bytes>: * <from_byte> is a positive integer or 0. It represents the range start (aka lower bound), i.e., the first byte of the chunk compared to the total bytes composing the full video source. The first sequential range always starts at 0. * <to_byte> is a positive integer representing the range end (aka upper bound), i.e., the last byte of the chunk compared to the total bytes composing the full video source. * <total_bytes> is a positive integer representing the total bytes composing the full video source. It can also be * if or as long as it is unknown. Technically, this value is required only one time and cannot differ in several requests. * If you split your file by part (recommended option), the `Content-Range` header value must match the following pattern: `part <part>/<total_parts>`: * `<part>` is a positive integer representing the part number. The first sequential part number is always 1. * `<total_parts>` is a positive integer representing the total parts of the video source. It can also be `*` if or as long as it is unknown. Technically, this value is required only one time and cannot differ in several requests. (optional) + * @param string $contentRange Content-Range can be used if you want to split your file. You can do this by parts, or by chunk. * If you split your file by parts (recommended option), the `Content-Range` header value must match the following pattern: `part <part>/<total_parts>`: * `<part>` is a positive integer representing the part number. The first sequential part number is always 1. * `<total_parts>` is a positive integer representing the total parts of the video source. It can also be `*` if or as long as it is unknown. Technically, this value is required only one time and cannot differ in several requests. * If you split your file by bytes, bear in mind byte ranges are inclusive, meaning that bytes 0-5242879 represents the first 5,242,880 bytes in a file or object. Also, the Content-Range header value must match the following pattern: `bytes <from_byte>-<to_byte>/<total_bytes>`: * `<from_byte>` is a positive integer or 0. It represents the range start (aka lower bound), i.e., the first byte of the chunk compared to the total bytes composing the full video source. The first sequential range always starts at 0. * `<to_byte>` is a positive integer representing the range end (aka upper bound), i.e., the last byte of the chunk compared to the total bytes composing the full video source. * `<total_bytes>` is a positive integer representing the total bytes composing the full video source. It can also be `*` if or as long as it is unknown. Technically, this value is required only one time and cannot differ in several requests. * Ordering and chunk or part size * The order in which the chunks are received on our side does not matter. * Example: `part 3/_*` then `part 2/_*` then `part 1/3` works. * The chunks can be sent concurrently. We have a lock mechanism to ensure they are still technically processed one by one to ensure the \"completion\" check behaves as expected. * The only chunk that can be smaller than our minimum allowed chunk size (5 MiB) is the last sequential one (i.e., the last sequential range for the \"byte-range\" system and the last part for the \"part\" system. * For instance, if your video is 10.5 MiB big, your last chunk would be 500 KiB, and that would work. * Another example is if your video is 2 MiB big, then your first and last chunk will be 2MiB and that will work as well. (optional) * * @throws \InvalidArgumentException * @return Request diff --git a/src/BaseClient.php b/src/BaseClient.php index 22e2ced..6c850fc 100644 --- a/src/BaseClient.php +++ b/src/BaseClient.php @@ -92,7 +92,7 @@ public function request(Request $commandRequest): ?array $request = $request->withHeader($name, $value); } - $request = $request->withHeader('User-Agent', 'api.video client (php; v:1.0.0; )'); + $request = $request->withHeader('User-Agent', 'api.video client (php; v:1.1.0; )'); return $this->sendRequest($request); } diff --git a/src/Model/PlayerTheme.php b/src/Model/PlayerTheme.php index 98cd744..af5baf4 100644 --- a/src/Model/PlayerTheme.php +++ b/src/Model/PlayerTheme.php @@ -31,6 +31,7 @@ public static function getDefinition(): ModelDefinition return new ModelDefinition( 'player-theme', [ + 'name' => 'string', 'text' => 'string', 'link' => 'string', 'linkHover' => 'string', @@ -52,6 +53,7 @@ public static function getDefinition(): ModelDefinition 'assets' => '\ApiVideo\Client\Model\PlayerThemeAssets' ], [ + 'name' => null, 'text' => null, 'link' => null, 'linkHover' => null, @@ -73,6 +75,7 @@ public static function getDefinition(): ModelDefinition 'assets' => null ], [ + 'name' => 'name', 'text' => 'text', 'link' => 'link', 'linkHover' => 'linkHover', @@ -94,6 +97,7 @@ public static function getDefinition(): ModelDefinition 'assets' => 'assets' ], [ + 'name' => 'setName', 'text' => 'setText', 'link' => 'setLink', 'linkHover' => 'setLinkHover', @@ -115,6 +119,7 @@ public static function getDefinition(): ModelDefinition 'assets' => 'setAssets' ], [ + 'name' => 'getName', 'text' => 'getText', 'link' => 'getLink', 'linkHover' => 'getLinkHover', @@ -155,6 +160,7 @@ public static function getDefinition(): ModelDefinition */ public function __construct(array $data = null) { + $this->container['name'] = $data['name'] ?? null; $this->container['text'] = $data['text'] ?? null; $this->container['link'] = $data['link'] ?? null; $this->container['linkHover'] = $data['linkHover'] ?? null; @@ -203,6 +209,30 @@ public function valid() } + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The name of the player theme + * + * @return self + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + /** * Gets text * diff --git a/src/Model/PlayerThemeCreationPayload.php b/src/Model/PlayerThemeCreationPayload.php index a8c36b4..e344e4a 100644 --- a/src/Model/PlayerThemeCreationPayload.php +++ b/src/Model/PlayerThemeCreationPayload.php @@ -31,6 +31,7 @@ public static function getDefinition(): ModelDefinition return new ModelDefinition( 'player-theme-creation-payload', [ + 'name' => 'string', 'text' => 'string', 'link' => 'string', 'linkHover' => 'string', @@ -47,6 +48,7 @@ public static function getDefinition(): ModelDefinition 'forceLoop' => 'bool' ], [ + 'name' => null, 'text' => null, 'link' => null, 'linkHover' => null, @@ -63,6 +65,7 @@ public static function getDefinition(): ModelDefinition 'forceLoop' => null ], [ + 'name' => 'name', 'text' => 'text', 'link' => 'link', 'linkHover' => 'linkHover', @@ -79,6 +82,7 @@ public static function getDefinition(): ModelDefinition 'forceLoop' => 'forceLoop' ], [ + 'name' => 'setName', 'text' => 'setText', 'link' => 'setLink', 'linkHover' => 'setLinkHover', @@ -95,6 +99,7 @@ public static function getDefinition(): ModelDefinition 'forceLoop' => 'setForceLoop' ], [ + 'name' => 'getName', 'text' => 'getText', 'link' => 'getLink', 'linkHover' => 'getLinkHover', @@ -130,6 +135,7 @@ public static function getDefinition(): ModelDefinition */ public function __construct(array $data = null) { + $this->container['name'] = $data['name'] ?? null; $this->container['text'] = $data['text'] ?? null; $this->container['link'] = $data['link'] ?? null; $this->container['linkHover'] = $data['linkHover'] ?? null; @@ -155,6 +161,10 @@ public function listInvalidProperties() { $invalidProperties = []; + if (!is_null($this->container['name']) && (mb_strlen($this->container['name']) > 100)) { + $invalidProperties[] = "invalid value for 'name', the character length must be smaller than or equal to 100."; + } + return $invalidProperties; } @@ -170,6 +180,34 @@ public function valid() } + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name Add a name for your player theme here. + * + * @return self + */ + public function setName($name) + { + if (!is_null($name) && (mb_strlen($name) > 100)) { + throw new \InvalidArgumentException('invalid length for $name when calling PlayerThemeCreationPayload., must be smaller than or equal to 100.'); + } + + $this->container['name'] = $name; + + return $this; + } + /** * Gets text * diff --git a/src/Model/PlayerThemeUpdatePayload.php b/src/Model/PlayerThemeUpdatePayload.php index 03e6904..8146794 100644 --- a/src/Model/PlayerThemeUpdatePayload.php +++ b/src/Model/PlayerThemeUpdatePayload.php @@ -31,6 +31,7 @@ public static function getDefinition(): ModelDefinition return new ModelDefinition( 'player-theme-update-payload', [ + 'name' => 'string', 'text' => 'string', 'link' => 'string', 'linkHover' => 'string', @@ -47,6 +48,7 @@ public static function getDefinition(): ModelDefinition 'forceLoop' => 'bool' ], [ + 'name' => null, 'text' => null, 'link' => null, 'linkHover' => null, @@ -63,6 +65,7 @@ public static function getDefinition(): ModelDefinition 'forceLoop' => null ], [ + 'name' => 'name', 'text' => 'text', 'link' => 'link', 'linkHover' => 'linkHover', @@ -79,6 +82,7 @@ public static function getDefinition(): ModelDefinition 'forceLoop' => 'forceLoop' ], [ + 'name' => 'setName', 'text' => 'setText', 'link' => 'setLink', 'linkHover' => 'setLinkHover', @@ -95,6 +99,7 @@ public static function getDefinition(): ModelDefinition 'forceLoop' => 'setForceLoop' ], [ + 'name' => 'getName', 'text' => 'getText', 'link' => 'getLink', 'linkHover' => 'getLinkHover', @@ -130,6 +135,7 @@ public static function getDefinition(): ModelDefinition */ public function __construct(array $data = null) { + $this->container['name'] = $data['name'] ?? null; $this->container['text'] = $data['text'] ?? null; $this->container['link'] = $data['link'] ?? null; $this->container['linkHover'] = $data['linkHover'] ?? null; @@ -155,6 +161,10 @@ public function listInvalidProperties() { $invalidProperties = []; + if (!is_null($this->container['name']) && (mb_strlen($this->container['name']) > 100)) { + $invalidProperties[] = "invalid value for 'name', the character length must be smaller than or equal to 100."; + } + return $invalidProperties; } @@ -170,6 +180,34 @@ public function valid() } + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name Add a name for your player theme here. + * + * @return self + */ + public function setName($name) + { + if (!is_null($name) && (mb_strlen($name) > 100)) { + throw new \InvalidArgumentException('invalid length for $name when calling PlayerThemeUpdatePayload., must be smaller than or equal to 100.'); + } + + $this->container['name'] = $name; + + return $this; + } + /** * Gets text *