diff --git a/.oas-version b/.oas-version new file mode 100644 index 0000000..587c5f0 --- /dev/null +++ b/.oas-version @@ -0,0 +1 @@ +1.10.3 diff --git a/openapitools.json b/openapitools.json new file mode 100644 index 0000000..5571688 --- /dev/null +++ b/openapitools.json @@ -0,0 +1,7 @@ +{ + "$schema": "./node_modules/@openapitools/openapi-generator-cli/config.schema.json", + "spaces": 2, + "generator-cli": { + "version": "7.4.0" + } +} diff --git a/src/Api/CreateApi.php b/src/Api/CreateApi.php deleted file mode 100644 index 970e1a5..0000000 --- a/src/Api/CreateApi.php +++ /dev/null @@ -1,807 +0,0 @@ - [ - 'application/json', - ], - 'postGenerateAsset' => [ - 'application/json', - ], - ]; - - /** - * @param ClientInterface $client - * @param Configuration $config - * @param HeaderSelector $selector - * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec - */ - public function __construct( - ClientInterface $client = null, - Configuration $config = null, - HeaderSelector $selector = null, - $hostIndex = 0 - ) { - $this->client = $client ?: new Client(); - $this->config = $config ?: new Configuration(); - $this->headerSelector = $selector ?: new HeaderSelector(); - $this->hostIndex = $hostIndex; - } - - /** - * Set the host index - * - * @param int $hostIndex Host index (required) - */ - public function setHostIndex($hostIndex): void - { - $this->hostIndex = $hostIndex; - } - - /** - * Get the host index - * - * @return int Host index - */ - public function getHostIndex() - { - return $this->hostIndex; - } - - /** - * @return Configuration - */ - public function getConfig() - { - return $this->config; - } - - /** - * Operation getGeneratedAsset - * - * Get Generated Asset - * - * @param string $id The id of the source file in [KSUID](https://github.com/segmentio/ksuid#what-is-a-ksuid) format. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGeneratedAsset'] to see the possible values for this operation - * - * @throws \Shotstack\Client\ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException - * @return \Shotstack\Client\Model\GeneratedAssetResponse - */ - public function getGeneratedAsset($id, string $contentType = self::contentTypes['getGeneratedAsset'][0]) - { - list($response) = $this->getGeneratedAssetWithHttpInfo($id, $contentType); - return $response; - } - - /** - * Operation getGeneratedAssetWithHttpInfo - * - * Get Generated Asset - * - * @param string $id The id of the source file in [KSUID](https://github.com/segmentio/ksuid#what-is-a-ksuid) format. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGeneratedAsset'] to see the possible values for this operation - * - * @throws \Shotstack\Client\ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException - * @return array of \Shotstack\Client\Model\GeneratedAssetResponse, HTTP status code, HTTP response headers (array of strings) - */ - public function getGeneratedAssetWithHttpInfo($id, string $contentType = self::contentTypes['getGeneratedAsset'][0]) - { - $request = $this->getGeneratedAssetRequest($id, $contentType); - - try { - $options = $this->createHttpClientOption(); - try { - $response = $this->client->send($request, $options); - } catch (RequestException $e) { - throw new ApiException( - "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), - $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null - ); - } catch (ConnectException $e) { - throw new ApiException( - "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), - null, - null - ); - } - - $statusCode = $response->getStatusCode(); - - if ($statusCode < 200 || $statusCode > 299) { - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - (string) $request->getUri() - ), - $statusCode, - $response->getHeaders(), - (string) $response->getBody() - ); - } - - switch($statusCode) { - case 200: - if ('\Shotstack\Client\Model\GeneratedAssetResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\Shotstack\Client\Model\GeneratedAssetResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\Shotstack\Client\Model\GeneratedAssetResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - } - - $returnType = '\Shotstack\Client\Model\GeneratedAssetResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - - } catch (ApiException $e) { - switch ($e->getCode()) { - case 200: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Shotstack\Client\Model\GeneratedAssetResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - - /** - * Operation getGeneratedAssetAsync - * - * Get Generated Asset - * - * @param string $id The id of the source file in [KSUID](https://github.com/segmentio/ksuid#what-is-a-ksuid) format. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGeneratedAsset'] to see the possible values for this operation - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function getGeneratedAssetAsync($id, string $contentType = self::contentTypes['getGeneratedAsset'][0]) - { - return $this->getGeneratedAssetAsyncWithHttpInfo($id, $contentType) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation getGeneratedAssetAsyncWithHttpInfo - * - * Get Generated Asset - * - * @param string $id The id of the source file in [KSUID](https://github.com/segmentio/ksuid#what-is-a-ksuid) format. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGeneratedAsset'] to see the possible values for this operation - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function getGeneratedAssetAsyncWithHttpInfo($id, string $contentType = self::contentTypes['getGeneratedAsset'][0]) - { - $returnType = '\Shotstack\Client\Model\GeneratedAssetResponse'; - $request = $this->getGeneratedAssetRequest($id, $contentType); - - return $this->client - ->sendAsync($request, $this->createHttpClientOption()) - ->then( - function ($response) use ($returnType) { - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - $content = json_decode($content); - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - }, - function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - $exception->getRequest()->getUri() - ), - $statusCode, - $response->getHeaders(), - (string) $response->getBody() - ); - } - ); - } - - /** - * Create request for operation 'getGeneratedAsset' - * - * @param string $id The id of the source file in [KSUID](https://github.com/segmentio/ksuid#what-is-a-ksuid) format. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGeneratedAsset'] to see the possible values for this operation - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - public function getGeneratedAssetRequest($id, string $contentType = self::contentTypes['getGeneratedAsset'][0]) - { - - // verify the required parameter 'id' is set - if ($id === null || (is_array($id) && count($id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $id when calling getGeneratedAsset' - ); - } - if (!preg_match("/^[0-9a-zA-Z]{8}-[0-9a-zA-Z]{4}-[0-9a-zA-Z]{4}-[0-9a-zA-Z]{4}-[0-9a-zA-Z]{12}$/", $id)) { - throw new \InvalidArgumentException("invalid value for \"id\" when calling CreateApi.getGeneratedAsset, must conform to the pattern /^[0-9a-zA-Z]{8}-[0-9a-zA-Z]{4}-[0-9a-zA-Z]{4}-[0-9a-zA-Z]{4}-[0-9a-zA-Z]{12}$/."); - } - - - $resourcePath = '/assets/{id}'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ''; - $multipart = false; - - - - // path params - if ($id !== null) { - $resourcePath = str_replace( - '{' . 'id' . '}', - ObjectSerializer::toPathValue($id), - $resourcePath - ); - } - - - $headers = $this->headerSelector->selectHeaders( - ['application/json', ], - $contentType, - $multipart - ); - - // for model (json/xml) - if (count($formParams) > 0) { - if ($multipart) { - $multipartContents = []; - foreach ($formParams as $formParamName => $formParamValue) { - $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; - foreach ($formParamValueItems as $formParamValueItem) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValueItem - ]; - } - } - // for HTTP post (form) - $httpBody = new MultipartStream($multipartContents); - - } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the form parameters - $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); - } else { - // for HTTP post (form) - $httpBody = ObjectSerializer::buildQuery($formParams); - } - } - - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('x-api-key'); - if ($apiKey !== null) { - $headers['x-api-key'] = $apiKey; - } - - $defaultHeaders = []; - if ($this->config->getUserAgent()) { - $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); - } - - $headers = array_merge( - $defaultHeaders, - $headerParams, - $headers - ); - - $operationHost = $this->config->getHost(); - $query = ObjectSerializer::buildQuery($queryParams); - return new Request( - 'GET', - $operationHost . $resourcePath . ($query ? "?{$query}" : ''), - $headers, - $httpBody - ); - } - - /** - * Operation postGenerateAsset - * - * Generate Asset - * - * @param \Shotstack\Client\Model\GeneratedAsset $generated_asset Generate an asset using the specified provider, type and options. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['postGenerateAsset'] to see the possible values for this operation - * - * @throws \Shotstack\Client\ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException - * @return \Shotstack\Client\Model\GeneratedAssetResponse|\Shotstack\Client\Model\GeneratedAssetErrorResponse - */ - public function postGenerateAsset($generated_asset, string $contentType = self::contentTypes['postGenerateAsset'][0]) - { - list($response) = $this->postGenerateAssetWithHttpInfo($generated_asset, $contentType); - return $response; - } - - /** - * Operation postGenerateAssetWithHttpInfo - * - * Generate Asset - * - * @param \Shotstack\Client\Model\GeneratedAsset $generated_asset Generate an asset using the specified provider, type and options. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['postGenerateAsset'] to see the possible values for this operation - * - * @throws \Shotstack\Client\ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException - * @return array of \Shotstack\Client\Model\GeneratedAssetResponse|\Shotstack\Client\Model\GeneratedAssetErrorResponse, HTTP status code, HTTP response headers (array of strings) - */ - public function postGenerateAssetWithHttpInfo($generated_asset, string $contentType = self::contentTypes['postGenerateAsset'][0]) - { - $request = $this->postGenerateAssetRequest($generated_asset, $contentType); - - try { - $options = $this->createHttpClientOption(); - try { - $response = $this->client->send($request, $options); - } catch (RequestException $e) { - throw new ApiException( - "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), - $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null - ); - } catch (ConnectException $e) { - throw new ApiException( - "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), - null, - null - ); - } - - $statusCode = $response->getStatusCode(); - - if ($statusCode < 200 || $statusCode > 299) { - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - (string) $request->getUri() - ), - $statusCode, - $response->getHeaders(), - (string) $response->getBody() - ); - } - - switch($statusCode) { - case 201: - if ('\Shotstack\Client\Model\GeneratedAssetResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\Shotstack\Client\Model\GeneratedAssetResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\Shotstack\Client\Model\GeneratedAssetResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 400: - if ('\Shotstack\Client\Model\GeneratedAssetErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\Shotstack\Client\Model\GeneratedAssetErrorResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\Shotstack\Client\Model\GeneratedAssetErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - } - - $returnType = '\Shotstack\Client\Model\GeneratedAssetResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - - } catch (ApiException $e) { - switch ($e->getCode()) { - case 201: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Shotstack\Client\Model\GeneratedAssetResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 400: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Shotstack\Client\Model\GeneratedAssetErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - - /** - * Operation postGenerateAssetAsync - * - * Generate Asset - * - * @param \Shotstack\Client\Model\GeneratedAsset $generated_asset Generate an asset using the specified provider, type and options. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['postGenerateAsset'] to see the possible values for this operation - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function postGenerateAssetAsync($generated_asset, string $contentType = self::contentTypes['postGenerateAsset'][0]) - { - return $this->postGenerateAssetAsyncWithHttpInfo($generated_asset, $contentType) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation postGenerateAssetAsyncWithHttpInfo - * - * Generate Asset - * - * @param \Shotstack\Client\Model\GeneratedAsset $generated_asset Generate an asset using the specified provider, type and options. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['postGenerateAsset'] to see the possible values for this operation - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function postGenerateAssetAsyncWithHttpInfo($generated_asset, string $contentType = self::contentTypes['postGenerateAsset'][0]) - { - $returnType = '\Shotstack\Client\Model\GeneratedAssetResponse'; - $request = $this->postGenerateAssetRequest($generated_asset, $contentType); - - return $this->client - ->sendAsync($request, $this->createHttpClientOption()) - ->then( - function ($response) use ($returnType) { - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - $content = json_decode($content); - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - }, - function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - $exception->getRequest()->getUri() - ), - $statusCode, - $response->getHeaders(), - (string) $response->getBody() - ); - } - ); - } - - /** - * Create request for operation 'postGenerateAsset' - * - * @param \Shotstack\Client\Model\GeneratedAsset $generated_asset Generate an asset using the specified provider, type and options. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['postGenerateAsset'] to see the possible values for this operation - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - public function postGenerateAssetRequest($generated_asset, string $contentType = self::contentTypes['postGenerateAsset'][0]) - { - - // verify the required parameter 'generated_asset' is set - if ($generated_asset === null || (is_array($generated_asset) && count($generated_asset) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $generated_asset when calling postGenerateAsset' - ); - } - - - $resourcePath = '/assets'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ''; - $multipart = false; - - - - - - $headers = $this->headerSelector->selectHeaders( - ['application/json', ], - $contentType, - $multipart - ); - - // for model (json/xml) - if (isset($generated_asset)) { - if (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generated_asset)); - } else { - $httpBody = $generated_asset; - } - } elseif (count($formParams) > 0) { - if ($multipart) { - $multipartContents = []; - foreach ($formParams as $formParamName => $formParamValue) { - $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; - foreach ($formParamValueItems as $formParamValueItem) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValueItem - ]; - } - } - // for HTTP post (form) - $httpBody = new MultipartStream($multipartContents); - - } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the form parameters - $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); - } else { - // for HTTP post (form) - $httpBody = ObjectSerializer::buildQuery($formParams); - } - } - - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('x-api-key'); - if ($apiKey !== null) { - $headers['x-api-key'] = $apiKey; - } - - $defaultHeaders = []; - if ($this->config->getUserAgent()) { - $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); - } - - $headers = array_merge( - $defaultHeaders, - $headerParams, - $headers - ); - - $operationHost = $this->config->getHost(); - $query = ObjectSerializer::buildQuery($queryParams); - return new Request( - 'POST', - $operationHost . $resourcePath . ($query ? "?{$query}" : ''), - $headers, - $httpBody - ); - } - - /** - * Create http client option - * - * @throws \RuntimeException on file opening failure - * @return array of http client options - */ - protected function createHttpClientOption() - { - $options = []; - if ($this->config->getDebug()) { - $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); - if (!$options[RequestOptions::DEBUG]) { - throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); - } - } - - return $options; - } -} diff --git a/src/Api/EditApi.php b/src/Api/EditApi.php index 492fff6..4f51449 100644 --- a/src/Api/EditApi.php +++ b/src/Api/EditApi.php @@ -4,7 +4,7 @@ * PHP version 7.4 * * @category Class - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech */ @@ -25,7 +25,7 @@ * Do not edit the class manually. */ -namespace Shotstack\Client\Api; +namespace ShotstackClient\Api; use GuzzleHttp\Client; use GuzzleHttp\ClientInterface; @@ -34,16 +34,16 @@ use GuzzleHttp\Psr7\MultipartStream; use GuzzleHttp\Psr7\Request; use GuzzleHttp\RequestOptions; -use Shotstack\Client\ApiException; -use Shotstack\Client\Configuration; -use Shotstack\Client\HeaderSelector; -use Shotstack\Client\ObjectSerializer; +use ShotstackClient\ApiException; +use ShotstackClient\Configuration; +use ShotstackClient\HeaderSelector; +use ShotstackClient\ObjectSerializer; /** * EditApi Class Doc Comment * * @category Class - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech */ @@ -154,7 +154,7 @@ public function getConfig() * @param string $id The id of the template in UUID format (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteTemplate'] to see the possible values for this operation * - * @throws \Shotstack\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \ShotstackClient\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return void */ @@ -171,7 +171,7 @@ public function deleteTemplate($id, string $contentType = self::contentTypes['de * @param string $id The id of the template in UUID format (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteTemplate'] to see the possible values for this operation * - * @throws \Shotstack\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \ShotstackClient\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ @@ -393,9 +393,9 @@ public function deleteTemplateRequest($id, string $contentType = self::contentTy * @param bool $merged Used when data is set to true, it will show the [merge fields](#tocs_mergefield) merged in to the data response. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getRender'] to see the possible values for this operation * - * @throws \Shotstack\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \ShotstackClient\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \Shotstack\Client\Model\RenderResponse + * @return \ShotstackClient\Model\RenderResponse */ public function getRender($id, $data = null, $merged = null, string $contentType = self::contentTypes['getRender'][0]) { @@ -413,9 +413,9 @@ public function getRender($id, $data = null, $merged = null, string $contentType * @param bool $merged Used when data is set to true, it will show the [merge fields](#tocs_mergefield) merged in to the data response. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getRender'] to see the possible values for this operation * - * @throws \Shotstack\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \ShotstackClient\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \Shotstack\Client\Model\RenderResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \ShotstackClient\Model\RenderResponse, HTTP status code, HTTP response headers (array of strings) */ public function getRenderWithHttpInfo($id, $data = null, $merged = null, string $contentType = self::contentTypes['getRender'][0]) { @@ -458,11 +458,11 @@ public function getRenderWithHttpInfo($id, $data = null, $merged = null, string switch($statusCode) { case 200: - if ('\Shotstack\Client\Model\RenderResponse' === '\SplFileObject') { + if ('\ShotstackClient\Model\RenderResponse' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\Shotstack\Client\Model\RenderResponse' !== 'string') { + if ('\ShotstackClient\Model\RenderResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -480,13 +480,13 @@ public function getRenderWithHttpInfo($id, $data = null, $merged = null, string } return [ - ObjectSerializer::deserialize($content, '\Shotstack\Client\Model\RenderResponse', []), + ObjectSerializer::deserialize($content, '\ShotstackClient\Model\RenderResponse', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\Shotstack\Client\Model\RenderResponse'; + $returnType = '\ShotstackClient\Model\RenderResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -519,7 +519,7 @@ public function getRenderWithHttpInfo($id, $data = null, $merged = null, string case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Shotstack\Client\Model\RenderResponse', + '\ShotstackClient\Model\RenderResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -567,7 +567,7 @@ function ($response) { */ public function getRenderAsyncWithHttpInfo($id, $data = null, $merged = null, string $contentType = self::contentTypes['getRender'][0]) { - $returnType = '\Shotstack\Client\Model\RenderResponse'; + $returnType = '\ShotstackClient\Model\RenderResponse'; $request = $this->getRenderRequest($id, $data, $merged, $contentType); return $this->client @@ -736,9 +736,9 @@ public function getRenderRequest($id, $data = null, $merged = null, string $cont * @param string $id The id of the template in UUID format (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getTemplate'] to see the possible values for this operation * - * @throws \Shotstack\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \ShotstackClient\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \Shotstack\Client\Model\TemplateDataResponse + * @return \ShotstackClient\Model\TemplateDataResponse */ public function getTemplate($id, string $contentType = self::contentTypes['getTemplate'][0]) { @@ -754,9 +754,9 @@ public function getTemplate($id, string $contentType = self::contentTypes['getTe * @param string $id The id of the template in UUID format (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getTemplate'] to see the possible values for this operation * - * @throws \Shotstack\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \ShotstackClient\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \Shotstack\Client\Model\TemplateDataResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \ShotstackClient\Model\TemplateDataResponse, HTTP status code, HTTP response headers (array of strings) */ public function getTemplateWithHttpInfo($id, string $contentType = self::contentTypes['getTemplate'][0]) { @@ -799,11 +799,11 @@ public function getTemplateWithHttpInfo($id, string $contentType = self::content switch($statusCode) { case 200: - if ('\Shotstack\Client\Model\TemplateDataResponse' === '\SplFileObject') { + if ('\ShotstackClient\Model\TemplateDataResponse' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\Shotstack\Client\Model\TemplateDataResponse' !== 'string') { + if ('\ShotstackClient\Model\TemplateDataResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -821,13 +821,13 @@ public function getTemplateWithHttpInfo($id, string $contentType = self::content } return [ - ObjectSerializer::deserialize($content, '\Shotstack\Client\Model\TemplateDataResponse', []), + ObjectSerializer::deserialize($content, '\ShotstackClient\Model\TemplateDataResponse', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\Shotstack\Client\Model\TemplateDataResponse'; + $returnType = '\ShotstackClient\Model\TemplateDataResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -860,7 +860,7 @@ public function getTemplateWithHttpInfo($id, string $contentType = self::content case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Shotstack\Client\Model\TemplateDataResponse', + '\ShotstackClient\Model\TemplateDataResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -904,7 +904,7 @@ function ($response) { */ public function getTemplateAsyncWithHttpInfo($id, string $contentType = self::contentTypes['getTemplate'][0]) { - $returnType = '\Shotstack\Client\Model\TemplateDataResponse'; + $returnType = '\ShotstackClient\Model\TemplateDataResponse'; $request = $this->getTemplateRequest($id, $contentType); return $this->client @@ -1050,9 +1050,9 @@ public function getTemplateRequest($id, string $contentType = self::contentTypes * * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getTemplates'] to see the possible values for this operation * - * @throws \Shotstack\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \ShotstackClient\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \Shotstack\Client\Model\TemplateListResponse + * @return \ShotstackClient\Model\TemplateListResponse */ public function getTemplates(string $contentType = self::contentTypes['getTemplates'][0]) { @@ -1067,9 +1067,9 @@ public function getTemplates(string $contentType = self::contentTypes['getTempla * * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getTemplates'] to see the possible values for this operation * - * @throws \Shotstack\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \ShotstackClient\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \Shotstack\Client\Model\TemplateListResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \ShotstackClient\Model\TemplateListResponse, HTTP status code, HTTP response headers (array of strings) */ public function getTemplatesWithHttpInfo(string $contentType = self::contentTypes['getTemplates'][0]) { @@ -1112,11 +1112,11 @@ public function getTemplatesWithHttpInfo(string $contentType = self::contentType switch($statusCode) { case 200: - if ('\Shotstack\Client\Model\TemplateListResponse' === '\SplFileObject') { + if ('\ShotstackClient\Model\TemplateListResponse' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\Shotstack\Client\Model\TemplateListResponse' !== 'string') { + if ('\ShotstackClient\Model\TemplateListResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -1134,13 +1134,13 @@ public function getTemplatesWithHttpInfo(string $contentType = self::contentType } return [ - ObjectSerializer::deserialize($content, '\Shotstack\Client\Model\TemplateListResponse', []), + ObjectSerializer::deserialize($content, '\ShotstackClient\Model\TemplateListResponse', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\Shotstack\Client\Model\TemplateListResponse'; + $returnType = '\ShotstackClient\Model\TemplateListResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -1173,7 +1173,7 @@ public function getTemplatesWithHttpInfo(string $contentType = self::contentType case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Shotstack\Client\Model\TemplateListResponse', + '\ShotstackClient\Model\TemplateListResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -1215,7 +1215,7 @@ function ($response) { */ public function getTemplatesAsyncWithHttpInfo(string $contentType = self::contentTypes['getTemplates'][0]) { - $returnType = '\Shotstack\Client\Model\TemplateListResponse'; + $returnType = '\ShotstackClient\Model\TemplateListResponse'; $request = $this->getTemplatesRequest($contentType); return $this->client @@ -1340,12 +1340,12 @@ public function getTemplatesRequest(string $contentType = self::contentTypes['ge * * Render Asset * - * @param \Shotstack\Client\Model\Edit $edit The video, image or audio edit specified using JSON. (required) + * @param \ShotstackClient\Model\Edit $edit The video, image or audio edit specified using JSON. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['postRender'] to see the possible values for this operation * - * @throws \Shotstack\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \ShotstackClient\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \Shotstack\Client\Model\QueuedResponse + * @return \ShotstackClient\Model\QueuedResponse */ public function postRender($edit, string $contentType = self::contentTypes['postRender'][0]) { @@ -1358,12 +1358,12 @@ public function postRender($edit, string $contentType = self::contentTypes['post * * Render Asset * - * @param \Shotstack\Client\Model\Edit $edit The video, image or audio edit specified using JSON. (required) + * @param \ShotstackClient\Model\Edit $edit The video, image or audio edit specified using JSON. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['postRender'] to see the possible values for this operation * - * @throws \Shotstack\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \ShotstackClient\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \Shotstack\Client\Model\QueuedResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \ShotstackClient\Model\QueuedResponse, HTTP status code, HTTP response headers (array of strings) */ public function postRenderWithHttpInfo($edit, string $contentType = self::contentTypes['postRender'][0]) { @@ -1406,11 +1406,11 @@ public function postRenderWithHttpInfo($edit, string $contentType = self::conten switch($statusCode) { case 201: - if ('\Shotstack\Client\Model\QueuedResponse' === '\SplFileObject') { + if ('\ShotstackClient\Model\QueuedResponse' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\Shotstack\Client\Model\QueuedResponse' !== 'string') { + if ('\ShotstackClient\Model\QueuedResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -1428,13 +1428,13 @@ public function postRenderWithHttpInfo($edit, string $contentType = self::conten } return [ - ObjectSerializer::deserialize($content, '\Shotstack\Client\Model\QueuedResponse', []), + ObjectSerializer::deserialize($content, '\ShotstackClient\Model\QueuedResponse', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\Shotstack\Client\Model\QueuedResponse'; + $returnType = '\ShotstackClient\Model\QueuedResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -1467,7 +1467,7 @@ public function postRenderWithHttpInfo($edit, string $contentType = self::conten case 201: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Shotstack\Client\Model\QueuedResponse', + '\ShotstackClient\Model\QueuedResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -1482,7 +1482,7 @@ public function postRenderWithHttpInfo($edit, string $contentType = self::conten * * Render Asset * - * @param \Shotstack\Client\Model\Edit $edit The video, image or audio edit specified using JSON. (required) + * @param \ShotstackClient\Model\Edit $edit The video, image or audio edit specified using JSON. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['postRender'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -1503,7 +1503,7 @@ function ($response) { * * Render Asset * - * @param \Shotstack\Client\Model\Edit $edit The video, image or audio edit specified using JSON. (required) + * @param \ShotstackClient\Model\Edit $edit The video, image or audio edit specified using JSON. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['postRender'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -1511,7 +1511,7 @@ function ($response) { */ public function postRenderAsyncWithHttpInfo($edit, string $contentType = self::contentTypes['postRender'][0]) { - $returnType = '\Shotstack\Client\Model\QueuedResponse'; + $returnType = '\ShotstackClient\Model\QueuedResponse'; $request = $this->postRenderRequest($edit, $contentType); return $this->client @@ -1553,7 +1553,7 @@ function ($exception) { /** * Create request for operation 'postRender' * - * @param \Shotstack\Client\Model\Edit $edit The video, image or audio edit specified using JSON. (required) + * @param \ShotstackClient\Model\Edit $edit The video, image or audio edit specified using JSON. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['postRender'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -1651,12 +1651,12 @@ public function postRenderRequest($edit, string $contentType = self::contentType * * Create Template * - * @param \Shotstack\Client\Model\Template $template Create a template with a name and [Edit](#tocs_edit). (required) + * @param \ShotstackClient\Model\Template $template Create a template with a name and [Edit](#tocs_edit). (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['postTemplate'] to see the possible values for this operation * - * @throws \Shotstack\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \ShotstackClient\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \Shotstack\Client\Model\TemplateResponse + * @return \ShotstackClient\Model\TemplateResponse */ public function postTemplate($template, string $contentType = self::contentTypes['postTemplate'][0]) { @@ -1669,12 +1669,12 @@ public function postTemplate($template, string $contentType = self::contentTypes * * Create Template * - * @param \Shotstack\Client\Model\Template $template Create a template with a name and [Edit](#tocs_edit). (required) + * @param \ShotstackClient\Model\Template $template Create a template with a name and [Edit](#tocs_edit). (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['postTemplate'] to see the possible values for this operation * - * @throws \Shotstack\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \ShotstackClient\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \Shotstack\Client\Model\TemplateResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \ShotstackClient\Model\TemplateResponse, HTTP status code, HTTP response headers (array of strings) */ public function postTemplateWithHttpInfo($template, string $contentType = self::contentTypes['postTemplate'][0]) { @@ -1717,11 +1717,11 @@ public function postTemplateWithHttpInfo($template, string $contentType = self:: switch($statusCode) { case 201: - if ('\Shotstack\Client\Model\TemplateResponse' === '\SplFileObject') { + if ('\ShotstackClient\Model\TemplateResponse' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\Shotstack\Client\Model\TemplateResponse' !== 'string') { + if ('\ShotstackClient\Model\TemplateResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -1739,13 +1739,13 @@ public function postTemplateWithHttpInfo($template, string $contentType = self:: } return [ - ObjectSerializer::deserialize($content, '\Shotstack\Client\Model\TemplateResponse', []), + ObjectSerializer::deserialize($content, '\ShotstackClient\Model\TemplateResponse', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\Shotstack\Client\Model\TemplateResponse'; + $returnType = '\ShotstackClient\Model\TemplateResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -1778,7 +1778,7 @@ public function postTemplateWithHttpInfo($template, string $contentType = self:: case 201: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Shotstack\Client\Model\TemplateResponse', + '\ShotstackClient\Model\TemplateResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -1793,7 +1793,7 @@ public function postTemplateWithHttpInfo($template, string $contentType = self:: * * Create Template * - * @param \Shotstack\Client\Model\Template $template Create a template with a name and [Edit](#tocs_edit). (required) + * @param \ShotstackClient\Model\Template $template Create a template with a name and [Edit](#tocs_edit). (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['postTemplate'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -1814,7 +1814,7 @@ function ($response) { * * Create Template * - * @param \Shotstack\Client\Model\Template $template Create a template with a name and [Edit](#tocs_edit). (required) + * @param \ShotstackClient\Model\Template $template Create a template with a name and [Edit](#tocs_edit). (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['postTemplate'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -1822,7 +1822,7 @@ function ($response) { */ public function postTemplateAsyncWithHttpInfo($template, string $contentType = self::contentTypes['postTemplate'][0]) { - $returnType = '\Shotstack\Client\Model\TemplateResponse'; + $returnType = '\ShotstackClient\Model\TemplateResponse'; $request = $this->postTemplateRequest($template, $contentType); return $this->client @@ -1864,7 +1864,7 @@ function ($exception) { /** * Create request for operation 'postTemplate' * - * @param \Shotstack\Client\Model\Template $template Create a template with a name and [Edit](#tocs_edit). (required) + * @param \ShotstackClient\Model\Template $template Create a template with a name and [Edit](#tocs_edit). (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['postTemplate'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -1962,12 +1962,12 @@ public function postTemplateRequest($template, string $contentType = self::conte * * Render Template * - * @param \Shotstack\Client\Model\TemplateRender $template_render Render a template by template id. (required) + * @param \ShotstackClient\Model\TemplateRender $template_render Render a template by template id. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['postTemplateRender'] to see the possible values for this operation * - * @throws \Shotstack\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \ShotstackClient\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \Shotstack\Client\Model\QueuedResponse + * @return \ShotstackClient\Model\QueuedResponse */ public function postTemplateRender($template_render, string $contentType = self::contentTypes['postTemplateRender'][0]) { @@ -1980,12 +1980,12 @@ public function postTemplateRender($template_render, string $contentType = self: * * Render Template * - * @param \Shotstack\Client\Model\TemplateRender $template_render Render a template by template id. (required) + * @param \ShotstackClient\Model\TemplateRender $template_render Render a template by template id. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['postTemplateRender'] to see the possible values for this operation * - * @throws \Shotstack\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \ShotstackClient\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \Shotstack\Client\Model\QueuedResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \ShotstackClient\Model\QueuedResponse, HTTP status code, HTTP response headers (array of strings) */ public function postTemplateRenderWithHttpInfo($template_render, string $contentType = self::contentTypes['postTemplateRender'][0]) { @@ -2028,11 +2028,11 @@ public function postTemplateRenderWithHttpInfo($template_render, string $content switch($statusCode) { case 201: - if ('\Shotstack\Client\Model\QueuedResponse' === '\SplFileObject') { + if ('\ShotstackClient\Model\QueuedResponse' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\Shotstack\Client\Model\QueuedResponse' !== 'string') { + if ('\ShotstackClient\Model\QueuedResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -2050,13 +2050,13 @@ public function postTemplateRenderWithHttpInfo($template_render, string $content } return [ - ObjectSerializer::deserialize($content, '\Shotstack\Client\Model\QueuedResponse', []), + ObjectSerializer::deserialize($content, '\ShotstackClient\Model\QueuedResponse', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\Shotstack\Client\Model\QueuedResponse'; + $returnType = '\ShotstackClient\Model\QueuedResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -2089,7 +2089,7 @@ public function postTemplateRenderWithHttpInfo($template_render, string $content case 201: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Shotstack\Client\Model\QueuedResponse', + '\ShotstackClient\Model\QueuedResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -2104,7 +2104,7 @@ public function postTemplateRenderWithHttpInfo($template_render, string $content * * Render Template * - * @param \Shotstack\Client\Model\TemplateRender $template_render Render a template by template id. (required) + * @param \ShotstackClient\Model\TemplateRender $template_render Render a template by template id. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['postTemplateRender'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -2125,7 +2125,7 @@ function ($response) { * * Render Template * - * @param \Shotstack\Client\Model\TemplateRender $template_render Render a template by template id. (required) + * @param \ShotstackClient\Model\TemplateRender $template_render Render a template by template id. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['postTemplateRender'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -2133,7 +2133,7 @@ function ($response) { */ public function postTemplateRenderAsyncWithHttpInfo($template_render, string $contentType = self::contentTypes['postTemplateRender'][0]) { - $returnType = '\Shotstack\Client\Model\QueuedResponse'; + $returnType = '\ShotstackClient\Model\QueuedResponse'; $request = $this->postTemplateRenderRequest($template_render, $contentType); return $this->client @@ -2175,7 +2175,7 @@ function ($exception) { /** * Create request for operation 'postTemplateRender' * - * @param \Shotstack\Client\Model\TemplateRender $template_render Render a template by template id. (required) + * @param \ShotstackClient\Model\TemplateRender $template_render Render a template by template id. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['postTemplateRender'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -2276,9 +2276,9 @@ public function postTemplateRenderRequest($template_render, string $contentType * @param string $url The URL of the media to inspect, must be **URL encoded**. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['probe'] to see the possible values for this operation * - * @throws \Shotstack\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \ShotstackClient\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \Shotstack\Client\Model\ProbeResponse + * @return \ShotstackClient\Model\ProbeResponse */ public function probe($url, string $contentType = self::contentTypes['probe'][0]) { @@ -2294,9 +2294,9 @@ public function probe($url, string $contentType = self::contentTypes['probe'][0] * @param string $url The URL of the media to inspect, must be **URL encoded**. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['probe'] to see the possible values for this operation * - * @throws \Shotstack\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \ShotstackClient\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \Shotstack\Client\Model\ProbeResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \ShotstackClient\Model\ProbeResponse, HTTP status code, HTTP response headers (array of strings) */ public function probeWithHttpInfo($url, string $contentType = self::contentTypes['probe'][0]) { @@ -2339,11 +2339,11 @@ public function probeWithHttpInfo($url, string $contentType = self::contentTypes switch($statusCode) { case 200: - if ('\Shotstack\Client\Model\ProbeResponse' === '\SplFileObject') { + if ('\ShotstackClient\Model\ProbeResponse' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\Shotstack\Client\Model\ProbeResponse' !== 'string') { + if ('\ShotstackClient\Model\ProbeResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -2361,13 +2361,13 @@ public function probeWithHttpInfo($url, string $contentType = self::contentTypes } return [ - ObjectSerializer::deserialize($content, '\Shotstack\Client\Model\ProbeResponse', []), + ObjectSerializer::deserialize($content, '\ShotstackClient\Model\ProbeResponse', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\Shotstack\Client\Model\ProbeResponse'; + $returnType = '\ShotstackClient\Model\ProbeResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -2400,7 +2400,7 @@ public function probeWithHttpInfo($url, string $contentType = self::contentTypes case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Shotstack\Client\Model\ProbeResponse', + '\ShotstackClient\Model\ProbeResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -2444,7 +2444,7 @@ function ($response) { */ public function probeAsyncWithHttpInfo($url, string $contentType = self::contentTypes['probe'][0]) { - $returnType = '\Shotstack\Client\Model\ProbeResponse'; + $returnType = '\ShotstackClient\Model\ProbeResponse'; $request = $this->probeRequest($url, $contentType); return $this->client @@ -2586,12 +2586,12 @@ public function probeRequest($url, string $contentType = self::contentTypes['pro * Update Template * * @param string $id The id of the template in UUID format (required) - * @param \Shotstack\Client\Model\Template $template Update an individual templates name and [Edit](#tocs_edit). Both template name and template must be provided. If the template parameter is omitted a blank template will be saved. (required) + * @param \ShotstackClient\Model\Template $template Update an individual templates name and [Edit](#tocs_edit). Both template name and template must be provided. If the template parameter is omitted a blank template will be saved. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['putTemplate'] to see the possible values for this operation * - * @throws \Shotstack\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \ShotstackClient\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \Shotstack\Client\Model\TemplateResponse + * @return \ShotstackClient\Model\TemplateResponse */ public function putTemplate($id, $template, string $contentType = self::contentTypes['putTemplate'][0]) { @@ -2605,12 +2605,12 @@ public function putTemplate($id, $template, string $contentType = self::contentT * Update Template * * @param string $id The id of the template in UUID format (required) - * @param \Shotstack\Client\Model\Template $template Update an individual templates name and [Edit](#tocs_edit). Both template name and template must be provided. If the template parameter is omitted a blank template will be saved. (required) + * @param \ShotstackClient\Model\Template $template Update an individual templates name and [Edit](#tocs_edit). Both template name and template must be provided. If the template parameter is omitted a blank template will be saved. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['putTemplate'] to see the possible values for this operation * - * @throws \Shotstack\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \ShotstackClient\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \Shotstack\Client\Model\TemplateResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \ShotstackClient\Model\TemplateResponse, HTTP status code, HTTP response headers (array of strings) */ public function putTemplateWithHttpInfo($id, $template, string $contentType = self::contentTypes['putTemplate'][0]) { @@ -2653,11 +2653,11 @@ public function putTemplateWithHttpInfo($id, $template, string $contentType = se switch($statusCode) { case 200: - if ('\Shotstack\Client\Model\TemplateResponse' === '\SplFileObject') { + if ('\ShotstackClient\Model\TemplateResponse' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\Shotstack\Client\Model\TemplateResponse' !== 'string') { + if ('\ShotstackClient\Model\TemplateResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -2675,13 +2675,13 @@ public function putTemplateWithHttpInfo($id, $template, string $contentType = se } return [ - ObjectSerializer::deserialize($content, '\Shotstack\Client\Model\TemplateResponse', []), + ObjectSerializer::deserialize($content, '\ShotstackClient\Model\TemplateResponse', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\Shotstack\Client\Model\TemplateResponse'; + $returnType = '\ShotstackClient\Model\TemplateResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -2714,7 +2714,7 @@ public function putTemplateWithHttpInfo($id, $template, string $contentType = se case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Shotstack\Client\Model\TemplateResponse', + '\ShotstackClient\Model\TemplateResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -2730,7 +2730,7 @@ public function putTemplateWithHttpInfo($id, $template, string $contentType = se * Update Template * * @param string $id The id of the template in UUID format (required) - * @param \Shotstack\Client\Model\Template $template Update an individual templates name and [Edit](#tocs_edit). Both template name and template must be provided. If the template parameter is omitted a blank template will be saved. (required) + * @param \ShotstackClient\Model\Template $template Update an individual templates name and [Edit](#tocs_edit). Both template name and template must be provided. If the template parameter is omitted a blank template will be saved. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['putTemplate'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -2752,7 +2752,7 @@ function ($response) { * Update Template * * @param string $id The id of the template in UUID format (required) - * @param \Shotstack\Client\Model\Template $template Update an individual templates name and [Edit](#tocs_edit). Both template name and template must be provided. If the template parameter is omitted a blank template will be saved. (required) + * @param \ShotstackClient\Model\Template $template Update an individual templates name and [Edit](#tocs_edit). Both template name and template must be provided. If the template parameter is omitted a blank template will be saved. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['putTemplate'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -2760,7 +2760,7 @@ function ($response) { */ public function putTemplateAsyncWithHttpInfo($id, $template, string $contentType = self::contentTypes['putTemplate'][0]) { - $returnType = '\Shotstack\Client\Model\TemplateResponse'; + $returnType = '\ShotstackClient\Model\TemplateResponse'; $request = $this->putTemplateRequest($id, $template, $contentType); return $this->client @@ -2803,7 +2803,7 @@ function ($exception) { * Create request for operation 'putTemplate' * * @param string $id The id of the template in UUID format (required) - * @param \Shotstack\Client\Model\Template $template Update an individual templates name and [Edit](#tocs_edit). Both template name and template must be provided. If the template parameter is omitted a blank template will be saved. (required) + * @param \ShotstackClient\Model\Template $template Update an individual templates name and [Edit](#tocs_edit). Both template name and template must be provided. If the template parameter is omitted a blank template will be saved. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['putTemplate'] to see the possible values for this operation * * @throws \InvalidArgumentException diff --git a/src/Api/IngestApi.php b/src/Api/IngestApi.php index 4535673..8ebddc6 100644 --- a/src/Api/IngestApi.php +++ b/src/Api/IngestApi.php @@ -4,7 +4,7 @@ * PHP version 7.4 * * @category Class - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech */ @@ -25,7 +25,7 @@ * Do not edit the class manually. */ -namespace Shotstack\Client\Api; +namespace ShotstackClient\Api; use GuzzleHttp\Client; use GuzzleHttp\ClientInterface; @@ -34,16 +34,16 @@ use GuzzleHttp\Psr7\MultipartStream; use GuzzleHttp\Psr7\Request; use GuzzleHttp\RequestOptions; -use Shotstack\Client\ApiException; -use Shotstack\Client\Configuration; -use Shotstack\Client\HeaderSelector; -use Shotstack\Client\ObjectSerializer; +use ShotstackClient\ApiException; +use ShotstackClient\Configuration; +use ShotstackClient\HeaderSelector; +use ShotstackClient\ObjectSerializer; /** * IngestApi Class Doc Comment * * @category Class - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech */ @@ -142,7 +142,7 @@ public function getConfig() * @param string $id The id of the source file in [KSUID](https://github.com/segmentio/ksuid#what-is-a-ksuid) format. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteSource'] to see the possible values for this operation * - * @throws \Shotstack\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \ShotstackClient\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return void */ @@ -159,7 +159,7 @@ public function deleteSource($id, string $contentType = self::contentTypes['dele * @param string $id The id of the source file in [KSUID](https://github.com/segmentio/ksuid#what-is-a-ksuid) format. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteSource'] to see the possible values for this operation * - * @throws \Shotstack\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \ShotstackClient\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ @@ -379,9 +379,9 @@ public function deleteSourceRequest($id, string $contentType = self::contentType * @param string $id The id of the source file in [KSUID](https://github.com/segmentio/ksuid#what-is-a-ksuid) format. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSource'] to see the possible values for this operation * - * @throws \Shotstack\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \ShotstackClient\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \Shotstack\Client\Model\SourceResponse + * @return \ShotstackClient\Model\SourceResponse */ public function getSource($id, string $contentType = self::contentTypes['getSource'][0]) { @@ -397,9 +397,9 @@ public function getSource($id, string $contentType = self::contentTypes['getSour * @param string $id The id of the source file in [KSUID](https://github.com/segmentio/ksuid#what-is-a-ksuid) format. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSource'] to see the possible values for this operation * - * @throws \Shotstack\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \ShotstackClient\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \Shotstack\Client\Model\SourceResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \ShotstackClient\Model\SourceResponse, HTTP status code, HTTP response headers (array of strings) */ public function getSourceWithHttpInfo($id, string $contentType = self::contentTypes['getSource'][0]) { @@ -442,11 +442,11 @@ public function getSourceWithHttpInfo($id, string $contentType = self::contentTy switch($statusCode) { case 200: - if ('\Shotstack\Client\Model\SourceResponse' === '\SplFileObject') { + if ('\ShotstackClient\Model\SourceResponse' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\Shotstack\Client\Model\SourceResponse' !== 'string') { + if ('\ShotstackClient\Model\SourceResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -464,13 +464,13 @@ public function getSourceWithHttpInfo($id, string $contentType = self::contentTy } return [ - ObjectSerializer::deserialize($content, '\Shotstack\Client\Model\SourceResponse', []), + ObjectSerializer::deserialize($content, '\ShotstackClient\Model\SourceResponse', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\Shotstack\Client\Model\SourceResponse'; + $returnType = '\ShotstackClient\Model\SourceResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -503,7 +503,7 @@ public function getSourceWithHttpInfo($id, string $contentType = self::contentTy case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Shotstack\Client\Model\SourceResponse', + '\ShotstackClient\Model\SourceResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -547,7 +547,7 @@ function ($response) { */ public function getSourceAsyncWithHttpInfo($id, string $contentType = self::contentTypes['getSource'][0]) { - $returnType = '\Shotstack\Client\Model\SourceResponse'; + $returnType = '\ShotstackClient\Model\SourceResponse'; $request = $this->getSourceRequest($id, $contentType); return $this->client @@ -693,9 +693,9 @@ public function getSourceRequest($id, string $contentType = self::contentTypes[' * * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSources'] to see the possible values for this operation * - * @throws \Shotstack\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \ShotstackClient\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \Shotstack\Client\Model\SourceListResponse + * @return \ShotstackClient\Model\SourceListResponse */ public function getSources(string $contentType = self::contentTypes['getSources'][0]) { @@ -710,9 +710,9 @@ public function getSources(string $contentType = self::contentTypes['getSources' * * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSources'] to see the possible values for this operation * - * @throws \Shotstack\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \ShotstackClient\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \Shotstack\Client\Model\SourceListResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \ShotstackClient\Model\SourceListResponse, HTTP status code, HTTP response headers (array of strings) */ public function getSourcesWithHttpInfo(string $contentType = self::contentTypes['getSources'][0]) { @@ -755,11 +755,11 @@ public function getSourcesWithHttpInfo(string $contentType = self::contentTypes[ switch($statusCode) { case 200: - if ('\Shotstack\Client\Model\SourceListResponse' === '\SplFileObject') { + if ('\ShotstackClient\Model\SourceListResponse' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\Shotstack\Client\Model\SourceListResponse' !== 'string') { + if ('\ShotstackClient\Model\SourceListResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -777,13 +777,13 @@ public function getSourcesWithHttpInfo(string $contentType = self::contentTypes[ } return [ - ObjectSerializer::deserialize($content, '\Shotstack\Client\Model\SourceListResponse', []), + ObjectSerializer::deserialize($content, '\ShotstackClient\Model\SourceListResponse', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\Shotstack\Client\Model\SourceListResponse'; + $returnType = '\ShotstackClient\Model\SourceListResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -816,7 +816,7 @@ public function getSourcesWithHttpInfo(string $contentType = self::contentTypes[ case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Shotstack\Client\Model\SourceListResponse', + '\ShotstackClient\Model\SourceListResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -858,7 +858,7 @@ function ($response) { */ public function getSourcesAsyncWithHttpInfo(string $contentType = self::contentTypes['getSources'][0]) { - $returnType = '\Shotstack\Client\Model\SourceListResponse'; + $returnType = '\ShotstackClient\Model\SourceListResponse'; $request = $this->getSourcesRequest($contentType); return $this->client @@ -985,9 +985,9 @@ public function getSourcesRequest(string $contentType = self::contentTypes['getS * * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getUploadSignedUrl'] to see the possible values for this operation * - * @throws \Shotstack\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \ShotstackClient\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \Shotstack\Client\Model\UploadResponse + * @return \ShotstackClient\Model\UploadResponse */ public function getUploadSignedUrl(string $contentType = self::contentTypes['getUploadSignedUrl'][0]) { @@ -1002,9 +1002,9 @@ public function getUploadSignedUrl(string $contentType = self::contentTypes['get * * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getUploadSignedUrl'] to see the possible values for this operation * - * @throws \Shotstack\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \ShotstackClient\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \Shotstack\Client\Model\UploadResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \ShotstackClient\Model\UploadResponse, HTTP status code, HTTP response headers (array of strings) */ public function getUploadSignedUrlWithHttpInfo(string $contentType = self::contentTypes['getUploadSignedUrl'][0]) { @@ -1047,11 +1047,11 @@ public function getUploadSignedUrlWithHttpInfo(string $contentType = self::conte switch($statusCode) { case 200: - if ('\Shotstack\Client\Model\UploadResponse' === '\SplFileObject') { + if ('\ShotstackClient\Model\UploadResponse' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\Shotstack\Client\Model\UploadResponse' !== 'string') { + if ('\ShotstackClient\Model\UploadResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -1069,13 +1069,13 @@ public function getUploadSignedUrlWithHttpInfo(string $contentType = self::conte } return [ - ObjectSerializer::deserialize($content, '\Shotstack\Client\Model\UploadResponse', []), + ObjectSerializer::deserialize($content, '\ShotstackClient\Model\UploadResponse', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\Shotstack\Client\Model\UploadResponse'; + $returnType = '\ShotstackClient\Model\UploadResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -1108,7 +1108,7 @@ public function getUploadSignedUrlWithHttpInfo(string $contentType = self::conte case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Shotstack\Client\Model\UploadResponse', + '\ShotstackClient\Model\UploadResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -1150,7 +1150,7 @@ function ($response) { */ public function getUploadSignedUrlAsyncWithHttpInfo(string $contentType = self::contentTypes['getUploadSignedUrl'][0]) { - $returnType = '\Shotstack\Client\Model\UploadResponse'; + $returnType = '\ShotstackClient\Model\UploadResponse'; $request = $this->getUploadSignedUrlRequest($contentType); return $this->client @@ -1275,12 +1275,12 @@ public function getUploadSignedUrlRequest(string $contentType = self::contentTyp * * Fetch Source * - * @param \Shotstack\Client\Model\Source $source Ingest a video, image, audio or font file from the provided URL. Optionally provide a list of output renditions. (required) + * @param \ShotstackClient\Model\Source $source Ingest a video, image, audio or font file from the provided URL. Optionally provide a list of output renditions. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['postSource'] to see the possible values for this operation * - * @throws \Shotstack\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \ShotstackClient\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \Shotstack\Client\Model\QueuedSourceResponse|\Shotstack\Client\Model\IngestErrorResponse + * @return \ShotstackClient\Model\QueuedSourceResponse|\ShotstackClient\Model\IngestErrorResponse */ public function postSource($source, string $contentType = self::contentTypes['postSource'][0]) { @@ -1293,12 +1293,12 @@ public function postSource($source, string $contentType = self::contentTypes['po * * Fetch Source * - * @param \Shotstack\Client\Model\Source $source Ingest a video, image, audio or font file from the provided URL. Optionally provide a list of output renditions. (required) + * @param \ShotstackClient\Model\Source $source Ingest a video, image, audio or font file from the provided URL. Optionally provide a list of output renditions. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['postSource'] to see the possible values for this operation * - * @throws \Shotstack\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \ShotstackClient\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \Shotstack\Client\Model\QueuedSourceResponse|\Shotstack\Client\Model\IngestErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \ShotstackClient\Model\QueuedSourceResponse|\ShotstackClient\Model\IngestErrorResponse, HTTP status code, HTTP response headers (array of strings) */ public function postSourceWithHttpInfo($source, string $contentType = self::contentTypes['postSource'][0]) { @@ -1341,11 +1341,11 @@ public function postSourceWithHttpInfo($source, string $contentType = self::cont switch($statusCode) { case 201: - if ('\Shotstack\Client\Model\QueuedSourceResponse' === '\SplFileObject') { + if ('\ShotstackClient\Model\QueuedSourceResponse' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\Shotstack\Client\Model\QueuedSourceResponse' !== 'string') { + if ('\ShotstackClient\Model\QueuedSourceResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -1363,16 +1363,16 @@ public function postSourceWithHttpInfo($source, string $contentType = self::cont } return [ - ObjectSerializer::deserialize($content, '\Shotstack\Client\Model\QueuedSourceResponse', []), + ObjectSerializer::deserialize($content, '\ShotstackClient\Model\QueuedSourceResponse', []), $response->getStatusCode(), $response->getHeaders() ]; case 400: - if ('\Shotstack\Client\Model\IngestErrorResponse' === '\SplFileObject') { + if ('\ShotstackClient\Model\IngestErrorResponse' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\Shotstack\Client\Model\IngestErrorResponse' !== 'string') { + if ('\ShotstackClient\Model\IngestErrorResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -1390,13 +1390,13 @@ public function postSourceWithHttpInfo($source, string $contentType = self::cont } return [ - ObjectSerializer::deserialize($content, '\Shotstack\Client\Model\IngestErrorResponse', []), + ObjectSerializer::deserialize($content, '\ShotstackClient\Model\IngestErrorResponse', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\Shotstack\Client\Model\QueuedSourceResponse'; + $returnType = '\ShotstackClient\Model\QueuedSourceResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -1429,7 +1429,7 @@ public function postSourceWithHttpInfo($source, string $contentType = self::cont case 201: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Shotstack\Client\Model\QueuedSourceResponse', + '\ShotstackClient\Model\QueuedSourceResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -1437,7 +1437,7 @@ public function postSourceWithHttpInfo($source, string $contentType = self::cont case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Shotstack\Client\Model\IngestErrorResponse', + '\ShotstackClient\Model\IngestErrorResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -1452,7 +1452,7 @@ public function postSourceWithHttpInfo($source, string $contentType = self::cont * * Fetch Source * - * @param \Shotstack\Client\Model\Source $source Ingest a video, image, audio or font file from the provided URL. Optionally provide a list of output renditions. (required) + * @param \ShotstackClient\Model\Source $source Ingest a video, image, audio or font file from the provided URL. Optionally provide a list of output renditions. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['postSource'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -1473,7 +1473,7 @@ function ($response) { * * Fetch Source * - * @param \Shotstack\Client\Model\Source $source Ingest a video, image, audio or font file from the provided URL. Optionally provide a list of output renditions. (required) + * @param \ShotstackClient\Model\Source $source Ingest a video, image, audio or font file from the provided URL. Optionally provide a list of output renditions. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['postSource'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -1481,7 +1481,7 @@ function ($response) { */ public function postSourceAsyncWithHttpInfo($source, string $contentType = self::contentTypes['postSource'][0]) { - $returnType = '\Shotstack\Client\Model\QueuedSourceResponse'; + $returnType = '\ShotstackClient\Model\QueuedSourceResponse'; $request = $this->postSourceRequest($source, $contentType); return $this->client @@ -1523,7 +1523,7 @@ function ($exception) { /** * Create request for operation 'postSource' * - * @param \Shotstack\Client\Model\Source $source Ingest a video, image, audio or font file from the provided URL. Optionally provide a list of output renditions. (required) + * @param \ShotstackClient\Model\Source $source Ingest a video, image, audio or font file from the provided URL. Optionally provide a list of output renditions. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['postSource'] to see the possible values for this operation * * @throws \InvalidArgumentException diff --git a/src/Api/ServeApi.php b/src/Api/ServeApi.php index 4ef907c..b085c81 100644 --- a/src/Api/ServeApi.php +++ b/src/Api/ServeApi.php @@ -4,7 +4,7 @@ * PHP version 7.4 * * @category Class - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech */ @@ -25,7 +25,7 @@ * Do not edit the class manually. */ -namespace Shotstack\Client\Api; +namespace ShotstackClient\Api; use GuzzleHttp\Client; use GuzzleHttp\ClientInterface; @@ -34,16 +34,16 @@ use GuzzleHttp\Psr7\MultipartStream; use GuzzleHttp\Psr7\Request; use GuzzleHttp\RequestOptions; -use Shotstack\Client\ApiException; -use Shotstack\Client\Configuration; -use Shotstack\Client\HeaderSelector; -use Shotstack\Client\ObjectSerializer; +use ShotstackClient\ApiException; +use ShotstackClient\Configuration; +use ShotstackClient\HeaderSelector; +use ShotstackClient\ObjectSerializer; /** * ServeApi Class Doc Comment * * @category Class - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech */ @@ -139,7 +139,7 @@ public function getConfig() * @param string $id The id of the asset in UUID format (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteAsset'] to see the possible values for this operation * - * @throws \Shotstack\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \ShotstackClient\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return void */ @@ -156,7 +156,7 @@ public function deleteAsset($id, string $contentType = self::contentTypes['delet * @param string $id The id of the asset in UUID format (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteAsset'] to see the possible values for this operation * - * @throws \Shotstack\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \ShotstackClient\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ @@ -376,9 +376,9 @@ public function deleteAssetRequest($id, string $contentType = self::contentTypes * @param string $id The id of the asset in UUID format (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAsset'] to see the possible values for this operation * - * @throws \Shotstack\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \ShotstackClient\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \Shotstack\Client\Model\AssetResponse + * @return \ShotstackClient\Model\AssetResponse */ public function getAsset($id, string $contentType = self::contentTypes['getAsset'][0]) { @@ -394,9 +394,9 @@ public function getAsset($id, string $contentType = self::contentTypes['getAsset * @param string $id The id of the asset in UUID format (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAsset'] to see the possible values for this operation * - * @throws \Shotstack\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \ShotstackClient\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \Shotstack\Client\Model\AssetResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \ShotstackClient\Model\AssetResponse, HTTP status code, HTTP response headers (array of strings) */ public function getAssetWithHttpInfo($id, string $contentType = self::contentTypes['getAsset'][0]) { @@ -439,11 +439,11 @@ public function getAssetWithHttpInfo($id, string $contentType = self::contentTyp switch($statusCode) { case 200: - if ('\Shotstack\Client\Model\AssetResponse' === '\SplFileObject') { + if ('\ShotstackClient\Model\AssetResponse' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\Shotstack\Client\Model\AssetResponse' !== 'string') { + if ('\ShotstackClient\Model\AssetResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -461,13 +461,13 @@ public function getAssetWithHttpInfo($id, string $contentType = self::contentTyp } return [ - ObjectSerializer::deserialize($content, '\Shotstack\Client\Model\AssetResponse', []), + ObjectSerializer::deserialize($content, '\ShotstackClient\Model\AssetResponse', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\Shotstack\Client\Model\AssetResponse'; + $returnType = '\ShotstackClient\Model\AssetResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -500,7 +500,7 @@ public function getAssetWithHttpInfo($id, string $contentType = self::contentTyp case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Shotstack\Client\Model\AssetResponse', + '\ShotstackClient\Model\AssetResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -544,7 +544,7 @@ function ($response) { */ public function getAssetAsyncWithHttpInfo($id, string $contentType = self::contentTypes['getAsset'][0]) { - $returnType = '\Shotstack\Client\Model\AssetResponse'; + $returnType = '\ShotstackClient\Model\AssetResponse'; $request = $this->getAssetRequest($id, $contentType); return $this->client @@ -691,9 +691,9 @@ public function getAssetRequest($id, string $contentType = self::contentTypes['g * @param string $id The render id associated with the asset in UUID format (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAssetByRenderId'] to see the possible values for this operation * - * @throws \Shotstack\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \ShotstackClient\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \Shotstack\Client\Model\AssetRenderResponse + * @return \ShotstackClient\Model\AssetRenderResponse */ public function getAssetByRenderId($id, string $contentType = self::contentTypes['getAssetByRenderId'][0]) { @@ -709,9 +709,9 @@ public function getAssetByRenderId($id, string $contentType = self::contentTypes * @param string $id The render id associated with the asset in UUID format (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAssetByRenderId'] to see the possible values for this operation * - * @throws \Shotstack\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \ShotstackClient\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \Shotstack\Client\Model\AssetRenderResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \ShotstackClient\Model\AssetRenderResponse, HTTP status code, HTTP response headers (array of strings) */ public function getAssetByRenderIdWithHttpInfo($id, string $contentType = self::contentTypes['getAssetByRenderId'][0]) { @@ -754,11 +754,11 @@ public function getAssetByRenderIdWithHttpInfo($id, string $contentType = self:: switch($statusCode) { case 200: - if ('\Shotstack\Client\Model\AssetRenderResponse' === '\SplFileObject') { + if ('\ShotstackClient\Model\AssetRenderResponse' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\Shotstack\Client\Model\AssetRenderResponse' !== 'string') { + if ('\ShotstackClient\Model\AssetRenderResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -776,13 +776,13 @@ public function getAssetByRenderIdWithHttpInfo($id, string $contentType = self:: } return [ - ObjectSerializer::deserialize($content, '\Shotstack\Client\Model\AssetRenderResponse', []), + ObjectSerializer::deserialize($content, '\ShotstackClient\Model\AssetRenderResponse', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\Shotstack\Client\Model\AssetRenderResponse'; + $returnType = '\ShotstackClient\Model\AssetRenderResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -815,7 +815,7 @@ public function getAssetByRenderIdWithHttpInfo($id, string $contentType = self:: case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Shotstack\Client\Model\AssetRenderResponse', + '\ShotstackClient\Model\AssetRenderResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -859,7 +859,7 @@ function ($response) { */ public function getAssetByRenderIdAsyncWithHttpInfo($id, string $contentType = self::contentTypes['getAssetByRenderId'][0]) { - $returnType = '\Shotstack\Client\Model\AssetRenderResponse'; + $returnType = '\ShotstackClient\Model\AssetRenderResponse'; $request = $this->getAssetByRenderIdRequest($id, $contentType); return $this->client @@ -1003,12 +1003,12 @@ public function getAssetByRenderIdRequest($id, string $contentType = self::conte * * Transfer Asset * - * @param \Shotstack\Client\Model\Transfer $transfer Fetch an asset from a URL and send it to one or more destinations. (required) + * @param \ShotstackClient\Model\Transfer $transfer Fetch an asset from a URL and send it to one or more destinations. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['postServeAsset'] to see the possible values for this operation * - * @throws \Shotstack\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \ShotstackClient\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \Shotstack\Client\Model\TransferResponse + * @return \ShotstackClient\Model\TransferResponse */ public function postServeAsset($transfer, string $contentType = self::contentTypes['postServeAsset'][0]) { @@ -1021,12 +1021,12 @@ public function postServeAsset($transfer, string $contentType = self::contentTyp * * Transfer Asset * - * @param \Shotstack\Client\Model\Transfer $transfer Fetch an asset from a URL and send it to one or more destinations. (required) + * @param \ShotstackClient\Model\Transfer $transfer Fetch an asset from a URL and send it to one or more destinations. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['postServeAsset'] to see the possible values for this operation * - * @throws \Shotstack\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \ShotstackClient\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \Shotstack\Client\Model\TransferResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \ShotstackClient\Model\TransferResponse, HTTP status code, HTTP response headers (array of strings) */ public function postServeAssetWithHttpInfo($transfer, string $contentType = self::contentTypes['postServeAsset'][0]) { @@ -1069,11 +1069,11 @@ public function postServeAssetWithHttpInfo($transfer, string $contentType = self switch($statusCode) { case 200: - if ('\Shotstack\Client\Model\TransferResponse' === '\SplFileObject') { + if ('\ShotstackClient\Model\TransferResponse' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\Shotstack\Client\Model\TransferResponse' !== 'string') { + if ('\ShotstackClient\Model\TransferResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -1091,13 +1091,13 @@ public function postServeAssetWithHttpInfo($transfer, string $contentType = self } return [ - ObjectSerializer::deserialize($content, '\Shotstack\Client\Model\TransferResponse', []), + ObjectSerializer::deserialize($content, '\ShotstackClient\Model\TransferResponse', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\Shotstack\Client\Model\TransferResponse'; + $returnType = '\ShotstackClient\Model\TransferResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -1130,7 +1130,7 @@ public function postServeAssetWithHttpInfo($transfer, string $contentType = self case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Shotstack\Client\Model\TransferResponse', + '\ShotstackClient\Model\TransferResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -1145,7 +1145,7 @@ public function postServeAssetWithHttpInfo($transfer, string $contentType = self * * Transfer Asset * - * @param \Shotstack\Client\Model\Transfer $transfer Fetch an asset from a URL and send it to one or more destinations. (required) + * @param \ShotstackClient\Model\Transfer $transfer Fetch an asset from a URL and send it to one or more destinations. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['postServeAsset'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -1166,7 +1166,7 @@ function ($response) { * * Transfer Asset * - * @param \Shotstack\Client\Model\Transfer $transfer Fetch an asset from a URL and send it to one or more destinations. (required) + * @param \ShotstackClient\Model\Transfer $transfer Fetch an asset from a URL and send it to one or more destinations. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['postServeAsset'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -1174,7 +1174,7 @@ function ($response) { */ public function postServeAssetAsyncWithHttpInfo($transfer, string $contentType = self::contentTypes['postServeAsset'][0]) { - $returnType = '\Shotstack\Client\Model\TransferResponse'; + $returnType = '\ShotstackClient\Model\TransferResponse'; $request = $this->postServeAssetRequest($transfer, $contentType); return $this->client @@ -1216,7 +1216,7 @@ function ($exception) { /** * Create request for operation 'postServeAsset' * - * @param \Shotstack\Client\Model\Transfer $transfer Fetch an asset from a URL and send it to one or more destinations. (required) + * @param \ShotstackClient\Model\Transfer $transfer Fetch an asset from a URL and send it to one or more destinations. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['postServeAsset'] to see the possible values for this operation * * @throws \InvalidArgumentException diff --git a/src/ApiException.php b/src/ApiException.php index a5ced8e..e451917 100644 --- a/src/ApiException.php +++ b/src/ApiException.php @@ -4,7 +4,7 @@ * PHP version 7.4 * * @category Class - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech */ @@ -25,7 +25,7 @@ * Do not edit the class manually. */ -namespace Shotstack\Client; +namespace ShotstackClient; use \Exception; @@ -33,7 +33,7 @@ * ApiException Class Doc Comment * * @category Class - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech */ diff --git a/src/Configuration.php b/src/Configuration.php index fcb55f0..857c65f 100644 --- a/src/Configuration.php +++ b/src/Configuration.php @@ -4,7 +4,7 @@ * PHP version 7.4 * * @category Class - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech */ @@ -25,14 +25,14 @@ * Do not edit the class manually. */ -namespace Shotstack\Client; +namespace ShotstackClient; /** * Configuration Class Doc Comment * PHP version 7.4 * * @category Class - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech */ @@ -100,7 +100,7 @@ class Configuration * * @var string */ - protected $userAgent = 'OpenAPI-Generator/0.2.6/PHP'; + protected $userAgent = 'OpenAPI-Generator/1.10.3/PHP'; /** * Debug switch (default set to false) @@ -429,11 +429,11 @@ public static function setDefaultConfiguration(Configuration $config) */ public static function toDebugReport() { - $report = 'PHP SDK (Shotstack\Client) Debug Report:' . PHP_EOL; + $report = 'PHP SDK (ShotstackClient) Debug Report:' . PHP_EOL; $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: 0.2.6' . PHP_EOL; + $report .= ' SDK Package Version: 1.10.3' . PHP_EOL; $report .= ' Temp Folder Path: ' . self::getDefaultConfiguration()->getTempFolderPath() . PHP_EOL; return $report; @@ -513,20 +513,6 @@ public function getHostSettings() ] ] ] - ], - [ - "url" => "https://api.shotstack.io/create/{version}", - "description" => "No description provided", - "variables" => [ - "version" => [ - "description" => "Set the stage to **v1** for production usage. Set to **stage** to use the development sandbox.", - "default_value" => "v1", - "enum_values" => [ - "v1", - "stage" - ] - ] - ] ] ]; } diff --git a/src/HeaderSelector.php b/src/HeaderSelector.php index fe426ad..1e2d134 100644 --- a/src/HeaderSelector.php +++ b/src/HeaderSelector.php @@ -4,7 +4,7 @@ * PHP version 7.4 * * @category Class - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech */ @@ -25,13 +25,13 @@ * Do not edit the class manually. */ -namespace Shotstack\Client; +namespace ShotstackClient; /** * HeaderSelector Class Doc Comment * * @category Class - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech */ diff --git a/src/Model/Asset.php b/src/Model/Asset.php index 99803e0..f48ad56 100644 --- a/src/Model/Asset.php +++ b/src/Model/Asset.php @@ -5,7 +5,7 @@ * PHP version 7.4 * * @category Class - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech */ @@ -26,24 +26,24 @@ * Do not edit the class manually. */ -namespace Shotstack\Client\Model; +namespace ShotstackClient\Model; use \ArrayAccess; -use \Shotstack\Client\ObjectSerializer; +use \ShotstackClient\ObjectSerializer; /** * Asset Class Doc Comment * * @category Class - * @description The type of asset to display for the duration of the Clip. Value must be one of: <ul> <li><a href=\"#tocs_videoasset\">VideoAsset</a></li> <li><a href=\"#tocs_imageasset\">ImageAsset</a></li> <li><a href=\"#tocs_titleasset\">TitleAsset</a></li> <li><a href=\"#tocs_htmlasset\">HtmlAsset</a></li> <li><a href=\"#tocs_audioasset\">AudioAsset</a></li> <li><a href=\"#tocs_lumaasset\">LumaAsset</a></li> </ul> - * @package Shotstack\Client + * @description The type of asset to display for the duration of the Clip, i.e. a video clip or an image. Choose from one of the available asset types below. + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech * @implements \ArrayAccess */ class Asset implements ModelInterface, ArrayAccess, \JsonSerializable { - public const DISCRIMINATOR = 'asset'; + public const DISCRIMINATOR = 'type'; /** * The original name of the model. @@ -60,23 +60,46 @@ class Asset implements ModelInterface, ArrayAccess, \JsonSerializable protected static $openAPITypes = [ 'type' => 'string', 'src' => 'string', + 'transcode' => 'bool', 'trim' => 'float', - 'volume' => 'float', + 'volume' => '\ShotstackClient\Model\AudioAssetVolume', 'volume_effect' => 'string', 'speed' => 'float', - 'crop' => '\Shotstack\Client\Model\Crop', + 'crop' => '\ShotstackClient\Model\Crop', + 'chroma_key' => '\ShotstackClient\Model\ChromaKey', 'text' => 'string', - 'style' => 'string', - 'color' => 'string', - 'size' => 'string', + 'width' => 'int', + 'height' => 'int', + 'font' => '\ShotstackClient\Model\RichCaptionAssetFont', 'background' => 'string', - 'position' => 'string', - 'offset' => '\Shotstack\Client\Model\Offset', + 'alignment' => '\ShotstackClient\Model\TextAlignment', + 'stroke' => '\ShotstackClient\Model\ShapeAssetStroke', + 'animation' => '\ShotstackClient\Model\RichCaptionAnimation', + 'ellipsis' => 'string', + 'style' => 'string', + 'shadow' => '\ShotstackClient\Model\RichTextShadow', + 'border' => '\ShotstackClient\Model\Border', + 'padding' => '\ShotstackClient\Model\RichCaptionAssetPadding', + 'align' => '\ShotstackClient\Model\RichTextAlignment', + 'effect' => 'string', + 'margin' => '\ShotstackClient\Model\CaptionMargin', + 'active' => '\ShotstackClient\Model\RichCaptionActive', 'html' => 'string', 'css' => 'string', - 'width' => 'int', - 'height' => 'int', - 'effect' => 'string' + 'position' => 'string', + 'color' => 'string', + 'size' => 'string', + 'offset' => '\ShotstackClient\Model\Offset', + 'shape' => 'string', + 'fill' => '\ShotstackClient\Model\ShapeAssetFill', + 'rectangle' => '\ShotstackClient\Model\ShapeAssetRectangle', + 'circle' => '\ShotstackClient\Model\ShapeAssetCircle', + 'line' => '\ShotstackClient\Model\ShapeAssetLine', + 'prompt' => 'string', + 'aspect_ratio' => 'string', + 'voice' => 'string', + 'language' => 'string', + 'newscaster' => 'bool' ]; /** @@ -89,23 +112,46 @@ class Asset implements ModelInterface, ArrayAccess, \JsonSerializable protected static $openAPIFormats = [ 'type' => null, 'src' => null, + 'transcode' => null, 'trim' => null, 'volume' => null, 'volume_effect' => null, 'speed' => 'float', 'crop' => null, + 'chroma_key' => null, 'text' => null, + 'width' => null, + 'height' => null, + 'font' => null, + 'background' => null, + 'alignment' => null, + 'stroke' => null, + 'animation' => null, + 'ellipsis' => null, 'style' => null, + 'shadow' => null, + 'border' => null, + 'padding' => null, + 'align' => null, + 'effect' => null, + 'margin' => null, + 'active' => null, + 'html' => null, + 'css' => null, + 'position' => null, 'color' => null, 'size' => null, - 'background' => null, - 'position' => null, 'offset' => null, - 'html' => null, - 'css' => null, - 'width' => null, - 'height' => null, - 'effect' => null + 'shape' => null, + 'fill' => null, + 'rectangle' => null, + 'circle' => null, + 'line' => null, + 'prompt' => null, + 'aspect_ratio' => null, + 'voice' => null, + 'language' => null, + 'newscaster' => null ]; /** @@ -116,23 +162,46 @@ class Asset implements ModelInterface, ArrayAccess, \JsonSerializable protected static array $openAPINullables = [ 'type' => false, 'src' => false, + 'transcode' => false, 'trim' => false, 'volume' => false, 'volume_effect' => false, 'speed' => false, 'crop' => false, + 'chroma_key' => false, 'text' => false, + 'width' => false, + 'height' => false, + 'font' => false, + 'background' => false, + 'alignment' => false, + 'stroke' => false, + 'animation' => false, + 'ellipsis' => false, 'style' => false, + 'shadow' => false, + 'border' => false, + 'padding' => false, + 'align' => false, + 'effect' => false, + 'margin' => false, + 'active' => false, + 'html' => false, + 'css' => false, + 'position' => false, 'color' => false, 'size' => false, - 'background' => false, - 'position' => false, 'offset' => false, - 'html' => false, - 'css' => false, - 'width' => false, - 'height' => false, - 'effect' => false + 'shape' => false, + 'fill' => false, + 'rectangle' => false, + 'circle' => false, + 'line' => false, + 'prompt' => false, + 'aspect_ratio' => false, + 'voice' => false, + 'language' => false, + 'newscaster' => false ]; /** @@ -223,23 +292,46 @@ public function isNullableSetToNull(string $property): bool protected static $attributeMap = [ 'type' => 'type', 'src' => 'src', + 'transcode' => 'transcode', 'trim' => 'trim', 'volume' => 'volume', 'volume_effect' => 'volumeEffect', 'speed' => 'speed', 'crop' => 'crop', + 'chroma_key' => 'chromaKey', 'text' => 'text', + 'width' => 'width', + 'height' => 'height', + 'font' => 'font', + 'background' => 'background', + 'alignment' => 'alignment', + 'stroke' => 'stroke', + 'animation' => 'animation', + 'ellipsis' => 'ellipsis', 'style' => 'style', + 'shadow' => 'shadow', + 'border' => 'border', + 'padding' => 'padding', + 'align' => 'align', + 'effect' => 'effect', + 'margin' => 'margin', + 'active' => 'active', + 'html' => 'html', + 'css' => 'css', + 'position' => 'position', 'color' => 'color', 'size' => 'size', - 'background' => 'background', - 'position' => 'position', 'offset' => 'offset', - 'html' => 'html', - 'css' => 'css', - 'width' => 'width', - 'height' => 'height', - 'effect' => 'effect' + 'shape' => 'shape', + 'fill' => 'fill', + 'rectangle' => 'rectangle', + 'circle' => 'circle', + 'line' => 'line', + 'prompt' => 'prompt', + 'aspect_ratio' => 'aspectRatio', + 'voice' => 'voice', + 'language' => 'language', + 'newscaster' => 'newscaster' ]; /** @@ -250,23 +342,46 @@ public function isNullableSetToNull(string $property): bool protected static $setters = [ 'type' => 'setType', 'src' => 'setSrc', + 'transcode' => 'setTranscode', 'trim' => 'setTrim', 'volume' => 'setVolume', 'volume_effect' => 'setVolumeEffect', 'speed' => 'setSpeed', 'crop' => 'setCrop', + 'chroma_key' => 'setChromaKey', 'text' => 'setText', + 'width' => 'setWidth', + 'height' => 'setHeight', + 'font' => 'setFont', + 'background' => 'setBackground', + 'alignment' => 'setAlignment', + 'stroke' => 'setStroke', + 'animation' => 'setAnimation', + 'ellipsis' => 'setEllipsis', 'style' => 'setStyle', + 'shadow' => 'setShadow', + 'border' => 'setBorder', + 'padding' => 'setPadding', + 'align' => 'setAlign', + 'effect' => 'setEffect', + 'margin' => 'setMargin', + 'active' => 'setActive', + 'html' => 'setHtml', + 'css' => 'setCss', + 'position' => 'setPosition', 'color' => 'setColor', 'size' => 'setSize', - 'background' => 'setBackground', - 'position' => 'setPosition', 'offset' => 'setOffset', - 'html' => 'setHtml', - 'css' => 'setCss', - 'width' => 'setWidth', - 'height' => 'setHeight', - 'effect' => 'setEffect' + 'shape' => 'setShape', + 'fill' => 'setFill', + 'rectangle' => 'setRectangle', + 'circle' => 'setCircle', + 'line' => 'setLine', + 'prompt' => 'setPrompt', + 'aspect_ratio' => 'setAspectRatio', + 'voice' => 'setVoice', + 'language' => 'setLanguage', + 'newscaster' => 'setNewscaster' ]; /** @@ -277,23 +392,46 @@ public function isNullableSetToNull(string $property): bool protected static $getters = [ 'type' => 'getType', 'src' => 'getSrc', + 'transcode' => 'getTranscode', 'trim' => 'getTrim', 'volume' => 'getVolume', 'volume_effect' => 'getVolumeEffect', 'speed' => 'getSpeed', 'crop' => 'getCrop', + 'chroma_key' => 'getChromaKey', 'text' => 'getText', + 'width' => 'getWidth', + 'height' => 'getHeight', + 'font' => 'getFont', + 'background' => 'getBackground', + 'alignment' => 'getAlignment', + 'stroke' => 'getStroke', + 'animation' => 'getAnimation', + 'ellipsis' => 'getEllipsis', 'style' => 'getStyle', + 'shadow' => 'getShadow', + 'border' => 'getBorder', + 'padding' => 'getPadding', + 'align' => 'getAlign', + 'effect' => 'getEffect', + 'margin' => 'getMargin', + 'active' => 'getActive', + 'html' => 'getHtml', + 'css' => 'getCss', + 'position' => 'getPosition', 'color' => 'getColor', 'size' => 'getSize', - 'background' => 'getBackground', - 'position' => 'getPosition', 'offset' => 'getOffset', - 'html' => 'getHtml', - 'css' => 'getCss', - 'width' => 'getWidth', - 'height' => 'getHeight', - 'effect' => 'getEffect' + 'shape' => 'getShape', + 'fill' => 'getFill', + 'rectangle' => 'getRectangle', + 'circle' => 'getCircle', + 'line' => 'getLine', + 'prompt' => 'getPrompt', + 'aspect_ratio' => 'getAspectRatio', + 'voice' => 'getVoice', + 'language' => 'getLanguage', + 'newscaster' => 'getNewscaster' ]; /** @@ -337,6 +475,22 @@ public function getModelName() return self::$openAPIModelName; } + public const TYPE_VIDEO = 'video'; + public const TYPE_IMAGE = 'image'; + public const TYPE_TEXT = 'text'; + public const TYPE_RICH_TEXT = 'rich-text'; + public const TYPE_AUDIO = 'audio'; + public const TYPE_LUMA = 'luma'; + public const TYPE_CAPTION = 'caption'; + public const TYPE_RICH_CAPTION = 'rich-caption'; + public const TYPE_HTML = 'html'; + public const TYPE_TITLE = 'title'; + public const TYPE_SHAPE = 'shape'; + public const TYPE_SVG = 'svg'; + public const TYPE_TEXT_TO_IMAGE = 'text-to-image'; + public const TYPE_IMAGE_TO_VIDEO = 'image-to-video'; + public const TYPE_TEXT_TO_SPEECH = 'text-to-speech'; + public const VOLUME_EFFECT_NONE = 'none'; public const VOLUME_EFFECT_FADE_IN = 'fadeIn'; public const VOLUME_EFFECT_FADE_OUT = 'fadeOut'; public const VOLUME_EFFECT_FADE_IN_FADE_OUT = 'fadeInFadeOut'; @@ -350,13 +504,10 @@ public function getModelName() public const STYLE_MARKER = 'marker'; public const STYLE_FUTURE = 'future'; public const STYLE_SUBTITLE = 'subtitle'; - public const SIZE_XX_SMALL = 'xx-small'; - public const SIZE_X_SMALL = 'x-small'; - public const SIZE_SMALL = 'small'; - public const SIZE_MEDIUM = 'medium'; - public const SIZE_LARGE = 'large'; - public const SIZE_X_LARGE = 'x-large'; - public const SIZE_XX_LARGE = 'xx-large'; + public const EFFECT_NONE = 'none'; + public const EFFECT_FADE_IN = 'fadeIn'; + public const EFFECT_FADE_OUT = 'fadeOut'; + public const EFFECT_FADE_IN_FADE_OUT = 'fadeInFadeOut'; public const POSITION_TOP = 'top'; public const POSITION_TOP_RIGHT = 'topRight'; public const POSITION_RIGHT = 'right'; @@ -366,9 +517,49 @@ public function getModelName() public const POSITION_LEFT = 'left'; public const POSITION_TOP_LEFT = 'topLeft'; public const POSITION_CENTER = 'center'; - public const EFFECT_FADE_IN = 'fadeIn'; - public const EFFECT_FADE_OUT = 'fadeOut'; - public const EFFECT_FADE_IN_FADE_OUT = 'fadeInFadeOut'; + public const SIZE_XX_SMALL = 'xx-small'; + public const SIZE_X_SMALL = 'x-small'; + public const SIZE_SMALL = 'small'; + public const SIZE_MEDIUM = 'medium'; + public const SIZE_LARGE = 'large'; + public const SIZE_X_LARGE = 'x-large'; + public const SIZE_XX_LARGE = 'xx-large'; + public const SHAPE_RECTANGLE = 'rectangle'; + public const SHAPE_CIRCLE = 'circle'; + public const SHAPE_LINE = 'line'; + public const ASPECT_RATIO__11 = '1:1'; + public const ASPECT_RATIO__43 = '4:3'; + public const ASPECT_RATIO__169 = '16:9'; + public const ASPECT_RATIO__916 = '9:16'; + public const ASPECT_RATIO__34 = '3:4'; + public const ASPECT_RATIO__219 = '21:9'; + public const ASPECT_RATIO__921 = '9:21'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_VIDEO, + self::TYPE_IMAGE, + self::TYPE_TEXT, + self::TYPE_RICH_TEXT, + self::TYPE_AUDIO, + self::TYPE_LUMA, + self::TYPE_CAPTION, + self::TYPE_RICH_CAPTION, + self::TYPE_HTML, + self::TYPE_TITLE, + self::TYPE_SHAPE, + self::TYPE_SVG, + self::TYPE_TEXT_TO_IMAGE, + self::TYPE_IMAGE_TO_VIDEO, + self::TYPE_TEXT_TO_SPEECH, + ]; + } /** * Gets allowable values of the enum @@ -378,6 +569,7 @@ public function getModelName() public function getVolumeEffectAllowableValues() { return [ + self::VOLUME_EFFECT_NONE, self::VOLUME_EFFECT_FADE_IN, self::VOLUME_EFFECT_FADE_OUT, self::VOLUME_EFFECT_FADE_IN_FADE_OUT, @@ -410,16 +602,13 @@ public function getStyleAllowableValues() * * @return string[] */ - public function getSizeAllowableValues() + public function getEffectAllowableValues() { return [ - self::SIZE_XX_SMALL, - self::SIZE_X_SMALL, - self::SIZE_SMALL, - self::SIZE_MEDIUM, - self::SIZE_LARGE, - self::SIZE_X_LARGE, - self::SIZE_XX_LARGE, + self::EFFECT_NONE, + self::EFFECT_FADE_IN, + self::EFFECT_FADE_OUT, + self::EFFECT_FADE_IN_FADE_OUT, ]; } @@ -448,12 +637,48 @@ public function getPositionAllowableValues() * * @return string[] */ - public function getEffectAllowableValues() + public function getSizeAllowableValues() { return [ - self::EFFECT_FADE_IN, - self::EFFECT_FADE_OUT, - self::EFFECT_FADE_IN_FADE_OUT, + self::SIZE_XX_SMALL, + self::SIZE_X_SMALL, + self::SIZE_SMALL, + self::SIZE_MEDIUM, + self::SIZE_LARGE, + self::SIZE_X_LARGE, + self::SIZE_XX_LARGE, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getShapeAllowableValues() + { + return [ + self::SHAPE_RECTANGLE, + self::SHAPE_CIRCLE, + self::SHAPE_LINE, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getAspectRatioAllowableValues() + { + return [ + self::ASPECT_RATIO__11, + self::ASPECT_RATIO__43, + self::ASPECT_RATIO__169, + self::ASPECT_RATIO__916, + self::ASPECT_RATIO__34, + self::ASPECT_RATIO__219, + self::ASPECT_RATIO__921, ]; } @@ -472,28 +697,51 @@ public function getEffectAllowableValues() */ public function __construct(array $data = null) { - $this->setIfExists('type', $data ?? [], 'luma'); + $this->setIfExists('type', $data ?? [], 'video'); $this->setIfExists('src', $data ?? [], null); + $this->setIfExists('transcode', $data ?? [], null); $this->setIfExists('trim', $data ?? [], null); $this->setIfExists('volume', $data ?? [], null); $this->setIfExists('volume_effect', $data ?? [], null); $this->setIfExists('speed', $data ?? [], null); $this->setIfExists('crop', $data ?? [], null); + $this->setIfExists('chroma_key', $data ?? [], null); $this->setIfExists('text', $data ?? [], null); + $this->setIfExists('width', $data ?? [], null); + $this->setIfExists('height', $data ?? [], null); + $this->setIfExists('font', $data ?? [], null); + $this->setIfExists('background', $data ?? [], null); + $this->setIfExists('alignment', $data ?? [], null); + $this->setIfExists('stroke', $data ?? [], null); + $this->setIfExists('animation', $data ?? [], null); + $this->setIfExists('ellipsis', $data ?? [], null); $this->setIfExists('style', $data ?? [], null); + $this->setIfExists('shadow', $data ?? [], null); + $this->setIfExists('border', $data ?? [], null); + $this->setIfExists('padding', $data ?? [], null); + $this->setIfExists('align', $data ?? [], null); + $this->setIfExists('effect', $data ?? [], null); + $this->setIfExists('margin', $data ?? [], null); + $this->setIfExists('active', $data ?? [], null); + $this->setIfExists('html', $data ?? [], null); + $this->setIfExists('css', $data ?? [], null); + $this->setIfExists('position', $data ?? [], null); $this->setIfExists('color', $data ?? [], null); $this->setIfExists('size', $data ?? [], null); - $this->setIfExists('background', $data ?? [], null); - $this->setIfExists('position', $data ?? [], null); $this->setIfExists('offset', $data ?? [], null); - $this->setIfExists('html', $data ?? [], null); - $this->setIfExists('css', $data ?? [], null); - $this->setIfExists('width', $data ?? [], null); - $this->setIfExists('height', $data ?? [], null); - $this->setIfExists('effect', $data ?? [], null); + $this->setIfExists('shape', $data ?? [], null); + $this->setIfExists('fill', $data ?? [], null); + $this->setIfExists('rectangle', $data ?? [], null); + $this->setIfExists('circle', $data ?? [], null); + $this->setIfExists('line', $data ?? [], null); + $this->setIfExists('prompt', $data ?? [], null); + $this->setIfExists('aspect_ratio', $data ?? [], null); + $this->setIfExists('voice', $data ?? [], null); + $this->setIfExists('language', $data ?? [], null); + $this->setIfExists('newscaster', $data ?? [], false); // Initialize discriminator property with the model name. - $this->container['asset'] = static::$openAPIModelName; + $this->container['type'] = static::$openAPIModelName; } /** @@ -526,9 +774,22 @@ public function listInvalidProperties() if ($this->container['type'] === null) { $invalidProperties[] = "'type' can't be null"; } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + if ($this->container['src'] === null) { $invalidProperties[] = "'src' can't be null"; } + if ((mb_strlen($this->container['src']) < 1)) { + $invalidProperties[] = "invalid value for 'src', the character length must be bigger than or equal to 1."; + } + $allowedValues = $this->getVolumeEffectAllowableValues(); if (!is_null($this->container['volume_effect']) && !in_array($this->container['volume_effect'], $allowedValues, true)) { $invalidProperties[] = sprintf( @@ -558,15 +819,18 @@ public function listInvalidProperties() ); } - $allowedValues = $this->getSizeAllowableValues(); - if (!is_null($this->container['size']) && !in_array($this->container['size'], $allowedValues, true)) { + $allowedValues = $this->getEffectAllowableValues(); + if (!is_null($this->container['effect']) && !in_array($this->container['effect'], $allowedValues, true)) { $invalidProperties[] = sprintf( - "invalid value '%s' for 'size', must be one of '%s'", - $this->container['size'], + "invalid value '%s' for 'effect', must be one of '%s'", + $this->container['effect'], implode("', '", $allowedValues) ); } + if ($this->container['html'] === null) { + $invalidProperties[] = "'html' can't be null"; + } $allowedValues = $this->getPositionAllowableValues(); if (!is_null($this->container['position']) && !in_array($this->container['position'], $allowedValues, true)) { $invalidProperties[] = sprintf( @@ -576,18 +840,42 @@ public function listInvalidProperties() ); } - if ($this->container['html'] === null) { - $invalidProperties[] = "'html' can't be null"; + $allowedValues = $this->getSizeAllowableValues(); + if (!is_null($this->container['size']) && !in_array($this->container['size'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'size', must be one of '%s'", + $this->container['size'], + implode("', '", $allowedValues) + ); } - $allowedValues = $this->getEffectAllowableValues(); - if (!is_null($this->container['effect']) && !in_array($this->container['effect'], $allowedValues, true)) { + + if ($this->container['shape'] === null) { + $invalidProperties[] = "'shape' can't be null"; + } + $allowedValues = $this->getShapeAllowableValues(); + if (!is_null($this->container['shape']) && !in_array($this->container['shape'], $allowedValues, true)) { $invalidProperties[] = sprintf( - "invalid value '%s' for 'effect', must be one of '%s'", - $this->container['effect'], + "invalid value '%s' for 'shape', must be one of '%s'", + $this->container['shape'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['prompt'] === null) { + $invalidProperties[] = "'prompt' can't be null"; + } + $allowedValues = $this->getAspectRatioAllowableValues(); + if (!is_null($this->container['aspect_ratio']) && !in_array($this->container['aspect_ratio'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'aspect_ratio', must be one of '%s'", + $this->container['aspect_ratio'], implode("', '", $allowedValues) ); } + if ($this->container['voice'] === null) { + $invalidProperties[] = "'voice' can't be null"; + } return $invalidProperties; } @@ -616,7 +904,7 @@ public function getType() /** * Sets type * - * @param string $type The type of asset - set to `luma` for luma mattes. + * @param string $type The type of asset - set to `video` for videos. * * @return self */ @@ -625,6 +913,16 @@ public function setType($type) if (is_null($type)) { throw new \InvalidArgumentException('non-nullable type cannot be null'); } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } $this->container['type'] = $type; return $this; @@ -643,7 +941,7 @@ public function getSrc() /** * Sets src * - * @param string $src The luma matte source URL. The URL must be publicly accessible or include credentials. + * @param string $src The image source URL. The URL must be publicly accessible or include credentials. * * @return self */ @@ -652,11 +950,43 @@ public function setSrc($src) if (is_null($src)) { throw new \InvalidArgumentException('non-nullable src cannot be null'); } + + if ((mb_strlen($src) < 1)) { + throw new \InvalidArgumentException('invalid length for $src when calling Asset., must be bigger than or equal to 1.'); + } + $this->container['src'] = $src; return $this; } + /** + * Gets transcode + * + * @return bool|null + */ + public function getTranscode() + { + return $this->container['transcode']; + } + + /** + * Sets transcode + * + * @param bool|null $transcode Set to `true` to force re-encoding of the video during preprocessing. This can help resolve compatibility issues, fix rotation problems, synchronize audio, or convert formats. The video will be processed to ensure optimal compatibility with the rendering engine. + * + * @return self + */ + public function setTranscode($transcode) + { + if (is_null($transcode)) { + throw new \InvalidArgumentException('non-nullable transcode cannot be null'); + } + $this->container['transcode'] = $transcode; + + return $this; + } + /** * Gets trim * @@ -670,7 +1000,7 @@ public function getTrim() /** * Sets trim * - * @param float|null $trim The start trim point of the luma matte clip, in seconds (defaults to 0). Videos will start from the in trim point. A luma matte video will play until the file ends or the Clip length is reached. + * @param float|null $trim The start trim point of the audio clip, in seconds (defaults to 0). Audio will start from the trim point. The audio will play until the file ends or the Clip length is reached. * * @return self */ @@ -687,7 +1017,7 @@ public function setTrim($trim) /** * Gets volume * - * @return float|null + * @return \ShotstackClient\Model\AudioAssetVolume|null */ public function getVolume() { @@ -697,7 +1027,7 @@ public function getVolume() /** * Sets volume * - * @param float|null $volume Set the volume for the audio clip between 0 and 1 where 0 is muted and 1 is full volume (defaults to 1). + * @param \ShotstackClient\Model\AudioAssetVolume|null $volume volume * * @return self */ @@ -724,7 +1054,7 @@ public function getVolumeEffect() /** * Sets volume_effect * - * @param string|null $volume_effect The volume effect to apply to the video asset + * @param string|null $volume_effect Preset volume effects to apply to the video asset * * @return self */ @@ -761,7 +1091,7 @@ public function getSpeed() /** * Sets speed * - * @param float|null $speed Adjust the playback speed of the audio clip between 0 (paused) and 10 (10x normal speed), where 1 is normal speed (defaults to 1). Adjusting the speed will also adjust the duration of the clip and may require you to adjust the Clip length. For example, if you set speed to 0.5, the clip will need to be 2x as long to play the entire audio (i.e. original length / 0.5). If you set speed to 2, the clip will need to be half as long to play the entire audio (i.e. original length / 2). + * @param float|null $speed Adjust the playback speed of the audio clip between 0 (paused) and 10 (10x normal speed), where 1 is normal speed (defaults to 1). Adjusting the speed will also adjust the duration of the clip and may require you to adjust the Clip length. * * @return self */ @@ -786,7 +1116,7 @@ public function setSpeed($speed) /** * Gets crop * - * @return \Shotstack\Client\Model\Crop|null + * @return \ShotstackClient\Model\Crop|null */ public function getCrop() { @@ -796,7 +1126,7 @@ public function getCrop() /** * Sets crop * - * @param \Shotstack\Client\Model\Crop|null $crop crop + * @param \ShotstackClient\Model\Crop|null $crop crop * * @return self */ @@ -810,6 +1140,33 @@ public function setCrop($crop) return $this; } + /** + * Gets chroma_key + * + * @return \ShotstackClient\Model\ChromaKey|null + */ + public function getChromaKey() + { + return $this->container['chroma_key']; + } + + /** + * Sets chroma_key + * + * @param \ShotstackClient\Model\ChromaKey|null $chroma_key chroma_key + * + * @return self + */ + public function setChromaKey($chroma_key) + { + if (is_null($chroma_key)) { + throw new \InvalidArgumentException('non-nullable chroma_key cannot be null'); + } + $this->container['chroma_key'] = $chroma_key; + + return $this; + } + /** * Gets text * @@ -823,7 +1180,7 @@ public function getText() /** * Sets text * - * @param string $text The title text string - i.e. \"My Title\". + * @param string $text The text to convert to speech. * * @return self */ @@ -838,38 +1195,544 @@ public function setText($text) } /** - * Gets style + * Gets width * - * @return string|null + * @return int|null */ - public function getStyle() + public function getWidth() { - return $this->container['style']; + return $this->container['width']; } /** - * Sets style + * Sets width * - * @param string|null $style Uses a preset to apply font properties and styling to the title. + * @param int|null $width The width of the image in pixels. * * @return self */ - public function setStyle($style) + public function setWidth($width) + { + if (is_null($width)) { + throw new \InvalidArgumentException('non-nullable width cannot be null'); + } + $this->container['width'] = $width; + + return $this; + } + + /** + * Gets height + * + * @return int|null + */ + public function getHeight() + { + return $this->container['height']; + } + + /** + * Sets height + * + * @param int|null $height The height of the image 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 font + * + * @return \ShotstackClient\Model\RichCaptionAssetFont|null + */ + public function getFont() + { + return $this->container['font']; + } + + /** + * Sets font + * + * @param \ShotstackClient\Model\RichCaptionAssetFont|null $font font + * + * @return self + */ + public function setFont($font) + { + if (is_null($font)) { + throw new \InvalidArgumentException('non-nullable font cannot be null'); + } + $this->container['font'] = $font; + + return $this; + } + + /** + * Gets background + * + * @return string|null + */ + public function getBackground() + { + return $this->container['background']; + } + + /** + * Sets background + * + * @param string|null $background Apply a background color behind the text. Set the text color using hexadecimal color notation. Transparency is supported by setting the first two characters of the hex string (opposite to HTML), i.e. #80ffffff will be white with 50% transparency. Omit to use transparent background. + * + * @return self + */ + public function setBackground($background) + { + if (is_null($background)) { + throw new \InvalidArgumentException('non-nullable background cannot be null'); + } + $this->container['background'] = $background; + + return $this; + } + + /** + * Gets alignment + * + * @return \ShotstackClient\Model\TextAlignment|null + */ + public function getAlignment() + { + return $this->container['alignment']; + } + + /** + * Sets alignment + * + * @param \ShotstackClient\Model\TextAlignment|null $alignment alignment + * + * @return self + */ + public function setAlignment($alignment) + { + if (is_null($alignment)) { + throw new \InvalidArgumentException('non-nullable alignment cannot be null'); + } + $this->container['alignment'] = $alignment; + + return $this; + } + + /** + * Gets stroke + * + * @return \ShotstackClient\Model\ShapeAssetStroke|null + */ + public function getStroke() + { + return $this->container['stroke']; + } + + /** + * Sets stroke + * + * @param \ShotstackClient\Model\ShapeAssetStroke|null $stroke stroke + * + * @return self + */ + public function setStroke($stroke) + { + if (is_null($stroke)) { + throw new \InvalidArgumentException('non-nullable stroke cannot be null'); + } + $this->container['stroke'] = $stroke; + + return $this; + } + + /** + * Gets animation + * + * @return \ShotstackClient\Model\RichCaptionAnimation|null + */ + public function getAnimation() + { + return $this->container['animation']; + } + + /** + * Sets animation + * + * @param \ShotstackClient\Model\RichCaptionAnimation|null $animation animation + * + * @return self + */ + public function setAnimation($animation) + { + if (is_null($animation)) { + throw new \InvalidArgumentException('non-nullable animation cannot be null'); + } + $this->container['animation'] = $animation; + + return $this; + } + + /** + * Gets ellipsis + * + * @return string|null + */ + public function getEllipsis() + { + return $this->container['ellipsis']; + } + + /** + * Sets ellipsis + * + * @param string|null $ellipsis The string to display when text overflows its bounding box. Set to an ellipsis character or custom string to indicate truncated text. + * + * @return self + */ + public function setEllipsis($ellipsis) + { + if (is_null($ellipsis)) { + throw new \InvalidArgumentException('non-nullable ellipsis cannot be null'); + } + $this->container['ellipsis'] = $ellipsis; + + return $this; + } + + /** + * Gets style + * + * @return string|null + */ + public function getStyle() + { + return $this->container['style']; + } + + /** + * Sets style + * + * @param string|null $style Uses a preset to apply font properties and styling to the title. + * + * @return self + */ + public function setStyle($style) + { + if (is_null($style)) { + throw new \InvalidArgumentException('non-nullable style cannot be null'); + } + $allowedValues = $this->getStyleAllowableValues(); + if (!in_array($style, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'style', must be one of '%s'", + $style, + implode("', '", $allowedValues) + ) + ); + } + $this->container['style'] = $style; + + return $this; + } + + /** + * Gets shadow + * + * @return \ShotstackClient\Model\RichTextShadow|null + */ + public function getShadow() + { + return $this->container['shadow']; + } + + /** + * Sets shadow + * + * @param \ShotstackClient\Model\RichTextShadow|null $shadow shadow + * + * @return self + */ + public function setShadow($shadow) + { + if (is_null($shadow)) { + throw new \InvalidArgumentException('non-nullable shadow cannot be null'); + } + $this->container['shadow'] = $shadow; + + return $this; + } + + /** + * Gets border + * + * @return \ShotstackClient\Model\Border|null + */ + public function getBorder() + { + return $this->container['border']; + } + + /** + * Sets border + * + * @param \ShotstackClient\Model\Border|null $border border + * + * @return self + */ + public function setBorder($border) + { + if (is_null($border)) { + throw new \InvalidArgumentException('non-nullable border cannot be null'); + } + $this->container['border'] = $border; + + return $this; + } + + /** + * Gets padding + * + * @return \ShotstackClient\Model\RichCaptionAssetPadding|null + */ + public function getPadding() + { + return $this->container['padding']; + } + + /** + * Sets padding + * + * @param \ShotstackClient\Model\RichCaptionAssetPadding|null $padding padding + * + * @return self + */ + public function setPadding($padding) + { + if (is_null($padding)) { + throw new \InvalidArgumentException('non-nullable padding cannot be null'); + } + $this->container['padding'] = $padding; + + return $this; + } + + /** + * Gets align + * + * @return \ShotstackClient\Model\RichTextAlignment|null + */ + public function getAlign() + { + return $this->container['align']; + } + + /** + * Sets align + * + * @param \ShotstackClient\Model\RichTextAlignment|null $align align + * + * @return self + */ + public function setAlign($align) + { + if (is_null($align)) { + throw new \InvalidArgumentException('non-nullable align cannot be null'); + } + $this->container['align'] = $align; + + return $this; + } + + /** + * Gets effect + * + * @return string|null + */ + public function getEffect() + { + return $this->container['effect']; + } + + /** + * Sets effect + * + * @param string|null $effect The effect to apply to the audio asset + * + * @return self + */ + public function setEffect($effect) + { + if (is_null($effect)) { + throw new \InvalidArgumentException('non-nullable effect cannot be null'); + } + $allowedValues = $this->getEffectAllowableValues(); + if (!in_array($effect, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'effect', must be one of '%s'", + $effect, + implode("', '", $allowedValues) + ) + ); + } + $this->container['effect'] = $effect; + + return $this; + } + + /** + * Gets margin + * + * @return \ShotstackClient\Model\CaptionMargin|null + */ + public function getMargin() + { + return $this->container['margin']; + } + + /** + * Sets margin + * + * @param \ShotstackClient\Model\CaptionMargin|null $margin margin + * + * @return self + */ + public function setMargin($margin) { - if (is_null($style)) { - throw new \InvalidArgumentException('non-nullable style cannot be null'); + if (is_null($margin)) { + throw new \InvalidArgumentException('non-nullable margin cannot be null'); } - $allowedValues = $this->getStyleAllowableValues(); - if (!in_array($style, $allowedValues, true)) { + $this->container['margin'] = $margin; + + return $this; + } + + /** + * Gets active + * + * @return \ShotstackClient\Model\RichCaptionActive|null + */ + public function getActive() + { + return $this->container['active']; + } + + /** + * Sets active + * + * @param \ShotstackClient\Model\RichCaptionActive|null $active active + * + * @return self + */ + public function setActive($active) + { + if (is_null($active)) { + throw new \InvalidArgumentException('non-nullable active cannot be null'); + } + $this->container['active'] = $active; + + return $this; + } + + /** + * Gets html + * + * @return string + */ + public function getHtml() + { + return $this->container['html']; + } + + /** + * Sets html + * + * @param string $html The HTML text string. See list of [supported HTML tags](https://shotstack.io/docs/guide/architecting-an-application/html-support/#supported-html-tags). + * + * @return self + */ + public function setHtml($html) + { + if (is_null($html)) { + throw new \InvalidArgumentException('non-nullable html cannot be null'); + } + $this->container['html'] = $html; + + return $this; + } + + /** + * Gets css + * + * @return string|null + */ + public function getCss() + { + return $this->container['css']; + } + + /** + * Sets css + * + * @param string|null $css The CSS text string to apply styling to the HTML. See list of [support CSS properties](https://shotstack.io/docs/guide/architecting-an-application/html-support/#supported-css-properties). + * + * @return self + */ + public function setCss($css) + { + if (is_null($css)) { + throw new \InvalidArgumentException('non-nullable css cannot be null'); + } + $this->container['css'] = $css; + + return $this; + } + + /** + * Gets position + * + * @return string|null + */ + public function getPosition() + { + return $this->container['position']; + } + + /** + * Sets position + * + * @param string|null $position Place the title in one of nine predefined positions of the viewport. + * + * @return self + */ + public function setPosition($position) + { + if (is_null($position)) { + throw new \InvalidArgumentException('non-nullable position cannot be null'); + } + $allowedValues = $this->getPositionAllowableValues(); + if (!in_array($position, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( - "Invalid value '%s' for 'style', must be one of '%s'", - $style, + "Invalid value '%s' for 'position', must be one of '%s'", + $position, implode("', '", $allowedValues) ) ); } - $this->container['style'] = $style; + $this->container['position'] = $position; return $this; } @@ -939,237 +1802,318 @@ public function setSize($size) } /** - * Gets background + * Gets offset * - * @return string|null + * @return \ShotstackClient\Model\Offset|null */ - public function getBackground() + public function getOffset() { - return $this->container['background']; + return $this->container['offset']; } /** - * Sets background + * Sets offset * - * @param string|null $background Apply a background color behind the HTML bounding box using. Set the text color using hexadecimal color notation. Transparency is supported by setting the first two characters of the hex string (opposite to HTML), i.e. #80ffffff will be white with 50% transparency. + * @param \ShotstackClient\Model\Offset|null $offset offset * * @return self */ - public function setBackground($background) + public function setOffset($offset) { - if (is_null($background)) { - throw new \InvalidArgumentException('non-nullable background cannot be null'); + if (is_null($offset)) { + throw new \InvalidArgumentException('non-nullable offset cannot be null'); } - $this->container['background'] = $background; + $this->container['offset'] = $offset; return $this; } /** - * Gets position + * Gets shape * - * @return string|null + * @return string */ - public function getPosition() + public function getShape() { - return $this->container['position']; + return $this->container['shape']; } /** - * Sets position + * Sets shape * - * @param string|null $position Place the HTML in one of nine predefined positions within the HTML area. + * @param string $shape The shape to display. * * @return self */ - public function setPosition($position) + public function setShape($shape) { - if (is_null($position)) { - throw new \InvalidArgumentException('non-nullable position cannot be null'); + if (is_null($shape)) { + throw new \InvalidArgumentException('non-nullable shape cannot be null'); } - $allowedValues = $this->getPositionAllowableValues(); - if (!in_array($position, $allowedValues, true)) { + $allowedValues = $this->getShapeAllowableValues(); + if (!in_array($shape, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( - "Invalid value '%s' for 'position', must be one of '%s'", - $position, + "Invalid value '%s' for 'shape', must be one of '%s'", + $shape, implode("', '", $allowedValues) ) ); } - $this->container['position'] = $position; + $this->container['shape'] = $shape; return $this; } /** - * Gets offset + * Gets fill * - * @return \Shotstack\Client\Model\Offset|null + * @return \ShotstackClient\Model\ShapeAssetFill|null */ - public function getOffset() + public function getFill() { - return $this->container['offset']; + return $this->container['fill']; } /** - * Sets offset + * Sets fill * - * @param \Shotstack\Client\Model\Offset|null $offset offset + * @param \ShotstackClient\Model\ShapeAssetFill|null $fill fill * * @return self */ - public function setOffset($offset) + public function setFill($fill) { - if (is_null($offset)) { - throw new \InvalidArgumentException('non-nullable offset cannot be null'); + if (is_null($fill)) { + throw new \InvalidArgumentException('non-nullable fill cannot be null'); } - $this->container['offset'] = $offset; + $this->container['fill'] = $fill; return $this; } /** - * Gets html + * Gets rectangle * - * @return string + * @return \ShotstackClient\Model\ShapeAssetRectangle|null */ - public function getHtml() + public function getRectangle() { - return $this->container['html']; + return $this->container['rectangle']; } /** - * Sets html + * Sets rectangle * - * @param string $html The HTML text string. See list of [supported HTML tags](https://shotstack.io/docs/guide/architecting-an-application/html-support/#supported-html-tags). + * @param \ShotstackClient\Model\ShapeAssetRectangle|null $rectangle rectangle * * @return self */ - public function setHtml($html) + public function setRectangle($rectangle) { - if (is_null($html)) { - throw new \InvalidArgumentException('non-nullable html cannot be null'); + if (is_null($rectangle)) { + throw new \InvalidArgumentException('non-nullable rectangle cannot be null'); } - $this->container['html'] = $html; + $this->container['rectangle'] = $rectangle; return $this; } /** - * Gets css + * Gets circle * - * @return string|null + * @return \ShotstackClient\Model\ShapeAssetCircle|null */ - public function getCss() + public function getCircle() { - return $this->container['css']; + return $this->container['circle']; } /** - * Sets css + * Sets circle * - * @param string|null $css The CSS text string to apply styling to the HTML. See list of [support CSS properties](https://shotstack.io/docs/guide/architecting-an-application/html-support/#supported-css-properties). + * @param \ShotstackClient\Model\ShapeAssetCircle|null $circle circle * * @return self */ - public function setCss($css) + public function setCircle($circle) { - if (is_null($css)) { - throw new \InvalidArgumentException('non-nullable css cannot be null'); + if (is_null($circle)) { + throw new \InvalidArgumentException('non-nullable circle cannot be null'); } - $this->container['css'] = $css; + $this->container['circle'] = $circle; return $this; } /** - * Gets width + * Gets line * - * @return int|null + * @return \ShotstackClient\Model\ShapeAssetLine|null */ - public function getWidth() + public function getLine() { - return $this->container['width']; + return $this->container['line']; } /** - * Sets width + * Sets line * - * @param int|null $width Set the width of the HTML asset bounding box in pixels. Text will wrap to fill the bounding box. + * @param \ShotstackClient\Model\ShapeAssetLine|null $line line * * @return self */ - public function setWidth($width) + public function setLine($line) { - if (is_null($width)) { - throw new \InvalidArgumentException('non-nullable width cannot be null'); + if (is_null($line)) { + throw new \InvalidArgumentException('non-nullable line cannot be null'); } - $this->container['width'] = $width; + $this->container['line'] = $line; return $this; } /** - * Gets height + * Gets prompt * - * @return int|null + * @return string */ - public function getHeight() + public function getPrompt() { - return $this->container['height']; + return $this->container['prompt']; } /** - * Sets height + * Sets prompt * - * @param int|null $height Set the width of the HTML asset bounding box in pixels. Text and elements will be masked if they exceed the height of the bounding box. + * @param string $prompt The instructions for modifying the image into a video sequence. * * @return self */ - public function setHeight($height) + public function setPrompt($prompt) { - if (is_null($height)) { - throw new \InvalidArgumentException('non-nullable height cannot be null'); + if (is_null($prompt)) { + throw new \InvalidArgumentException('non-nullable prompt cannot be null'); } - $this->container['height'] = $height; + $this->container['prompt'] = $prompt; return $this; } /** - * Gets effect + * Gets aspect_ratio * * @return string|null */ - public function getEffect() + public function getAspectRatio() { - return $this->container['effect']; + return $this->container['aspect_ratio']; } /** - * Sets effect + * Sets aspect_ratio * - * @param string|null $effect The effect to apply to the audio asset + * @param string|null $aspect_ratio The aspect ratio (shape) of the video output. * * @return self */ - public function setEffect($effect) + public function setAspectRatio($aspect_ratio) { - if (is_null($effect)) { - throw new \InvalidArgumentException('non-nullable effect cannot be null'); + if (is_null($aspect_ratio)) { + throw new \InvalidArgumentException('non-nullable aspect_ratio cannot be null'); } - $allowedValues = $this->getEffectAllowableValues(); - if (!in_array($effect, $allowedValues, true)) { + $allowedValues = $this->getAspectRatioAllowableValues(); + if (!in_array($aspect_ratio, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( - "Invalid value '%s' for 'effect', must be one of '%s'", - $effect, + "Invalid value '%s' for 'aspect_ratio', must be one of '%s'", + $aspect_ratio, implode("', '", $allowedValues) ) ); } - $this->container['effect'] = $effect; + $this->container['aspect_ratio'] = $aspect_ratio; + + return $this; + } + + /** + * Gets voice + * + * @return string + */ + public function getVoice() + { + return $this->container['voice']; + } + + /** + * Sets voice + * + * @param string $voice The voice to use for the text-to-speech conversion. + * + * @return self + */ + public function setVoice($voice) + { + if (is_null($voice)) { + throw new \InvalidArgumentException('non-nullable voice cannot be null'); + } + $this->container['voice'] = $voice; + + return $this; + } + + /** + * Gets language + * + * @return string|null + */ + public function getLanguage() + { + return $this->container['language']; + } + + /** + * Sets language + * + * @param string|null $language The language code for the text-to-speech conversion. + * + * @return self + */ + public function setLanguage($language) + { + if (is_null($language)) { + throw new \InvalidArgumentException('non-nullable language cannot be null'); + } + $this->container['language'] = $language; + + return $this; + } + + /** + * Gets newscaster + * + * @return bool|null + */ + public function getNewscaster() + { + return $this->container['newscaster']; + } + + /** + * Sets newscaster + * + * @param bool|null $newscaster Set the voice to newscaster mode. + * + * @return self + */ + public function setNewscaster($newscaster) + { + if (is_null($newscaster)) { + throw new \InvalidArgumentException('non-nullable newscaster cannot be null'); + } + $this->container['newscaster'] = $newscaster; return $this; } diff --git a/src/Model/AssetRenderResponse.php b/src/Model/AssetRenderResponse.php index 52284f1..baf2792 100644 --- a/src/Model/AssetRenderResponse.php +++ b/src/Model/AssetRenderResponse.php @@ -5,7 +5,7 @@ * PHP version 7.4 * * @category Class - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech */ @@ -26,17 +26,17 @@ * Do not edit the class manually. */ -namespace Shotstack\Client\Model; +namespace ShotstackClient\Model; use \ArrayAccess; -use \Shotstack\Client\ObjectSerializer; +use \ShotstackClient\ObjectSerializer; /** * AssetRenderResponse Class Doc Comment * * @category Class * @description The response returned by the Serve API [get asset by render id](#get-asset-by-render-id) request. The response is an array of asset resources, including video, image, audio, thumbnail and poster image. The response follows the [json:api](https://jsonapi.org/) specification. - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech * @implements \ArrayAccess @@ -58,7 +58,7 @@ class AssetRenderResponse implements ModelInterface, ArrayAccess, \JsonSerializa * @var string[] */ protected static $openAPITypes = [ - 'data' => '\Shotstack\Client\Model\AssetResponseData[]' + 'data' => '\ShotstackClient\Model\AssetResponseData[]' ]; /** @@ -296,7 +296,7 @@ public function valid() /** * Gets data * - * @return \Shotstack\Client\Model\AssetResponseData[] + * @return \ShotstackClient\Model\AssetResponseData[] */ public function getData() { @@ -306,7 +306,7 @@ public function getData() /** * Sets data * - * @param \Shotstack\Client\Model\AssetResponseData[] $data An array of asset resources grouped by render id. + * @param \ShotstackClient\Model\AssetResponseData[] $data An array of asset resources grouped by render id. * * @return self */ diff --git a/src/Model/AssetResponse.php b/src/Model/AssetResponse.php index 4797554..5062857 100644 --- a/src/Model/AssetResponse.php +++ b/src/Model/AssetResponse.php @@ -5,7 +5,7 @@ * PHP version 7.4 * * @category Class - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech */ @@ -26,17 +26,17 @@ * Do not edit the class manually. */ -namespace Shotstack\Client\Model; +namespace ShotstackClient\Model; use \ArrayAccess; -use \Shotstack\Client\ObjectSerializer; +use \ShotstackClient\ObjectSerializer; /** * AssetResponse Class Doc Comment * * @category Class * @description The response returned by the Serve API [get asset](#get-asset) request. Includes details of a hosted video, image, audio file, thumbnail or poster image. The response follows the [json:api](https://jsonapi.org/) specification. - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech * @implements \ArrayAccess @@ -58,7 +58,7 @@ class AssetResponse implements ModelInterface, ArrayAccess, \JsonSerializable * @var string[] */ protected static $openAPITypes = [ - 'data' => '\Shotstack\Client\Model\AssetResponseData' + 'data' => '\ShotstackClient\Model\AssetResponseData' ]; /** @@ -296,7 +296,7 @@ public function valid() /** * Gets data * - * @return \Shotstack\Client\Model\AssetResponseData + * @return \ShotstackClient\Model\AssetResponseData */ public function getData() { @@ -306,7 +306,7 @@ public function getData() /** * Sets data * - * @param \Shotstack\Client\Model\AssetResponseData $data data + * @param \ShotstackClient\Model\AssetResponseData $data data * * @return self */ diff --git a/src/Model/AssetResponseAttributes.php b/src/Model/AssetResponseAttributes.php index a19ed13..f34c083 100644 --- a/src/Model/AssetResponseAttributes.php +++ b/src/Model/AssetResponseAttributes.php @@ -5,7 +5,7 @@ * PHP version 7.4 * * @category Class - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech */ @@ -26,17 +26,17 @@ * Do not edit the class manually. */ -namespace Shotstack\Client\Model; +namespace ShotstackClient\Model; use \ArrayAccess; -use \Shotstack\Client\ObjectSerializer; +use \ShotstackClient\ObjectSerializer; /** * AssetResponseAttributes Class Doc Comment * * @category Class * @description The list of asset attributes and their values. - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech * @implements \ArrayAccess diff --git a/src/Model/AssetResponseData.php b/src/Model/AssetResponseData.php index ce9f08b..3d0beea 100644 --- a/src/Model/AssetResponseData.php +++ b/src/Model/AssetResponseData.php @@ -5,7 +5,7 @@ * PHP version 7.4 * * @category Class - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech */ @@ -26,17 +26,17 @@ * Do not edit the class manually. */ -namespace Shotstack\Client\Model; +namespace ShotstackClient\Model; use \ArrayAccess; -use \Shotstack\Client\ObjectSerializer; +use \ShotstackClient\ObjectSerializer; /** * AssetResponseData Class Doc Comment * * @category Class * @description The type of resource (an asset) and attributes of the asset. - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech * @implements \ArrayAccess @@ -59,7 +59,7 @@ class AssetResponseData implements ModelInterface, ArrayAccess, \JsonSerializabl */ protected static $openAPITypes = [ 'type' => 'string', - 'attributes' => '\Shotstack\Client\Model\AssetResponseAttributes' + 'attributes' => '\ShotstackClient\Model\AssetResponseAttributes' ]; /** @@ -333,7 +333,7 @@ public function setType($type) /** * Gets attributes * - * @return \Shotstack\Client\Model\AssetResponseAttributes + * @return \ShotstackClient\Model\AssetResponseAttributes */ public function getAttributes() { @@ -343,7 +343,7 @@ public function getAttributes() /** * Sets attributes * - * @param \Shotstack\Client\Model\AssetResponseAttributes $attributes attributes + * @param \ShotstackClient\Model\AssetResponseAttributes $attributes attributes * * @return self */ diff --git a/src/Model/AudioAsset.php b/src/Model/AudioAsset.php index ad1cdd6..fe9499c 100644 --- a/src/Model/AudioAsset.php +++ b/src/Model/AudioAsset.php @@ -5,7 +5,7 @@ * PHP version 7.4 * * @category Class - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech */ @@ -26,17 +26,17 @@ * Do not edit the class manually. */ -namespace Shotstack\Client\Model; +namespace ShotstackClient\Model; use \ArrayAccess; -use \Shotstack\Client\ObjectSerializer; +use \ShotstackClient\ObjectSerializer; /** * AudioAsset Class Doc Comment * * @category Class * @description The AudioAsset is used to add sound effects and audio at specific intervals on the timeline. The src must be a publicly accessible URL to an audio resource such as an mp3 file. - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech * @implements \ArrayAccess @@ -61,7 +61,7 @@ class AudioAsset implements ModelInterface, ArrayAccess, \JsonSerializable 'type' => 'string', 'src' => 'string', 'trim' => 'float', - 'volume' => 'float', + 'volume' => '\ShotstackClient\Model\AudioAssetVolume', 'speed' => 'float', 'effect' => 'string' ]; @@ -259,10 +259,24 @@ public function getModelName() return self::$openAPIModelName; } + public const TYPE_AUDIO = 'audio'; + public const EFFECT_NONE = 'none'; public const EFFECT_FADE_IN = 'fadeIn'; public const EFFECT_FADE_OUT = 'fadeOut'; public const EFFECT_FADE_IN_FADE_OUT = 'fadeInFadeOut'; + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_AUDIO, + ]; + } + /** * Gets allowable values of the enum * @@ -271,6 +285,7 @@ public function getModelName() public function getEffectAllowableValues() { return [ + self::EFFECT_NONE, self::EFFECT_FADE_IN, self::EFFECT_FADE_OUT, self::EFFECT_FADE_IN_FADE_OUT, @@ -330,9 +345,26 @@ public function listInvalidProperties() if ($this->container['type'] === null) { $invalidProperties[] = "'type' can't be null"; } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + if ($this->container['src'] === null) { $invalidProperties[] = "'src' can't be null"; } + if ((mb_strlen($this->container['src']) < 1)) { + $invalidProperties[] = "invalid value for 'src', the character length must be bigger than or equal to 1."; + } + + if (!preg_match("/\\S/", $this->container['src'])) { + $invalidProperties[] = "invalid value for 'src', must be conform to the pattern /\\S/."; + } + if (!is_null($this->container['speed']) && ($this->container['speed'] > 10)) { $invalidProperties[] = "invalid value for 'speed', must be smaller than or equal to 10."; } @@ -387,6 +419,16 @@ public function setType($type) if (is_null($type)) { throw new \InvalidArgumentException('non-nullable type cannot be null'); } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } $this->container['type'] = $type; return $this; @@ -414,6 +456,14 @@ public function setSrc($src) if (is_null($src)) { throw new \InvalidArgumentException('non-nullable src cannot be null'); } + + if ((mb_strlen($src) < 1)) { + throw new \InvalidArgumentException('invalid length for $src when calling AudioAsset., must be bigger than or equal to 1.'); + } + if ((!preg_match("/\\S/", ObjectSerializer::toString($src)))) { + throw new \InvalidArgumentException("invalid value for \$src when calling AudioAsset., must conform to the pattern /\\S/."); + } + $this->container['src'] = $src; return $this; @@ -449,7 +499,7 @@ public function setTrim($trim) /** * Gets volume * - * @return float|null + * @return \ShotstackClient\Model\AudioAssetVolume|null */ public function getVolume() { @@ -459,7 +509,7 @@ public function getVolume() /** * Sets volume * - * @param float|null $volume Set the volume for the audio clip between 0 and 1 where 0 is muted and 1 is full volume (defaults to 1). + * @param \ShotstackClient\Model\AudioAssetVolume|null $volume volume * * @return self */ diff --git a/src/Model/AudioAssetVolume.php b/src/Model/AudioAssetVolume.php new file mode 100644 index 0000000..9661b59 --- /dev/null +++ b/src/Model/AudioAssetVolume.php @@ -0,0 +1,382 @@ + + */ +class AudioAssetVolume implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'AudioAsset_volume'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + + ]; + + /** + * 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; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $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 = [ + + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + + ]; + + /** + * 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) + { + } + + /** + * 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 = []; + + 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; + } + + /** + * 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() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/AudioEnhancement.php b/src/Model/AudioEnhancement.php index 1664ae1..79b21f4 100644 --- a/src/Model/AudioEnhancement.php +++ b/src/Model/AudioEnhancement.php @@ -5,7 +5,7 @@ * PHP version 7.4 * * @category Class - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech */ @@ -26,17 +26,17 @@ * Do not edit the class manually. */ -namespace Shotstack\Client\Model; +namespace ShotstackClient\Model; use \ArrayAccess; -use \Shotstack\Client\ObjectSerializer; +use \ShotstackClient\ObjectSerializer; /** * AudioEnhancement Class Doc Comment * * @category Class * @description An audio enhancement that can be applied to the audio content of a rendition. The following providers are available: <ul> <li><a href=\"#tocs_dolbyenhancement\">DolbyEnhancement</a></li> </ul> - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech * @implements \ArrayAccess @@ -59,7 +59,7 @@ class AudioEnhancement implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPITypes = [ 'provider' => 'string', - 'options' => '\Shotstack\Client\Model\DolbyEnhancementOptions' + 'options' => '\ShotstackClient\Model\DolbyEnhancementOptions' ]; /** @@ -336,7 +336,7 @@ public function setProvider($provider) /** * Gets options * - * @return \Shotstack\Client\Model\DolbyEnhancementOptions + * @return \ShotstackClient\Model\DolbyEnhancementOptions */ public function getOptions() { @@ -346,7 +346,7 @@ public function getOptions() /** * Sets options * - * @param \Shotstack\Client\Model\DolbyEnhancementOptions $options options + * @param \ShotstackClient\Model\DolbyEnhancementOptions $options options * * @return self */ diff --git a/src/Model/DIDGeneratedAssetOptions.php b/src/Model/CaptionAsset.php similarity index 58% rename from src/Model/DIDGeneratedAssetOptions.php rename to src/Model/CaptionAsset.php index ec6a887..3f32dec 100644 --- a/src/Model/DIDGeneratedAssetOptions.php +++ b/src/Model/CaptionAsset.php @@ -1,11 +1,11 @@ */ -class DIDGeneratedAssetOptions implements ModelInterface, ArrayAccess, \JsonSerializable +class CaptionAsset implements ModelInterface, ArrayAccess, \JsonSerializable { - public const DISCRIMINATOR = 'type'; + public const DISCRIMINATOR = null; /** * The original name of the model. * * @var string */ - protected static $openAPIModelName = 'DIDGeneratedAssetOptions'; + protected static $openAPIModelName = 'CaptionAsset'; /** * Array of property to type mappings. Used for (de)serialization @@ -59,9 +59,12 @@ class DIDGeneratedAssetOptions implements ModelInterface, ArrayAccess, \JsonSeri */ protected static $openAPITypes = [ 'type' => 'string', - 'text' => 'string', - 'avatar' => 'string', - 'background' => 'string' + 'src' => 'string', + 'font' => '\ShotstackClient\Model\CaptionFont', + 'background' => '\ShotstackClient\Model\CaptionBackground', + 'margin' => '\ShotstackClient\Model\CaptionMargin', + 'trim' => 'float', + 'speed' => 'float' ]; /** @@ -73,9 +76,12 @@ class DIDGeneratedAssetOptions implements ModelInterface, ArrayAccess, \JsonSeri */ protected static $openAPIFormats = [ 'type' => null, - 'text' => null, - 'avatar' => null, - 'background' => null + 'src' => null, + 'font' => null, + 'background' => null, + 'margin' => null, + 'trim' => null, + 'speed' => 'float' ]; /** @@ -85,9 +91,12 @@ class DIDGeneratedAssetOptions implements ModelInterface, ArrayAccess, \JsonSeri */ protected static array $openAPINullables = [ 'type' => false, - 'text' => false, - 'avatar' => false, - 'background' => false + 'src' => false, + 'font' => false, + 'background' => false, + 'margin' => false, + 'trim' => false, + 'speed' => false ]; /** @@ -177,9 +186,12 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'type' => 'type', - 'text' => 'text', - 'avatar' => 'avatar', - 'background' => 'background' + 'src' => 'src', + 'font' => 'font', + 'background' => 'background', + 'margin' => 'margin', + 'trim' => 'trim', + 'speed' => 'speed' ]; /** @@ -189,9 +201,12 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'type' => 'setType', - 'text' => 'setText', - 'avatar' => 'setAvatar', - 'background' => 'setBackground' + 'src' => 'setSrc', + 'font' => 'setFont', + 'background' => 'setBackground', + 'margin' => 'setMargin', + 'trim' => 'setTrim', + 'speed' => 'setSpeed' ]; /** @@ -201,9 +216,12 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'type' => 'getType', - 'text' => 'getText', - 'avatar' => 'getAvatar', - 'background' => 'getBackground' + 'src' => 'getSrc', + 'font' => 'getFont', + 'background' => 'getBackground', + 'margin' => 'getMargin', + 'trim' => 'getTrim', + 'speed' => 'getSpeed' ]; /** @@ -247,12 +265,7 @@ public function getModelName() return self::$openAPIModelName; } - public const TYPE_TEXT_TO_AVATAR = 'text-to-avatar'; - public const AVATAR_JACK = 'jack'; - public const AVATAR_LANA = 'lana'; - public const AVATAR_LILY = 'lily'; - public const AVATAR_MATT = 'matt'; - public const AVATAR_RIAN = 'rian'; + public const TYPE_CAPTION = 'caption'; /** * Gets allowable values of the enum @@ -262,23 +275,7 @@ public function getModelName() public function getTypeAllowableValues() { return [ - self::TYPE_TEXT_TO_AVATAR, - ]; - } - - /** - * Gets allowable values of the enum - * - * @return string[] - */ - public function getAvatarAllowableValues() - { - return [ - self::AVATAR_JACK, - self::AVATAR_LANA, - self::AVATAR_LILY, - self::AVATAR_MATT, - self::AVATAR_RIAN, + self::TYPE_CAPTION, ]; } @@ -297,13 +294,13 @@ public function getAvatarAllowableValues() */ public function __construct(array $data = null) { - $this->setIfExists('type', $data ?? [], null); - $this->setIfExists('text', $data ?? [], null); - $this->setIfExists('avatar', $data ?? [], null); + $this->setIfExists('type', $data ?? [], 'caption'); + $this->setIfExists('src', $data ?? [], null); + $this->setIfExists('font', $data ?? [], null); $this->setIfExists('background', $data ?? [], null); - - // Initialize discriminator property with the model name. - $this->container['type'] = static::$openAPIModelName; + $this->setIfExists('margin', $data ?? [], null); + $this->setIfExists('trim', $data ?? [], null); + $this->setIfExists('speed', $data ?? [], null); } /** @@ -345,19 +342,23 @@ public function listInvalidProperties() ); } - if ($this->container['text'] === null) { - $invalidProperties[] = "'text' can't be null"; + if ($this->container['src'] === null) { + $invalidProperties[] = "'src' can't be null"; } - if ($this->container['avatar'] === null) { - $invalidProperties[] = "'avatar' can't be null"; + if ((mb_strlen($this->container['src']) < 1)) { + $invalidProperties[] = "invalid value for 'src', the character length must be bigger than or equal to 1."; } - $allowedValues = $this->getAvatarAllowableValues(); - if (!is_null($this->container['avatar']) && !in_array($this->container['avatar'], $allowedValues, true)) { - $invalidProperties[] = sprintf( - "invalid value '%s' for 'avatar', must be one of '%s'", - $this->container['avatar'], - implode("', '", $allowedValues) - ); + + if (!preg_match("/\\S/", $this->container['src'])) { + $invalidProperties[] = "invalid value for 'src', must be conform to the pattern /\\S/."; + } + + if (!is_null($this->container['speed']) && ($this->container['speed'] > 10)) { + $invalidProperties[] = "invalid value for 'speed', must be smaller than or equal to 10."; + } + + if (!is_null($this->container['speed']) && ($this->container['speed'] < 0)) { + $invalidProperties[] = "invalid value for 'speed', must be bigger than or equal to 0."; } return $invalidProperties; @@ -388,7 +389,7 @@ public function getType() /** * Sets type * - * @param string $type The type of asset to generate - set to `text-to-avatar` for text-to-avatar. + * @param string $type The type of asset - set to `caption` for captions. * * @return self */ @@ -413,65 +414,63 @@ public function setType($type) } /** - * Gets text + * Gets src * * @return string */ - public function getText() + public function getSrc() { - return $this->container['text']; + return $this->container['src']; } /** - * Sets text + * Sets src * - * @param string $text The text or script that the avatar will narrate. + * @param string $src The URL to an SRT or VTT subtitles file, or an alias reference to auto-generate captions from an audio or video clip. For file URLs, the URL must be publicly accessible or include credentials. For auto-captioning, use the format `alias://clip-name` where clip-name is the alias of an audio, video, or text-to-speech clip. The system will automatically transcribe the audio and detect the language. * * @return self */ - public function setText($text) + public function setSrc($src) { - if (is_null($text)) { - throw new \InvalidArgumentException('non-nullable text cannot be null'); + if (is_null($src)) { + throw new \InvalidArgumentException('non-nullable src cannot be null'); + } + + if ((mb_strlen($src) < 1)) { + throw new \InvalidArgumentException('invalid length for $src when calling CaptionAsset., must be bigger than or equal to 1.'); + } + if ((!preg_match("/\\S/", ObjectSerializer::toString($src)))) { + throw new \InvalidArgumentException("invalid value for \$src when calling CaptionAsset., must conform to the pattern /\\S/."); } - $this->container['text'] = $text; + + $this->container['src'] = $src; return $this; } /** - * Gets avatar + * Gets font * - * @return string + * @return \ShotstackClient\Model\CaptionFont|null */ - public function getAvatar() + public function getFont() { - return $this->container['avatar']; + return $this->container['font']; } /** - * Sets avatar + * Sets font * - * @param string $avatar The avatar character to generate. Select from the list of available avatars:
  • `jack`
  • `lana`
  • `lily`
  • `matt`
  • `rian`
+ * @param \ShotstackClient\Model\CaptionFont|null $font font * * @return self */ - public function setAvatar($avatar) + public function setFont($font) { - if (is_null($avatar)) { - throw new \InvalidArgumentException('non-nullable avatar cannot be null'); + if (is_null($font)) { + throw new \InvalidArgumentException('non-nullable font cannot be null'); } - $allowedValues = $this->getAvatarAllowableValues(); - if (!in_array($avatar, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value '%s' for 'avatar', must be one of '%s'", - $avatar, - implode("', '", $allowedValues) - ) - ); - } - $this->container['avatar'] = $avatar; + $this->container['font'] = $font; return $this; } @@ -479,7 +478,7 @@ public function setAvatar($avatar) /** * Gets background * - * @return string|null + * @return \ShotstackClient\Model\CaptionBackground|null */ public function getBackground() { @@ -489,7 +488,7 @@ public function getBackground() /** * Sets background * - * @param string|null $background The background color of the video. + * @param \ShotstackClient\Model\CaptionBackground|null $background background * * @return self */ @@ -502,6 +501,95 @@ public function setBackground($background) return $this; } + + /** + * Gets margin + * + * @return \ShotstackClient\Model\CaptionMargin|null + */ + public function getMargin() + { + return $this->container['margin']; + } + + /** + * Sets margin + * + * @param \ShotstackClient\Model\CaptionMargin|null $margin margin + * + * @return self + */ + public function setMargin($margin) + { + if (is_null($margin)) { + throw new \InvalidArgumentException('non-nullable margin cannot be null'); + } + $this->container['margin'] = $margin; + + return $this; + } + + /** + * Gets trim + * + * @return float|null + */ + public function getTrim() + { + return $this->container['trim']; + } + + /** + * Sets trim + * + * @param float|null $trim The start trim point of the captions, in seconds (defaults to 0). Remove the trim length from the start of the captions and allow it to be synced with video or audio. The captions will play until the file ends or the Clip length is reached. + * + * @return self + */ + public function setTrim($trim) + { + if (is_null($trim)) { + throw new \InvalidArgumentException('non-nullable trim cannot be null'); + } + $this->container['trim'] = $trim; + + return $this; + } + + /** + * Gets speed + * + * @return float|null + */ + public function getSpeed() + { + return $this->container['speed']; + } + + /** + * Sets speed + * + * @param float|null $speed Adjust the playback speed of the captions between 0 (paused) and 10 (10x normal speed) where 1 is normal speed (defaults to 1). Adjusting the speed will also adjust the duration of the clip and may require you to adjust the Clip length. For example, if you set speed to 0.5, the clip will need to be 2x as long to play the entire captions (i.e. original length / 0.5). If you set speed to 2, the clip will need to be half as long to play the entire captions (i.e. original length / 2). + * + * @return self + */ + public function setSpeed($speed) + { + if (is_null($speed)) { + throw new \InvalidArgumentException('non-nullable speed cannot be null'); + } + + if (($speed > 10)) { + throw new \InvalidArgumentException('invalid value for $speed when calling CaptionAsset., must be smaller than or equal to 10.'); + } + if (($speed < 0)) { + throw new \InvalidArgumentException('invalid value for $speed when calling CaptionAsset., must be bigger than or equal to 0.'); + } + + $this->container['speed'] = $speed; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/src/Model/CaptionBackground.php b/src/Model/CaptionBackground.php new file mode 100644 index 0000000..3cafb0f --- /dev/null +++ b/src/Model/CaptionBackground.php @@ -0,0 +1,512 @@ + + */ +class CaptionBackground implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CaptionBackground'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'color' => 'string', + 'opacity' => 'float', + 'padding' => 'int', + 'border_radius' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'color' => null, + 'opacity' => null, + 'padding' => null, + 'border_radius' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'color' => false, + 'opacity' => false, + 'padding' => false, + 'border_radius' => 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; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $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 = [ + 'color' => 'color', + 'opacity' => 'opacity', + 'padding' => 'padding', + 'border_radius' => 'borderRadius' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'color' => 'setColor', + 'opacity' => 'setOpacity', + 'padding' => 'setPadding', + 'border_radius' => 'setBorderRadius' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'color' => 'getColor', + 'opacity' => 'getOpacity', + 'padding' => 'getPadding', + 'border_radius' => 'getBorderRadius' + ]; + + /** + * 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) + { + $this->setIfExists('color', $data ?? [], null); + $this->setIfExists('opacity', $data ?? [], null); + $this->setIfExists('padding', $data ?? [], null); + $this->setIfExists('border_radius', $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 = []; + + 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 color + * + * @return string|null + */ + public function getColor() + { + return $this->container['color']; + } + + /** + * Sets color + * + * @param string|null $color The background color using hexadecimal color notation. + * + * @return self + */ + public function setColor($color) + { + if (is_null($color)) { + throw new \InvalidArgumentException('non-nullable color cannot be null'); + } + $this->container['color'] = $color; + + return $this; + } + + /** + * Gets opacity + * + * @return float|null + */ + public function getOpacity() + { + return $this->container['opacity']; + } + + /** + * Sets opacity + * + * @param float|null $opacity The opacity of the background color. + * + * @return self + */ + public function setOpacity($opacity) + { + if (is_null($opacity)) { + throw new \InvalidArgumentException('non-nullable opacity cannot be null'); + } + $this->container['opacity'] = $opacity; + + return $this; + } + + /** + * Gets padding + * + * @return int|null + */ + public function getPadding() + { + return $this->container['padding']; + } + + /** + * Sets padding + * + * @param int|null $padding The padding inside the background box in pixels. + * + * @return self + */ + public function setPadding($padding) + { + if (is_null($padding)) { + throw new \InvalidArgumentException('non-nullable padding cannot be null'); + } + $this->container['padding'] = $padding; + + return $this; + } + + /** + * Gets border_radius + * + * @return int|null + */ + public function getBorderRadius() + { + return $this->container['border_radius']; + } + + /** + * Sets border_radius + * + * @param int|null $border_radius The border radius of the background box in pixels. + * + * @return self + */ + public function setBorderRadius($border_radius) + { + if (is_null($border_radius)) { + throw new \InvalidArgumentException('non-nullable border_radius cannot be null'); + } + $this->container['border_radius'] = $border_radius; + + 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() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/CaptionFont.php b/src/Model/CaptionFont.php new file mode 100644 index 0000000..6bd9a86 --- /dev/null +++ b/src/Model/CaptionFont.php @@ -0,0 +1,614 @@ + + */ +class CaptionFont implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CaptionFont'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'family' => 'string', + 'color' => 'string', + 'opacity' => 'float', + 'size' => 'int', + 'line_height' => 'float', + 'stroke' => 'string', + 'stroke_width' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'family' => null, + 'color' => null, + 'opacity' => null, + 'size' => null, + 'line_height' => null, + 'stroke' => null, + 'stroke_width' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'family' => false, + 'color' => false, + 'opacity' => false, + 'size' => false, + 'line_height' => false, + 'stroke' => false, + 'stroke_width' => 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; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $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 = [ + 'family' => 'family', + 'color' => 'color', + 'opacity' => 'opacity', + 'size' => 'size', + 'line_height' => 'lineHeight', + 'stroke' => 'stroke', + 'stroke_width' => 'strokeWidth' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'family' => 'setFamily', + 'color' => 'setColor', + 'opacity' => 'setOpacity', + 'size' => 'setSize', + 'line_height' => 'setLineHeight', + 'stroke' => 'setStroke', + 'stroke_width' => 'setStrokeWidth' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'family' => 'getFamily', + 'color' => 'getColor', + 'opacity' => 'getOpacity', + 'size' => 'getSize', + 'line_height' => 'getLineHeight', + 'stroke' => 'getStroke', + 'stroke_width' => 'getStrokeWidth' + ]; + + /** + * 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) + { + $this->setIfExists('family', $data ?? [], null); + $this->setIfExists('color', $data ?? [], null); + $this->setIfExists('opacity', $data ?? [], null); + $this->setIfExists('size', $data ?? [], null); + $this->setIfExists('line_height', $data ?? [], null); + $this->setIfExists('stroke', $data ?? [], null); + $this->setIfExists('stroke_width', $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 = []; + + 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 family + * + * @return string|null + */ + public function getFamily() + { + return $this->container['family']; + } + + /** + * Sets family + * + * @param string|null $family The font family name. This must be Family name embedded in the font, i.e. \"Open Sans\". + * + * @return self + */ + public function setFamily($family) + { + if (is_null($family)) { + throw new \InvalidArgumentException('non-nullable family cannot be null'); + } + $this->container['family'] = $family; + + return $this; + } + + /** + * Gets color + * + * @return string|null + */ + public function getColor() + { + return $this->container['color']; + } + + /** + * Sets color + * + * @param string|null $color The text color using hexadecimal color notation. + * + * @return self + */ + public function setColor($color) + { + if (is_null($color)) { + throw new \InvalidArgumentException('non-nullable color cannot be null'); + } + $this->container['color'] = $color; + + return $this; + } + + /** + * Gets opacity + * + * @return float|null + */ + public function getOpacity() + { + return $this->container['opacity']; + } + + /** + * Sets opacity + * + * @param float|null $opacity The opacity of the text where 1 is opaque and 0 is transparent. + * + * @return self + */ + public function setOpacity($opacity) + { + if (is_null($opacity)) { + throw new \InvalidArgumentException('non-nullable opacity cannot be null'); + } + $this->container['opacity'] = $opacity; + + return $this; + } + + /** + * Gets size + * + * @return int|null + */ + public function getSize() + { + return $this->container['size']; + } + + /** + * Sets size + * + * @param int|null $size The size of the font in pixels (px). + * + * @return self + */ + public function setSize($size) + { + if (is_null($size)) { + throw new \InvalidArgumentException('non-nullable size cannot be null'); + } + $this->container['size'] = $size; + + return $this; + } + + /** + * Gets line_height + * + * @return float|null + */ + public function getLineHeight() + { + return $this->container['line_height']; + } + + /** + * Sets line_height + * + * @param float|null $line_height The line height of the font as a ratio of the font size. + * + * @return self + */ + public function setLineHeight($line_height) + { + if (is_null($line_height)) { + throw new \InvalidArgumentException('non-nullable line_height cannot be null'); + } + $this->container['line_height'] = $line_height; + + return $this; + } + + /** + * Gets stroke + * + * @return string|null + */ + public function getStroke() + { + return $this->container['stroke']; + } + + /** + * Sets stroke + * + * @param string|null $stroke The stroke color of the font using hexadecimal color notation. + * + * @return self + */ + public function setStroke($stroke) + { + if (is_null($stroke)) { + throw new \InvalidArgumentException('non-nullable stroke cannot be null'); + } + $this->container['stroke'] = $stroke; + + return $this; + } + + /** + * Gets stroke_width + * + * @return float|null + */ + public function getStrokeWidth() + { + return $this->container['stroke_width']; + } + + /** + * Sets stroke_width + * + * @param float|null $stroke_width The width of the stroke in pixels. + * + * @return self + */ + public function setStrokeWidth($stroke_width) + { + if (is_null($stroke_width)) { + throw new \InvalidArgumentException('non-nullable stroke_width cannot be null'); + } + $this->container['stroke_width'] = $stroke_width; + + 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() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/CaptionMargin.php b/src/Model/CaptionMargin.php new file mode 100644 index 0000000..794911f --- /dev/null +++ b/src/Model/CaptionMargin.php @@ -0,0 +1,478 @@ + + */ +class CaptionMargin implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CaptionMargin'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'top' => 'float', + 'left' => 'float', + 'right' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'top' => null, + 'left' => null, + 'right' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'top' => false, + 'left' => false, + 'right' => 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; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $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 = [ + 'top' => 'top', + 'left' => 'left', + 'right' => 'right' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'top' => 'setTop', + 'left' => 'setLeft', + 'right' => 'setRight' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'top' => 'getTop', + 'left' => 'getLeft', + 'right' => 'getRight' + ]; + + /** + * 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) + { + $this->setIfExists('top', $data ?? [], null); + $this->setIfExists('left', $data ?? [], null); + $this->setIfExists('right', $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 = []; + + 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 top + * + * @return float|null + */ + public function getTop() + { + return $this->container['top']; + } + + /** + * Sets top + * + * @param float|null $top The margin above the text. Pushes captions down the screen. + * + * @return self + */ + public function setTop($top) + { + if (is_null($top)) { + throw new \InvalidArgumentException('non-nullable top cannot be null'); + } + $this->container['top'] = $top; + + return $this; + } + + /** + * Gets left + * + * @return float|null + */ + public function getLeft() + { + return $this->container['left']; + } + + /** + * Sets left + * + * @param float|null $left The margin to the left of the text. Pushes captions to the right. + * + * @return self + */ + public function setLeft($left) + { + if (is_null($left)) { + throw new \InvalidArgumentException('non-nullable left cannot be null'); + } + $this->container['left'] = $left; + + return $this; + } + + /** + * Gets right + * + * @return float|null + */ + public function getRight() + { + return $this->container['right']; + } + + /** + * Sets right + * + * @param float|null $right The margin to the right of the text. Pushes captions to the left. + * + * @return self + */ + public function setRight($right) + { + if (is_null($right)) { + throw new \InvalidArgumentException('non-nullable right cannot be null'); + } + $this->container['right'] = $right; + + 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() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ChromaKey.php b/src/Model/ChromaKey.php new file mode 100644 index 0000000..bafd593 --- /dev/null +++ b/src/Model/ChromaKey.php @@ -0,0 +1,522 @@ + + */ +class ChromaKey implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ChromaKey'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'color' => 'string', + 'threshold' => 'int', + 'halo' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'color' => null, + 'threshold' => null, + 'halo' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'color' => false, + 'threshold' => false, + 'halo' => 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; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $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 = [ + 'color' => 'color', + 'threshold' => 'threshold', + 'halo' => 'halo' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'color' => 'setColor', + 'threshold' => 'setThreshold', + 'halo' => 'setHalo' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'color' => 'getColor', + 'threshold' => 'getThreshold', + 'halo' => 'getHalo' + ]; + + /** + * 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) + { + $this->setIfExists('color', $data ?? [], null); + $this->setIfExists('threshold', $data ?? [], null); + $this->setIfExists('halo', $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 ($this->container['color'] === null) { + $invalidProperties[] = "'color' can't be null"; + } + if (!preg_match("/^#[0-9a-fA-F]{6}$/", $this->container['color'])) { + $invalidProperties[] = "invalid value for 'color', must be conform to the pattern /^#[0-9a-fA-F]{6}$/."; + } + + if (!is_null($this->container['threshold']) && ($this->container['threshold'] > 250)) { + $invalidProperties[] = "invalid value for 'threshold', must be smaller than or equal to 250."; + } + + if (!is_null($this->container['threshold']) && ($this->container['threshold'] < 0)) { + $invalidProperties[] = "invalid value for 'threshold', must be bigger than or equal to 0."; + } + + if (!is_null($this->container['halo']) && ($this->container['halo'] > 250)) { + $invalidProperties[] = "invalid value for 'halo', must be smaller than or equal to 250."; + } + + if (!is_null($this->container['halo']) && ($this->container['halo'] < 0)) { + $invalidProperties[] = "invalid value for 'halo', must be bigger than or equal to 0."; + } + + 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 color + * + * @return string + */ + public function getColor() + { + return $this->container['color']; + } + + /** + * Sets color + * + * @param string $color The chroma key color as a hex value. Use green (#00b140) for green screens or blue (#0000FF) for blue screens. Any valid hex color can be used as the key color. + * + * @return self + */ + public function setColor($color) + { + if (is_null($color)) { + throw new \InvalidArgumentException('non-nullable color cannot be null'); + } + + if ((!preg_match("/^#[0-9a-fA-F]{6}$/", ObjectSerializer::toString($color)))) { + throw new \InvalidArgumentException("invalid value for \$color when calling ChromaKey., must conform to the pattern /^#[0-9a-fA-F]{6}$/."); + } + + $this->container['color'] = $color; + + return $this; + } + + /** + * Gets threshold + * + * @return int|null + */ + public function getThreshold() + { + return $this->container['threshold']; + } + + /** + * Sets threshold + * + * @param int|null $threshold Pixels within this distance from the key color are eliminated by setting their alpha values to zero. + * + * @return self + */ + public function setThreshold($threshold) + { + if (is_null($threshold)) { + throw new \InvalidArgumentException('non-nullable threshold cannot be null'); + } + + if (($threshold > 250)) { + throw new \InvalidArgumentException('invalid value for $threshold when calling ChromaKey., must be smaller than or equal to 250.'); + } + if (($threshold < 0)) { + throw new \InvalidArgumentException('invalid value for $threshold when calling ChromaKey., must be bigger than or equal to 0.'); + } + + $this->container['threshold'] = $threshold; + + return $this; + } + + /** + * Gets halo + * + * @return int|null + */ + public function getHalo() + { + return $this->container['halo']; + } + + /** + * Sets halo + * + * @param int|null $halo Pixels within the halo distance from the threshold boundary are given an increasing alpha value based on their distance from the threshold. + * + * @return self + */ + public function setHalo($halo) + { + if (is_null($halo)) { + throw new \InvalidArgumentException('non-nullable halo cannot be null'); + } + + if (($halo > 250)) { + throw new \InvalidArgumentException('invalid value for $halo when calling ChromaKey., must be smaller than or equal to 250.'); + } + if (($halo < 0)) { + throw new \InvalidArgumentException('invalid value for $halo when calling ChromaKey., must be bigger than or equal to 0.'); + } + + $this->container['halo'] = $halo; + + 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() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/Clip.php b/src/Model/Clip.php index aa97bda..b7ec8e3 100644 --- a/src/Model/Clip.php +++ b/src/Model/Clip.php @@ -5,7 +5,7 @@ * PHP version 7.4 * * @category Class - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech */ @@ -26,17 +26,17 @@ * Do not edit the class manually. */ -namespace Shotstack\Client\Model; +namespace ShotstackClient\Model; use \ArrayAccess; -use \Shotstack\Client\ObjectSerializer; +use \ShotstackClient\ObjectSerializer; /** * Clip Class Doc Comment * * @category Class * @description A clip is a container for a specific type of asset, i.e. a title, image, video, audio or html. You use a Clip to define when an asset will display on the timeline, how long it will play for and transitions, filters and effects to apply to it. - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech * @implements \ArrayAccess @@ -58,18 +58,21 @@ class Clip implements ModelInterface, ArrayAccess, \JsonSerializable * @var string[] */ protected static $openAPITypes = [ - 'asset' => '\Shotstack\Client\Model\Asset', - 'start' => 'float', - 'length' => 'float', + 'asset' => '\ShotstackClient\Model\Asset', + 'start' => '\ShotstackClient\Model\ClipStart', + 'length' => '\ShotstackClient\Model\ClipLength', 'fit' => 'string', - 'scale' => 'float', + 'scale' => '\ShotstackClient\Model\ClipScale', + 'width' => 'float', + 'height' => 'float', 'position' => 'string', - 'offset' => '\Shotstack\Client\Model\Offset', - 'transition' => '\Shotstack\Client\Model\Transition', + 'offset' => '\ShotstackClient\Model\Offset', + 'transition' => '\ShotstackClient\Model\Transition', 'effect' => 'string', 'filter' => 'string', - 'opacity' => 'float', - 'transform' => '\Shotstack\Client\Model\Transformation' + 'opacity' => '\ShotstackClient\Model\ClipOpacity', + 'transform' => '\ShotstackClient\Model\Transformation', + 'alias' => 'string' ]; /** @@ -85,13 +88,16 @@ class Clip implements ModelInterface, ArrayAccess, \JsonSerializable 'length' => null, 'fit' => null, 'scale' => null, + 'width' => 'float', + 'height' => 'float', 'position' => null, 'offset' => null, 'transition' => null, 'effect' => null, 'filter' => null, 'opacity' => null, - 'transform' => null + 'transform' => null, + 'alias' => null ]; /** @@ -105,13 +111,16 @@ class Clip implements ModelInterface, ArrayAccess, \JsonSerializable 'length' => false, 'fit' => false, 'scale' => false, + 'width' => false, + 'height' => false, 'position' => false, 'offset' => false, 'transition' => false, 'effect' => false, 'filter' => false, 'opacity' => false, - 'transform' => false + 'transform' => false, + 'alias' => false ]; /** @@ -205,13 +214,16 @@ public function isNullableSetToNull(string $property): bool 'length' => 'length', 'fit' => 'fit', 'scale' => 'scale', + 'width' => 'width', + 'height' => 'height', 'position' => 'position', 'offset' => 'offset', 'transition' => 'transition', 'effect' => 'effect', 'filter' => 'filter', 'opacity' => 'opacity', - 'transform' => 'transform' + 'transform' => 'transform', + 'alias' => 'alias' ]; /** @@ -225,13 +237,16 @@ public function isNullableSetToNull(string $property): bool 'length' => 'setLength', 'fit' => 'setFit', 'scale' => 'setScale', + 'width' => 'setWidth', + 'height' => 'setHeight', 'position' => 'setPosition', 'offset' => 'setOffset', 'transition' => 'setTransition', 'effect' => 'setEffect', 'filter' => 'setFilter', 'opacity' => 'setOpacity', - 'transform' => 'setTransform' + 'transform' => 'setTransform', + 'alias' => 'setAlias' ]; /** @@ -245,13 +260,16 @@ public function isNullableSetToNull(string $property): bool 'length' => 'getLength', 'fit' => 'getFit', 'scale' => 'getScale', + 'width' => 'getWidth', + 'height' => 'getHeight', 'position' => 'getPosition', 'offset' => 'getOffset', 'transition' => 'getTransition', 'effect' => 'getEffect', 'filter' => 'getFilter', 'opacity' => 'getOpacity', - 'transform' => 'getTransform' + 'transform' => 'getTransform', + 'alias' => 'getAlias' ]; /** @@ -326,6 +344,7 @@ public function getModelName() public const EFFECT_SLIDE_DOWN = 'slideDown'; public const EFFECT_SLIDE_DOWN_SLOW = 'slideDownSlow'; public const EFFECT_SLIDE_DOWN_FAST = 'slideDownFast'; + public const FILTER_NONE = 'none'; public const FILTER_BLUR = 'blur'; public const FILTER_BOOST = 'boost'; public const FILTER_CONTRAST = 'contrast'; @@ -407,6 +426,7 @@ public function getEffectAllowableValues() public function getFilterAllowableValues() { return [ + self::FILTER_NONE, self::FILTER_BLUR, self::FILTER_BOOST, self::FILTER_CONTRAST, @@ -438,6 +458,8 @@ public function __construct(array $data = null) $this->setIfExists('length', $data ?? [], null); $this->setIfExists('fit', $data ?? [], null); $this->setIfExists('scale', $data ?? [], null); + $this->setIfExists('width', $data ?? [], null); + $this->setIfExists('height', $data ?? [], null); $this->setIfExists('position', $data ?? [], null); $this->setIfExists('offset', $data ?? [], null); $this->setIfExists('transition', $data ?? [], null); @@ -445,6 +467,7 @@ public function __construct(array $data = null) $this->setIfExists('filter', $data ?? [], null); $this->setIfExists('opacity', $data ?? [], null); $this->setIfExists('transform', $data ?? [], null); + $this->setIfExists('alias', $data ?? [], null); } /** @@ -492,6 +515,22 @@ public function listInvalidProperties() ); } + if (!is_null($this->container['width']) && ($this->container['width'] > 3840)) { + $invalidProperties[] = "invalid value for 'width', must be smaller than or equal to 3840."; + } + + if (!is_null($this->container['width']) && ($this->container['width'] < 1)) { + $invalidProperties[] = "invalid value for 'width', must be bigger than or equal to 1."; + } + + if (!is_null($this->container['height']) && ($this->container['height'] > 2160)) { + $invalidProperties[] = "invalid value for 'height', must be smaller than or equal to 2160."; + } + + if (!is_null($this->container['height']) && ($this->container['height'] < 1)) { + $invalidProperties[] = "invalid value for 'height', must be bigger than or equal to 1."; + } + $allowedValues = $this->getPositionAllowableValues(); if (!is_null($this->container['position']) && !in_array($this->container['position'], $allowedValues, true)) { $invalidProperties[] = sprintf( @@ -519,6 +558,10 @@ public function listInvalidProperties() ); } + if (!is_null($this->container['alias']) && !preg_match("/^[A-Za-z0-9_-]+$/", $this->container['alias'])) { + $invalidProperties[] = "invalid value for 'alias', must be conform to the pattern /^[A-Za-z0-9_-]+$/."; + } + return $invalidProperties; } @@ -537,7 +580,7 @@ public function valid() /** * Gets asset * - * @return \Shotstack\Client\Model\Asset + * @return \ShotstackClient\Model\Asset */ public function getAsset() { @@ -547,7 +590,7 @@ public function getAsset() /** * Sets asset * - * @param \Shotstack\Client\Model\Asset $asset asset + * @param \ShotstackClient\Model\Asset $asset asset * * @return self */ @@ -564,7 +607,7 @@ public function setAsset($asset) /** * Gets start * - * @return float + * @return \ShotstackClient\Model\ClipStart */ public function getStart() { @@ -574,7 +617,7 @@ public function getStart() /** * Sets start * - * @param float $start The start position of the Clip on the timeline, in seconds. + * @param \ShotstackClient\Model\ClipStart $start start * * @return self */ @@ -591,7 +634,7 @@ public function setStart($start) /** * Gets length * - * @return float + * @return \ShotstackClient\Model\ClipLength */ public function getLength() { @@ -601,7 +644,7 @@ public function getLength() /** * Sets length * - * @param float $length The length, in seconds, the Clip should play for. + * @param \ShotstackClient\Model\ClipLength $length length * * @return self */ @@ -655,7 +698,7 @@ public function setFit($fit) /** * Gets scale * - * @return float|null + * @return \ShotstackClient\Model\ClipScale|null */ public function getScale() { @@ -665,7 +708,7 @@ public function getScale() /** * Sets scale * - * @param float|null $scale Scale the asset to a fraction of the viewport size - i.e. setting the scale to 0.5 will scale asset to half the size of the viewport. This is useful for picture-in-picture video and scaling images such as logos and watermarks. + * @param \ShotstackClient\Model\ClipScale|null $scale scale * * @return self */ @@ -679,6 +722,76 @@ public function setScale($scale) return $this; } + /** + * Gets width + * + * @return float|null + */ + public function getWidth() + { + return $this->container['width']; + } + + /** + * Sets width + * + * @param float|null $width Set the width of the clip bounding box in pixels. This constrains the width of the clip, overriding the default behavior where clips fill the viewport width. + * + * @return self + */ + public function setWidth($width) + { + if (is_null($width)) { + throw new \InvalidArgumentException('non-nullable width cannot be null'); + } + + if (($width > 3840)) { + throw new \InvalidArgumentException('invalid value for $width when calling Clip., must be smaller than or equal to 3840.'); + } + if (($width < 1)) { + throw new \InvalidArgumentException('invalid value for $width when calling Clip., must be bigger than or equal to 1.'); + } + + $this->container['width'] = $width; + + return $this; + } + + /** + * Gets height + * + * @return float|null + */ + public function getHeight() + { + return $this->container['height']; + } + + /** + * Sets height + * + * @param float|null $height Set the height of the clip bounding box in pixels. This constrains the height of the clip, overriding the default behavior where clips fill the viewport height. + * + * @return self + */ + public function setHeight($height) + { + if (is_null($height)) { + throw new \InvalidArgumentException('non-nullable height cannot be null'); + } + + if (($height > 2160)) { + throw new \InvalidArgumentException('invalid value for $height when calling Clip., must be smaller than or equal to 2160.'); + } + if (($height < 1)) { + throw new \InvalidArgumentException('invalid value for $height when calling Clip., must be bigger than or equal to 1.'); + } + + $this->container['height'] = $height; + + return $this; + } + /** * Gets position * @@ -719,7 +832,7 @@ public function setPosition($position) /** * Gets offset * - * @return \Shotstack\Client\Model\Offset|null + * @return \ShotstackClient\Model\Offset|null */ public function getOffset() { @@ -729,7 +842,7 @@ public function getOffset() /** * Sets offset * - * @param \Shotstack\Client\Model\Offset|null $offset offset + * @param \ShotstackClient\Model\Offset|null $offset offset * * @return self */ @@ -746,7 +859,7 @@ public function setOffset($offset) /** * Gets transition * - * @return \Shotstack\Client\Model\Transition|null + * @return \ShotstackClient\Model\Transition|null */ public function getTransition() { @@ -756,7 +869,7 @@ public function getTransition() /** * Sets transition * - * @param \Shotstack\Client\Model\Transition|null $transition transition + * @param \ShotstackClient\Model\Transition|null $transition transition * * @return self */ @@ -820,7 +933,7 @@ public function getFilter() /** * Sets filter * - * @param string|null $filter A filter effect to apply to the Clip.
  • `blur` - blur the scene
  • `boost` - boost contrast and saturation
  • `contrast` - increase contrast
  • `darken` - darken the scene
  • `greyscale` - remove colour
  • `lighten` - lighten the scene
  • `muted` - reduce saturation and contrast
  • `negative` - negative colors
+ * @param string|null $filter A filter effect to apply to the Clip.
  • `none` - no filter applied
  • `blur` - blur the scene
  • `boost` - boost contrast and saturation
  • `contrast` - increase contrast
  • `darken` - darken the scene
  • `greyscale` - remove colour
  • `lighten` - lighten the scene
  • `muted` - reduce saturation and contrast
  • `negative` - negative colors
* * @return self */ @@ -847,7 +960,7 @@ public function setFilter($filter) /** * Gets opacity * - * @return float|null + * @return \ShotstackClient\Model\ClipOpacity|null */ public function getOpacity() { @@ -857,7 +970,7 @@ public function getOpacity() /** * Sets opacity * - * @param float|null $opacity Sets the opacity of the Clip where 1 is opaque and 0 is transparent. + * @param \ShotstackClient\Model\ClipOpacity|null $opacity opacity * * @return self */ @@ -874,7 +987,7 @@ public function setOpacity($opacity) /** * Gets transform * - * @return \Shotstack\Client\Model\Transformation|null + * @return \ShotstackClient\Model\Transformation|null */ public function getTransform() { @@ -884,7 +997,7 @@ public function getTransform() /** * Sets transform * - * @param \Shotstack\Client\Model\Transformation|null $transform transform + * @param \ShotstackClient\Model\Transformation|null $transform transform * * @return self */ @@ -897,6 +1010,38 @@ public function setTransform($transform) return $this; } + + /** + * Gets alias + * + * @return string|null + */ + public function getAlias() + { + return $this->container['alias']; + } + + /** + * Sets alias + * + * @param string|null $alias A unique identifier for this clip that can be used to reference it from other clips using the `alias://` protocol in asset sources. This is useful for features like auto-captioning where a caption asset needs to reference the audio from another clip. + * + * @return self + */ + public function setAlias($alias) + { + if (is_null($alias)) { + throw new \InvalidArgumentException('non-nullable alias cannot be null'); + } + + if ((!preg_match("/^[A-Za-z0-9_-]+$/", ObjectSerializer::toString($alias)))) { + throw new \InvalidArgumentException("invalid value for \$alias when calling Clip., must conform to the pattern /^[A-Za-z0-9_-]+$/."); + } + + $this->container['alias'] = $alias; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/src/Model/ClipLength.php b/src/Model/ClipLength.php new file mode 100644 index 0000000..cc55b67 --- /dev/null +++ b/src/Model/ClipLength.php @@ -0,0 +1,382 @@ + + */ +class ClipLength implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Clip_length'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + + ]; + + /** + * 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; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $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 = [ + + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + + ]; + + /** + * 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) + { + } + + /** + * 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 = []; + + 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; + } + + /** + * 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() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ClipOpacity.php b/src/Model/ClipOpacity.php new file mode 100644 index 0000000..77b82be --- /dev/null +++ b/src/Model/ClipOpacity.php @@ -0,0 +1,382 @@ + + */ +class ClipOpacity implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Clip_opacity'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + + ]; + + /** + * 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; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $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 = [ + + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + + ]; + + /** + * 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) + { + } + + /** + * 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 = []; + + 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; + } + + /** + * 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() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ClipScale.php b/src/Model/ClipScale.php new file mode 100644 index 0000000..53ba0dc --- /dev/null +++ b/src/Model/ClipScale.php @@ -0,0 +1,382 @@ + + */ +class ClipScale implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Clip_scale'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + + ]; + + /** + * 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; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $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 = [ + + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + + ]; + + /** + * 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) + { + } + + /** + * 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 = []; + + 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; + } + + /** + * 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() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ClipStart.php b/src/Model/ClipStart.php new file mode 100644 index 0000000..e8251a7 --- /dev/null +++ b/src/Model/ClipStart.php @@ -0,0 +1,382 @@ + + */ +class ClipStart implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Clip_start'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + + ]; + + /** + * 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; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $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 = [ + + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + + ]; + + /** + * 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) + { + } + + /** + * 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 = []; + + 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; + } + + /** + * 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() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/Crop.php b/src/Model/Crop.php index cba6d27..98e4710 100644 --- a/src/Model/Crop.php +++ b/src/Model/Crop.php @@ -5,7 +5,7 @@ * PHP version 7.4 * * @category Class - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech */ @@ -26,17 +26,17 @@ * Do not edit the class manually. */ -namespace Shotstack\Client\Model; +namespace ShotstackClient\Model; use \ArrayAccess; -use \Shotstack\Client\ObjectSerializer; +use \ShotstackClient\ObjectSerializer; /** * Crop Class Doc Comment * * @category Class * @description Crop the sides of an asset by a relative amount. The size of the crop is specified using a scale between 0 and 1, relative to the screen width - i.e a left crop of 0.5 will crop half of the asset from the left, a top crop of 0.25 will crop the top by quarter of the asset. - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech * @implements \ArrayAccess diff --git a/src/Model/Destinations.php b/src/Model/Destinations.php index 25c736a..e0991ae 100644 --- a/src/Model/Destinations.php +++ b/src/Model/Destinations.php @@ -5,7 +5,7 @@ * PHP version 7.4 * * @category Class - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech */ @@ -26,17 +26,17 @@ * Do not edit the class manually. */ -namespace Shotstack\Client\Model; +namespace ShotstackClient\Model; use \ArrayAccess; -use \Shotstack\Client\ObjectSerializer; +use \ShotstackClient\ObjectSerializer; /** * Destinations Class Doc Comment * * @category Class - * @description A destination is a location where assets can be sent to for serving or hosting. Videos, images and audio files that are rendered by the [Edit API](#shotstack-edit) and [source](#tocs_source) and [rendition](#tocs_rendition) files generated by the [Ingest API](#shotstack-ingest) can be sent to destinations. You can also fetch a file from any public URL and [transfer](#transfer-asset) it to a destination. A file can be sent to one or more destinations including 3rd party destinations. By default all ingested and generated assets are automatically sent to the [Shotstack hosting destination](https://shotstack.io/docs/guide/serving-assets/hosting/). You can [opt-out](https://shotstack.io/docs/guide/serving-assets/self-host/) from by setting the Shotstack destination **exclude** property to **true**. The following destinations are available: <ul> <li><a href=\"#tocs_shotstackdestination\">ShotstackDestination</a></li> <li><a href=\"#tocs_muxdestination\">MuxDestination</a></li> <li><a href=\"#tocs_s3destination\">S3Destination</a></li> <li><a href=\"#tocs_googlecloudstoragedestination\">GoogleCloudStorageDestination</a></li> </ul> - * @package Shotstack\Client + * @description A destination is a location where assets can be sent to for serving or hosting. Videos, images and audio files that are rendered by the [Edit API](#shotstack-edit) and [source](#tocs_source) and [rendition](#tocs_rendition) files generated by the [Ingest API](#shotstack-ingest) can be sent to destinations. You can also fetch a file from any public URL and [transfer](#transfer-asset) it to a destination. A file can be sent to one or more destinations including 3rd party destinations. By default all ingested and generated assets are automatically sent to the [Shotstack hosting destination](https://shotstack.io/docs/guide/serving-assets/hosting/). You can [opt-out](https://shotstack.io/docs/guide/serving-assets/self-host/) from by setting the Shotstack destination **exclude** property to **true**. + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech * @implements \ArrayAccess @@ -60,7 +60,7 @@ class Destinations implements ModelInterface, ArrayAccess, \JsonSerializable protected static $openAPITypes = [ 'provider' => 'string', 'exclude' => 'bool', - 'options' => '\Shotstack\Client\Model\GoogleCloudStorageDestinationOptions' + 'options' => '\ShotstackClient\Model\DestinationsAnyOf2Options' ]; /** @@ -257,7 +257,7 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->setIfExists('provider', $data ?? [], 'google-cloud-storage'); + $this->setIfExists('provider', $data ?? [], 'azure-blob-storage'); $this->setIfExists('exclude', $data ?? [], null); $this->setIfExists('options', $data ?? [], null); @@ -295,6 +295,9 @@ public function listInvalidProperties() if ($this->container['provider'] === null) { $invalidProperties[] = "'provider' can't be null"; } + if ($this->container['options'] === null) { + $invalidProperties[] = "'options' can't be null"; + } return $invalidProperties; } @@ -323,7 +326,7 @@ public function getProvider() /** * Sets provider * - * @param string $provider The destination to send assets to - set to `google-cloud-storage` for Google Cloud Storage. + * @param string $provider The destination to send assets to - set to `azure-blob-storage` for Azure Blob Storage. * * @return self */ @@ -367,7 +370,7 @@ public function setExclude($exclude) /** * Gets options * - * @return \Shotstack\Client\Model\GoogleCloudStorageDestinationOptions|null + * @return \ShotstackClient\Model\DestinationsAnyOf2Options */ public function getOptions() { @@ -377,7 +380,7 @@ public function getOptions() /** * Sets options * - * @param \Shotstack\Client\Model\GoogleCloudStorageDestinationOptions|null $options options + * @param \ShotstackClient\Model\DestinationsAnyOf2Options $options options * * @return self */ diff --git a/src/Model/DIDGeneratedAsset.php b/src/Model/DestinationsAnyOf.php similarity index 82% rename from src/Model/DIDGeneratedAsset.php rename to src/Model/DestinationsAnyOf.php index 0857b95..ab677e9 100644 --- a/src/Model/DIDGeneratedAsset.php +++ b/src/Model/DestinationsAnyOf.php @@ -1,11 +1,11 @@ */ -class DIDGeneratedAsset implements ModelInterface, ArrayAccess, \JsonSerializable +class DestinationsAnyOf implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; @@ -50,7 +50,7 @@ class DIDGeneratedAsset implements ModelInterface, ArrayAccess, \JsonSerializabl * * @var string */ - protected static $openAPIModelName = 'DIDGeneratedAsset'; + protected static $openAPIModelName = 'Destinations_anyOf'; /** * Array of property to type mappings. Used for (de)serialization @@ -59,7 +59,7 @@ class DIDGeneratedAsset implements ModelInterface, ArrayAccess, \JsonSerializabl */ protected static $openAPITypes = [ 'provider' => 'string', - 'options' => '\Shotstack\Client\Model\DIDGeneratedAssetOptions' + 'options' => '\ShotstackClient\Model\DestinationsAnyOfOptions' ]; /** @@ -235,19 +235,6 @@ public function getModelName() return self::$openAPIModelName; } - public const PROVIDER_D_ID = 'd-id'; - - /** - * Gets allowable values of the enum - * - * @return string[] - */ - public function getProviderAllowableValues() - { - return [ - self::PROVIDER_D_ID, - ]; - } /** * Associative array for storing property values @@ -264,7 +251,7 @@ public function getProviderAllowableValues() */ public function __construct(array $data = null) { - $this->setIfExists('provider', $data ?? [], 'd-id'); + $this->setIfExists('provider', $data ?? [], 'tiktok'); $this->setIfExists('options', $data ?? [], null); } @@ -298,18 +285,6 @@ public function listInvalidProperties() if ($this->container['provider'] === null) { $invalidProperties[] = "'provider' can't be null"; } - $allowedValues = $this->getProviderAllowableValues(); - if (!is_null($this->container['provider']) && !in_array($this->container['provider'], $allowedValues, true)) { - $invalidProperties[] = sprintf( - "invalid value '%s' for 'provider', must be one of '%s'", - $this->container['provider'], - implode("', '", $allowedValues) - ); - } - - if ($this->container['options'] === null) { - $invalidProperties[] = "'options' can't be null"; - } return $invalidProperties; } @@ -338,7 +313,7 @@ public function getProvider() /** * Sets provider * - * @param string $provider The name of the provider - set to `d-id` for D-ID. + * @param string $provider The destination to send video to - set to `tiktok` for TikTok. * * @return self */ @@ -347,16 +322,6 @@ public function setProvider($provider) if (is_null($provider)) { throw new \InvalidArgumentException('non-nullable provider cannot be null'); } - $allowedValues = $this->getProviderAllowableValues(); - if (!in_array($provider, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value '%s' for 'provider', must be one of '%s'", - $provider, - implode("', '", $allowedValues) - ) - ); - } $this->container['provider'] = $provider; return $this; @@ -365,7 +330,7 @@ public function setProvider($provider) /** * Gets options * - * @return \Shotstack\Client\Model\DIDGeneratedAssetOptions + * @return \ShotstackClient\Model\DestinationsAnyOfOptions|null */ public function getOptions() { @@ -375,7 +340,7 @@ public function getOptions() /** * Sets options * - * @param \Shotstack\Client\Model\DIDGeneratedAssetOptions $options options + * @param \ShotstackClient\Model\DestinationsAnyOfOptions|null $options options * * @return self */ diff --git a/src/Model/ShotstackGeneratedAsset.php b/src/Model/DestinationsAnyOf1.php similarity index 81% rename from src/Model/ShotstackGeneratedAsset.php rename to src/Model/DestinationsAnyOf1.php index 475fc15..8a8b0df 100644 --- a/src/Model/ShotstackGeneratedAsset.php +++ b/src/Model/DestinationsAnyOf1.php @@ -1,11 +1,11 @@ */ -class ShotstackGeneratedAsset implements ModelInterface, ArrayAccess, \JsonSerializable +class DestinationsAnyOf1 implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; @@ -50,7 +50,7 @@ class ShotstackGeneratedAsset implements ModelInterface, ArrayAccess, \JsonSeria * * @var string */ - protected static $openAPIModelName = 'ShotstackGeneratedAsset'; + protected static $openAPIModelName = 'Destinations_anyOf_1'; /** * Array of property to type mappings. Used for (de)serialization @@ -59,7 +59,7 @@ class ShotstackGeneratedAsset implements ModelInterface, ArrayAccess, \JsonSeria */ protected static $openAPITypes = [ 'provider' => 'string', - 'options' => '\Shotstack\Client\Model\ShotstackGeneratedAssetOptions' + 'options' => '\ShotstackClient\Model\DestinationsAnyOf1Options' ]; /** @@ -235,19 +235,6 @@ public function getModelName() return self::$openAPIModelName; } - public const PROVIDER_SHOTSTACK = 'shotstack'; - - /** - * Gets allowable values of the enum - * - * @return string[] - */ - public function getProviderAllowableValues() - { - return [ - self::PROVIDER_SHOTSTACK, - ]; - } /** * Associative array for storing property values @@ -264,7 +251,7 @@ public function getProviderAllowableValues() */ public function __construct(array $data = null) { - $this->setIfExists('provider', $data ?? [], 'shotstack'); + $this->setIfExists('provider', $data ?? [], 'akamai-netstorage'); $this->setIfExists('options', $data ?? [], null); } @@ -298,18 +285,6 @@ public function listInvalidProperties() if ($this->container['provider'] === null) { $invalidProperties[] = "'provider' can't be null"; } - $allowedValues = $this->getProviderAllowableValues(); - if (!is_null($this->container['provider']) && !in_array($this->container['provider'], $allowedValues, true)) { - $invalidProperties[] = sprintf( - "invalid value '%s' for 'provider', must be one of '%s'", - $this->container['provider'], - implode("', '", $allowedValues) - ); - } - - if ($this->container['options'] === null) { - $invalidProperties[] = "'options' can't be null"; - } return $invalidProperties; } @@ -338,7 +313,7 @@ public function getProvider() /** * Sets provider * - * @param string $provider The name of the provider - set to `shotstack` for Shotstack. + * @param string $provider The destination to send assets to - set to `akamai-netstorage` for Akamai NetStorage. * * @return self */ @@ -347,16 +322,6 @@ public function setProvider($provider) if (is_null($provider)) { throw new \InvalidArgumentException('non-nullable provider cannot be null'); } - $allowedValues = $this->getProviderAllowableValues(); - if (!in_array($provider, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value '%s' for 'provider', must be one of '%s'", - $provider, - implode("', '", $allowedValues) - ) - ); - } $this->container['provider'] = $provider; return $this; @@ -365,7 +330,7 @@ public function setProvider($provider) /** * Gets options * - * @return \Shotstack\Client\Model\ShotstackGeneratedAssetOptions + * @return \ShotstackClient\Model\DestinationsAnyOf1Options|null */ public function getOptions() { @@ -375,7 +340,7 @@ public function getOptions() /** * Sets options * - * @param \Shotstack\Client\Model\ShotstackGeneratedAssetOptions $options options + * @param \ShotstackClient\Model\DestinationsAnyOf1Options|null $options options * * @return self */ diff --git a/src/Model/DestinationsAnyOf1Options.php b/src/Model/DestinationsAnyOf1Options.php new file mode 100644 index 0000000..14dfccf --- /dev/null +++ b/src/Model/DestinationsAnyOf1Options.php @@ -0,0 +1,532 @@ + + */ +class DestinationsAnyOf1Options implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Destinations_anyOf_1_options'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'host' => 'string', + 'cp_code' => 'string', + 'path' => 'string', + 'filename' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'host' => null, + 'cp_code' => null, + 'path' => null, + 'filename' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'host' => false, + 'cp_code' => false, + 'path' => true, + 'filename' => true + ]; + + /** + * 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; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $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 = [ + 'host' => 'host', + 'cp_code' => 'cpCode', + 'path' => 'path', + 'filename' => 'filename' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'host' => 'setHost', + 'cp_code' => 'setCpCode', + 'path' => 'setPath', + 'filename' => 'setFilename' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'host' => 'getHost', + 'cp_code' => 'getCpCode', + 'path' => 'getPath', + 'filename' => 'getFilename' + ]; + + /** + * 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) + { + $this->setIfExists('host', $data ?? [], null); + $this->setIfExists('cp_code', $data ?? [], null); + $this->setIfExists('path', $data ?? [], null); + $this->setIfExists('filename', $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 ($this->container['host'] === null) { + $invalidProperties[] = "'host' can't be null"; + } + if ($this->container['cp_code'] === null) { + $invalidProperties[] = "'cp_code' can't be null"; + } + 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 host + * + * @return string + */ + public function getHost() + { + return $this->container['host']; + } + + /** + * Sets host + * + * @param string $host The Akamai NetStorage hostname, i.e. `example-nsu.akamaihd.net`. + * + * @return self + */ + public function setHost($host) + { + if (is_null($host)) { + throw new \InvalidArgumentException('non-nullable host cannot be null'); + } + $this->container['host'] = $host; + + return $this; + } + + /** + * Gets cp_code + * + * @return string + */ + public function getCpCode() + { + return $this->container['cp_code']; + } + + /** + * Sets cp_code + * + * @param string $cp_code The Content Provider code (CP code) for the NetStorage upload directory. + * + * @return self + */ + public function setCpCode($cp_code) + { + if (is_null($cp_code)) { + throw new \InvalidArgumentException('non-nullable cp_code cannot be null'); + } + $this->container['cp_code'] = $cp_code; + + return $this; + } + + /** + * Gets path + * + * @return string|null + */ + public function getPath() + { + return $this->container['path']; + } + + /** + * Sets path + * + * @param string|null $path A remote directory path/prefix for the file being sent, i.e. `videos` or `customerId/videos`. + * + * @return self + */ + public function setPath($path) + { + if (is_null($path)) { + array_push($this->openAPINullablesSetToNull, 'path'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('path', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['path'] = $path; + + return $this; + } + + /** + * Gets filename + * + * @return string|null + */ + public function getFilename() + { + return $this->container['filename']; + } + + /** + * Sets filename + * + * @param string|null $filename Use your own filename instead of the default filenames generated by Shotstack. Note: omit the file extension as this will be appended depending on the output format. Also `-poster.jpg` and `-thumb.jpg` will be appended for poster and thumbnail images. + * + * @return self + */ + public function setFilename($filename) + { + if (is_null($filename)) { + array_push($this->openAPINullablesSetToNull, 'filename'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('filename', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['filename'] = $filename; + + 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() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/HeyGenGeneratedAsset.php b/src/Model/DestinationsAnyOf2.php similarity index 81% rename from src/Model/HeyGenGeneratedAsset.php rename to src/Model/DestinationsAnyOf2.php index 70d8cb8..9f2c6e9 100644 --- a/src/Model/HeyGenGeneratedAsset.php +++ b/src/Model/DestinationsAnyOf2.php @@ -1,11 +1,11 @@ */ -class HeyGenGeneratedAsset implements ModelInterface, ArrayAccess, \JsonSerializable +class DestinationsAnyOf2 implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; @@ -50,7 +50,7 @@ class HeyGenGeneratedAsset implements ModelInterface, ArrayAccess, \JsonSerializ * * @var string */ - protected static $openAPIModelName = 'HeyGenGeneratedAsset'; + protected static $openAPIModelName = 'Destinations_anyOf_2'; /** * Array of property to type mappings. Used for (de)serialization @@ -59,7 +59,7 @@ class HeyGenGeneratedAsset implements ModelInterface, ArrayAccess, \JsonSerializ */ protected static $openAPITypes = [ 'provider' => 'string', - 'options' => '\Shotstack\Client\Model\HeyGenGeneratedAssetOptions' + 'options' => '\ShotstackClient\Model\DestinationsAnyOf2Options' ]; /** @@ -235,19 +235,6 @@ public function getModelName() return self::$openAPIModelName; } - public const PROVIDER_HEYGEN = 'heygen'; - - /** - * Gets allowable values of the enum - * - * @return string[] - */ - public function getProviderAllowableValues() - { - return [ - self::PROVIDER_HEYGEN, - ]; - } /** * Associative array for storing property values @@ -264,7 +251,7 @@ public function getProviderAllowableValues() */ public function __construct(array $data = null) { - $this->setIfExists('provider', $data ?? [], 'heygen'); + $this->setIfExists('provider', $data ?? [], 'azure-blob-storage'); $this->setIfExists('options', $data ?? [], null); } @@ -298,18 +285,6 @@ public function listInvalidProperties() if ($this->container['provider'] === null) { $invalidProperties[] = "'provider' can't be null"; } - $allowedValues = $this->getProviderAllowableValues(); - if (!is_null($this->container['provider']) && !in_array($this->container['provider'], $allowedValues, true)) { - $invalidProperties[] = sprintf( - "invalid value '%s' for 'provider', must be one of '%s'", - $this->container['provider'], - implode("', '", $allowedValues) - ); - } - - if ($this->container['options'] === null) { - $invalidProperties[] = "'options' can't be null"; - } return $invalidProperties; } @@ -338,7 +313,7 @@ public function getProvider() /** * Sets provider * - * @param string $provider The name of the provider - set to `heygen` for HeyGen. + * @param string $provider The destination to send assets to - set to `azure-blob-storage` for Azure Blob Storage. * * @return self */ @@ -347,16 +322,6 @@ public function setProvider($provider) if (is_null($provider)) { throw new \InvalidArgumentException('non-nullable provider cannot be null'); } - $allowedValues = $this->getProviderAllowableValues(); - if (!in_array($provider, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value '%s' for 'provider', must be one of '%s'", - $provider, - implode("', '", $allowedValues) - ) - ); - } $this->container['provider'] = $provider; return $this; @@ -365,7 +330,7 @@ public function setProvider($provider) /** * Gets options * - * @return \Shotstack\Client\Model\HeyGenGeneratedAssetOptions + * @return \ShotstackClient\Model\DestinationsAnyOf2Options|null */ public function getOptions() { @@ -375,7 +340,7 @@ public function getOptions() /** * Sets options * - * @param \Shotstack\Client\Model\HeyGenGeneratedAssetOptions $options options + * @param \ShotstackClient\Model\DestinationsAnyOf2Options|null $options options * * @return self */ diff --git a/src/Model/DestinationsAnyOf2Options.php b/src/Model/DestinationsAnyOf2Options.php new file mode 100644 index 0000000..16fc179 --- /dev/null +++ b/src/Model/DestinationsAnyOf2Options.php @@ -0,0 +1,532 @@ + + */ +class DestinationsAnyOf2Options implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Destinations_anyOf_2_options'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'account_name' => 'string', + 'container' => 'string', + 'prefix' => 'string', + 'filename' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'account_name' => null, + 'container' => null, + 'prefix' => null, + 'filename' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'account_name' => false, + 'container' => false, + 'prefix' => true, + 'filename' => true + ]; + + /** + * 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; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $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 = [ + 'account_name' => 'accountName', + 'container' => 'container', + 'prefix' => 'prefix', + 'filename' => 'filename' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'account_name' => 'setAccountName', + 'container' => 'setContainer', + 'prefix' => 'setPrefix', + 'filename' => 'setFilename' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'account_name' => 'getAccountName', + 'container' => 'getContainer', + 'prefix' => 'getPrefix', + 'filename' => 'getFilename' + ]; + + /** + * 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) + { + $this->setIfExists('account_name', $data ?? [], null); + $this->setIfExists('container', $data ?? [], null); + $this->setIfExists('prefix', $data ?? [], null); + $this->setIfExists('filename', $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 ($this->container['account_name'] === null) { + $invalidProperties[] = "'account_name' can't be null"; + } + if ($this->container['container'] === null) { + $invalidProperties[] = "'container' can't be null"; + } + 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 account_name + * + * @return string + */ + public function getAccountName() + { + return $this->container['account_name']; + } + + /** + * Sets account_name + * + * @param string $account_name The Azure Storage account name. + * + * @return self + */ + public function setAccountName($account_name) + { + if (is_null($account_name)) { + throw new \InvalidArgumentException('non-nullable account_name cannot be null'); + } + $this->container['account_name'] = $account_name; + + return $this; + } + + /** + * Gets container + * + * @return string + */ + public function getContainer() + { + return $this->container['container']; + } + + /** + * Sets container + * + * @param string $container The Blob container name. The container must exist in the Azure Storage account before files can be sent. + * + * @return self + */ + public function setContainer($container) + { + if (is_null($container)) { + throw new \InvalidArgumentException('non-nullable container cannot be null'); + } + $this->container['container'] = $container; + + return $this; + } + + /** + * Gets prefix + * + * @return string|null + */ + public function getPrefix() + { + return $this->container['prefix']; + } + + /** + * Sets prefix + * + * @param string|null $prefix A virtual directory prefix for the blob being sent, i.e. `videos` or `customerId/videos`. + * + * @return self + */ + public function setPrefix($prefix) + { + if (is_null($prefix)) { + array_push($this->openAPINullablesSetToNull, 'prefix'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('prefix', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['prefix'] = $prefix; + + return $this; + } + + /** + * Gets filename + * + * @return string|null + */ + public function getFilename() + { + return $this->container['filename']; + } + + /** + * Sets filename + * + * @param string|null $filename Use your own filename instead of the default filenames generated by Shotstack. Note: omit the file extension as this will be appended depending on the output format. Also `-poster.jpg` and `-thumb.jpg` will be appended for poster and thumbnail images. + * + * @return self + */ + public function setFilename($filename) + { + if (is_null($filename)) { + array_push($this->openAPINullablesSetToNull, 'filename'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('filename', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['filename'] = $filename; + + 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() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/OpenAiGeneratedAssetOptions.php b/src/Model/DestinationsAnyOfOptions.php similarity index 61% rename from src/Model/OpenAiGeneratedAssetOptions.php rename to src/Model/DestinationsAnyOfOptions.php index 814cd31..e927120 100644 --- a/src/Model/OpenAiGeneratedAssetOptions.php +++ b/src/Model/DestinationsAnyOfOptions.php @@ -1,11 +1,11 @@ */ -class OpenAiGeneratedAssetOptions implements ModelInterface, ArrayAccess, \JsonSerializable +class DestinationsAnyOfOptions implements ModelInterface, ArrayAccess, \JsonSerializable { - public const DISCRIMINATOR = 'type'; + public const DISCRIMINATOR = null; /** * The original name of the model. * * @var string */ - protected static $openAPIModelName = 'OpenAiGeneratedAssetOptions'; + protected static $openAPIModelName = 'Destinations_anyOf_options'; /** * Array of property to type mappings. Used for (de)serialization @@ -58,10 +58,11 @@ class OpenAiGeneratedAssetOptions implements ModelInterface, ArrayAccess, \JsonS * @var string[] */ protected static $openAPITypes = [ - 'type' => 'string', - 'prompt' => 'string', - 'model' => 'string', - 'system_prompt' => 'string' + 'title' => 'string', + 'privacy_level' => 'string', + 'disable_duet' => 'bool', + 'disable_stitch' => 'bool', + 'disable_comment' => 'bool' ]; /** @@ -72,10 +73,11 @@ class OpenAiGeneratedAssetOptions implements ModelInterface, ArrayAccess, \JsonS * @psalm-var array */ protected static $openAPIFormats = [ - 'type' => null, - 'prompt' => null, - 'model' => null, - 'system_prompt' => null + 'title' => null, + 'privacy_level' => null, + 'disable_duet' => null, + 'disable_stitch' => null, + 'disable_comment' => null ]; /** @@ -84,10 +86,11 @@ class OpenAiGeneratedAssetOptions implements ModelInterface, ArrayAccess, \JsonS * @var boolean[] */ protected static array $openAPINullables = [ - 'type' => false, - 'prompt' => false, - 'model' => false, - 'system_prompt' => false + 'title' => false, + 'privacy_level' => false, + 'disable_duet' => false, + 'disable_stitch' => false, + 'disable_comment' => false ]; /** @@ -176,10 +179,11 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'type' => 'type', - 'prompt' => 'prompt', - 'model' => 'model', - 'system_prompt' => 'systemPrompt' + 'title' => 'title', + 'privacy_level' => 'privacyLevel', + 'disable_duet' => 'disableDuet', + 'disable_stitch' => 'disableStitch', + 'disable_comment' => 'disableComment' ]; /** @@ -188,10 +192,11 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'type' => 'setType', - 'prompt' => 'setPrompt', - 'model' => 'setModel', - 'system_prompt' => 'setSystemPrompt' + 'title' => 'setTitle', + 'privacy_level' => 'setPrivacyLevel', + 'disable_duet' => 'setDisableDuet', + 'disable_stitch' => 'setDisableStitch', + 'disable_comment' => 'setDisableComment' ]; /** @@ -200,10 +205,11 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'type' => 'getType', - 'prompt' => 'getPrompt', - 'model' => 'getModel', - 'system_prompt' => 'getSystemPrompt' + 'title' => 'getTitle', + 'privacy_level' => 'getPrivacyLevel', + 'disable_duet' => 'getDisableDuet', + 'disable_stitch' => 'getDisableStitch', + 'disable_comment' => 'getDisableComment' ]; /** @@ -247,32 +253,21 @@ public function getModelName() return self::$openAPIModelName; } - public const TYPE_TEXT_GENERATOR = 'text-generator'; - public const MODEL__3_5_TURBO = 'gpt-3.5-turbo'; - public const MODEL__4 = 'gpt-4'; + public const PRIVACY_LEVEL__PUBLIC = 'public'; + public const PRIVACY_LEVEL_FRIENDS = 'friends'; + public const PRIVACY_LEVEL__PRIVATE = 'private'; /** * Gets allowable values of the enum * * @return string[] */ - public function getTypeAllowableValues() + public function getPrivacyLevelAllowableValues() { return [ - self::TYPE_TEXT_GENERATOR, - ]; - } - - /** - * Gets allowable values of the enum - * - * @return string[] - */ - public function getModelAllowableValues() - { - return [ - self::MODEL__3_5_TURBO, - self::MODEL__4, + self::PRIVACY_LEVEL__PUBLIC, + self::PRIVACY_LEVEL_FRIENDS, + self::PRIVACY_LEVEL__PRIVATE, ]; } @@ -291,13 +286,11 @@ public function getModelAllowableValues() */ public function __construct(array $data = null) { - $this->setIfExists('type', $data ?? [], 'text-generator'); - $this->setIfExists('prompt', $data ?? [], null); - $this->setIfExists('model', $data ?? [], null); - $this->setIfExists('system_prompt', $data ?? [], null); - - // Initialize discriminator property with the model name. - $this->container['type'] = static::$openAPIModelName; + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('privacy_level', $data ?? [], 'private'); + $this->setIfExists('disable_duet', $data ?? [], false); + $this->setIfExists('disable_stitch', $data ?? [], false); + $this->setIfExists('disable_comment', $data ?? [], false); } /** @@ -327,29 +320,15 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['type'] === null) { - $invalidProperties[] = "'type' can't be null"; - } - $allowedValues = $this->getTypeAllowableValues(); - if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { - $invalidProperties[] = sprintf( - "invalid value '%s' for 'type', must be one of '%s'", - $this->container['type'], - implode("', '", $allowedValues) - ); + if (!is_null($this->container['title']) && (mb_strlen($this->container['title']) > 150)) { + $invalidProperties[] = "invalid value for 'title', the character length must be smaller than or equal to 150."; } - if ($this->container['prompt'] === null) { - $invalidProperties[] = "'prompt' can't be null"; - } - if ($this->container['model'] === null) { - $invalidProperties[] = "'model' can't be null"; - } - $allowedValues = $this->getModelAllowableValues(); - if (!is_null($this->container['model']) && !in_array($this->container['model'], $allowedValues, true)) { + $allowedValues = $this->getPrivacyLevelAllowableValues(); + if (!is_null($this->container['privacy_level']) && !in_array($this->container['privacy_level'], $allowedValues, true)) { $invalidProperties[] = sprintf( - "invalid value '%s' for 'model', must be one of '%s'", - $this->container['model'], + "invalid value '%s' for 'privacy_level', must be one of '%s'", + $this->container['privacy_level'], implode("', '", $allowedValues) ); } @@ -370,129 +349,150 @@ public function valid() /** - * Gets type + * Gets title * - * @return string + * @return string|null + */ + public function getTitle() + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param string|null $title A title for the video that will be displayed on TikTok. + * + * @return self + */ + public function setTitle($title) + { + if (is_null($title)) { + throw new \InvalidArgumentException('non-nullable title cannot be null'); + } + if ((mb_strlen($title) > 150)) { + throw new \InvalidArgumentException('invalid length for $title when calling DestinationsAnyOfOptions., must be smaller than or equal to 150.'); + } + + $this->container['title'] = $title; + + return $this; + } + + /** + * Gets privacy_level + * + * @return string|null */ - public function getType() + public function getPrivacyLevel() { - return $this->container['type']; + return $this->container['privacy_level']; } /** - * Sets type + * Sets privacy_level * - * @param string $type The type of asset to generate - set to `text-generator` for text generation. + * @param string|null $privacy_level The privacy level for the video. Options are:
  • `public` - video is visible to everyone
  • `friends` - video is visible to friends only
  • `private` - video is only visible to you
* * @return self */ - public function setType($type) + public function setPrivacyLevel($privacy_level) { - if (is_null($type)) { - throw new \InvalidArgumentException('non-nullable type cannot be null'); + if (is_null($privacy_level)) { + throw new \InvalidArgumentException('non-nullable privacy_level cannot be null'); } - $allowedValues = $this->getTypeAllowableValues(); - if (!in_array($type, $allowedValues, true)) { + $allowedValues = $this->getPrivacyLevelAllowableValues(); + if (!in_array($privacy_level, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( - "Invalid value '%s' for 'type', must be one of '%s'", - $type, + "Invalid value '%s' for 'privacy_level', must be one of '%s'", + $privacy_level, implode("', '", $allowedValues) ) ); } - $this->container['type'] = $type; + $this->container['privacy_level'] = $privacy_level; return $this; } /** - * Gets prompt + * Gets disable_duet * - * @return string + * @return bool|null */ - public function getPrompt() + public function getDisableDuet() { - return $this->container['prompt']; + return $this->container['disable_duet']; } /** - * Sets prompt + * Sets disable_duet * - * @param string $prompt The text prompt to generate text from. + * @param bool|null $disable_duet Disable the Duet feature for this video. * * @return self */ - public function setPrompt($prompt) + public function setDisableDuet($disable_duet) { - if (is_null($prompt)) { - throw new \InvalidArgumentException('non-nullable prompt cannot be null'); + if (is_null($disable_duet)) { + throw new \InvalidArgumentException('non-nullable disable_duet cannot be null'); } - $this->container['prompt'] = $prompt; + $this->container['disable_duet'] = $disable_duet; return $this; } /** - * Gets model + * Gets disable_stitch * - * @return string + * @return bool|null */ - public function getModel() + public function getDisableStitch() { - return $this->container['model']; + return $this->container['disable_stitch']; } /** - * Sets model + * Sets disable_stitch * - * @param string $model The model to use for generating the text. Select from the list of available models:
  • `gpt-3.5-turbo`
  • `gpt-4`
+ * @param bool|null $disable_stitch Disable the Stitch feature for this video. * * @return self */ - public function setModel($model) + public function setDisableStitch($disable_stitch) { - if (is_null($model)) { - throw new \InvalidArgumentException('non-nullable model cannot be null'); - } - $allowedValues = $this->getModelAllowableValues(); - if (!in_array($model, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value '%s' for 'model', must be one of '%s'", - $model, - implode("', '", $allowedValues) - ) - ); + if (is_null($disable_stitch)) { + throw new \InvalidArgumentException('non-nullable disable_stitch cannot be null'); } - $this->container['model'] = $model; + $this->container['disable_stitch'] = $disable_stitch; return $this; } /** - * Gets system_prompt + * Gets disable_comment * - * @return string|null + * @return bool|null */ - public function getSystemPrompt() + public function getDisableComment() { - return $this->container['system_prompt']; + return $this->container['disable_comment']; } /** - * Sets system_prompt + * Sets disable_comment * - * @param string|null $system_prompt The system prompt to use for generating the text. This is an optional prompt that can be used to provide context or additional information to the model. + * @param bool|null $disable_comment Disable comments on this video. * * @return self */ - public function setSystemPrompt($system_prompt) + public function setDisableComment($disable_comment) { - if (is_null($system_prompt)) { - throw new \InvalidArgumentException('non-nullable system_prompt cannot be null'); + if (is_null($disable_comment)) { + throw new \InvalidArgumentException('non-nullable disable_comment cannot be null'); } - $this->container['system_prompt'] = $system_prompt; + $this->container['disable_comment'] = $disable_comment; return $this; } diff --git a/src/Model/DolbyEnhancement.php b/src/Model/DolbyEnhancement.php index c69059c..9714ab6 100644 --- a/src/Model/DolbyEnhancement.php +++ b/src/Model/DolbyEnhancement.php @@ -5,7 +5,7 @@ * PHP version 7.4 * * @category Class - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech */ @@ -26,17 +26,17 @@ * Do not edit the class manually. */ -namespace Shotstack\Client\Model; +namespace ShotstackClient\Model; use \ArrayAccess; -use \Shotstack\Client\ObjectSerializer; +use \ShotstackClient\ObjectSerializer; /** * DolbyEnhancement Class Doc Comment * * @category Class * @description Dolby.io audio enhancement provider. Credentials are required and must be added via the [dashboard](https://dashboard.shotstack.io/integrations/dolby), not in the request. - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech * @implements \ArrayAccess @@ -59,7 +59,7 @@ class DolbyEnhancement implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPITypes = [ 'provider' => 'string', - 'options' => '\Shotstack\Client\Model\DolbyEnhancementOptions' + 'options' => '\ShotstackClient\Model\DolbyEnhancementOptions' ]; /** @@ -333,7 +333,7 @@ public function setProvider($provider) /** * Gets options * - * @return \Shotstack\Client\Model\DolbyEnhancementOptions + * @return \ShotstackClient\Model\DolbyEnhancementOptions */ public function getOptions() { @@ -343,7 +343,7 @@ public function getOptions() /** * Sets options * - * @param \Shotstack\Client\Model\DolbyEnhancementOptions $options options + * @param \ShotstackClient\Model\DolbyEnhancementOptions $options options * * @return self */ diff --git a/src/Model/DolbyEnhancementOptions.php b/src/Model/DolbyEnhancementOptions.php index 06af91b..50d1f9b 100644 --- a/src/Model/DolbyEnhancementOptions.php +++ b/src/Model/DolbyEnhancementOptions.php @@ -5,7 +5,7 @@ * PHP version 7.4 * * @category Class - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech */ @@ -26,17 +26,17 @@ * Do not edit the class manually. */ -namespace Shotstack\Client\Model; +namespace ShotstackClient\Model; use \ArrayAccess; -use \Shotstack\Client\ObjectSerializer; +use \ShotstackClient\ObjectSerializer; /** * DolbyEnhancementOptions Class Doc Comment * * @category Class * @description Options for the Dolby.io audio enhancement provider. - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech * @implements \ArrayAccess diff --git a/src/Model/Edit.php b/src/Model/Edit.php index a468b73..ce7ee16 100644 --- a/src/Model/Edit.php +++ b/src/Model/Edit.php @@ -5,7 +5,7 @@ * PHP version 7.4 * * @category Class - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech */ @@ -26,17 +26,17 @@ * Do not edit the class manually. */ -namespace Shotstack\Client\Model; +namespace ShotstackClient\Model; use \ArrayAccess; -use \Shotstack\Client\ObjectSerializer; +use \ShotstackClient\ObjectSerializer; /** * Edit Class Doc Comment * * @category Class - * @description An edit defines the arrangement of a video on a timeline, an audio edit or an image design and the output format. - * @package Shotstack\Client + * @description An edit defines the arrangement of a video on a timeline, an audio edit or an image design and the output format. Video assets are automatically preprocessed to fix common compatibility issues before rendering. You can control preprocessing behavior using the `transcode` flag on video assets. + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech * @implements \ArrayAccess @@ -58,11 +58,12 @@ class Edit implements ModelInterface, ArrayAccess, \JsonSerializable * @var string[] */ protected static $openAPITypes = [ - 'timeline' => '\Shotstack\Client\Model\Timeline', - 'output' => '\Shotstack\Client\Model\Output', - 'merge' => '\Shotstack\Client\Model\MergeField[]', + 'timeline' => '\ShotstackClient\Model\Timeline', + 'output' => '\ShotstackClient\Model\Output', + 'merge' => '\ShotstackClient\Model\MergeField[]', 'callback' => 'string', - 'disk' => 'string' + 'disk' => 'string', + 'instance' => 'string' ]; /** @@ -77,7 +78,8 @@ class Edit implements ModelInterface, ArrayAccess, \JsonSerializable 'output' => null, 'merge' => null, 'callback' => null, - 'disk' => null + 'disk' => null, + 'instance' => null ]; /** @@ -90,7 +92,8 @@ class Edit implements ModelInterface, ArrayAccess, \JsonSerializable 'output' => false, 'merge' => false, 'callback' => false, - 'disk' => false + 'disk' => false, + 'instance' => false ]; /** @@ -183,7 +186,8 @@ public function isNullableSetToNull(string $property): bool 'output' => 'output', 'merge' => 'merge', 'callback' => 'callback', - 'disk' => 'disk' + 'disk' => 'disk', + 'instance' => 'instance' ]; /** @@ -196,7 +200,8 @@ public function isNullableSetToNull(string $property): bool 'output' => 'setOutput', 'merge' => 'setMerge', 'callback' => 'setCallback', - 'disk' => 'setDisk' + 'disk' => 'setDisk', + 'instance' => 'setInstance' ]; /** @@ -209,7 +214,8 @@ public function isNullableSetToNull(string $property): bool 'output' => 'getOutput', 'merge' => 'getMerge', 'callback' => 'getCallback', - 'disk' => 'getDisk' + 'disk' => 'getDisk', + 'instance' => 'getInstance' ]; /** @@ -255,6 +261,9 @@ public function getModelName() public const DISK_LOCAL = 'local'; public const DISK_MOUNT = 'mount'; + public const INSTANCE_S1 = 's1'; + public const INSTANCE_S2 = 's2'; + public const INSTANCE_A1 = 'a1'; /** * Gets allowable values of the enum @@ -269,6 +278,20 @@ public function getDiskAllowableValues() ]; } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getInstanceAllowableValues() + { + return [ + self::INSTANCE_S1, + self::INSTANCE_S2, + self::INSTANCE_A1, + ]; + } + /** * Associative array for storing property values * @@ -289,6 +312,7 @@ public function __construct(array $data = null) $this->setIfExists('merge', $data ?? [], null); $this->setIfExists('callback', $data ?? [], null); $this->setIfExists('disk', $data ?? [], null); + $this->setIfExists('instance', $data ?? [], 's1'); } /** @@ -333,6 +357,15 @@ public function listInvalidProperties() ); } + $allowedValues = $this->getInstanceAllowableValues(); + if (!is_null($this->container['instance']) && !in_array($this->container['instance'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'instance', must be one of '%s'", + $this->container['instance'], + implode("', '", $allowedValues) + ); + } + return $invalidProperties; } @@ -351,7 +384,7 @@ public function valid() /** * Gets timeline * - * @return \Shotstack\Client\Model\Timeline + * @return \ShotstackClient\Model\Timeline */ public function getTimeline() { @@ -361,7 +394,7 @@ public function getTimeline() /** * Sets timeline * - * @param \Shotstack\Client\Model\Timeline $timeline timeline + * @param \ShotstackClient\Model\Timeline $timeline timeline * * @return self */ @@ -378,7 +411,7 @@ public function setTimeline($timeline) /** * Gets output * - * @return \Shotstack\Client\Model\Output + * @return \ShotstackClient\Model\Output */ public function getOutput() { @@ -388,7 +421,7 @@ public function getOutput() /** * Sets output * - * @param \Shotstack\Client\Model\Output $output output + * @param \ShotstackClient\Model\Output $output output * * @return self */ @@ -405,7 +438,7 @@ public function setOutput($output) /** * Gets merge * - * @return \Shotstack\Client\Model\MergeField[]|null + * @return \ShotstackClient\Model\MergeField[]|null */ public function getMerge() { @@ -415,7 +448,7 @@ public function getMerge() /** * Sets merge * - * @param \Shotstack\Client\Model\MergeField[]|null $merge An array of key/value pairs that provides an easy way to create templates with placeholders. The placeholders can be used to find and replace keys with values. For example you can search for the placeholder `{{NAME}}` and replace it with the value `Jane`. + * @param \ShotstackClient\Model\MergeField[]|null $merge An array of key/value pairs that provides an easy way to create templates with placeholders. The placeholders can be used to find and replace keys with values. For example you can search for the placeholder `{{NAME}}` and replace it with the value `Jane`. * * @return self */ @@ -494,6 +527,43 @@ public function setDisk($disk) return $this; } + + /** + * Gets instance + * + * @return string|null + */ + public function getInstance() + { + return $this->container['instance']; + } + + /** + * Sets instance + * + * @param string|null $instance The render instance type to use for processing the edit.
  • `s1` - standard instance (default)
  • `s2` - standard instance with more resources
  • `a1` - accelerated instance for faster rendering
+ * + * @return self + */ + public function setInstance($instance) + { + if (is_null($instance)) { + throw new \InvalidArgumentException('non-nullable instance cannot be null'); + } + $allowedValues = $this->getInstanceAllowableValues(); + if (!in_array($instance, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'instance', must be one of '%s'", + $instance, + implode("', '", $allowedValues) + ) + ); + } + $this->container['instance'] = $instance; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/src/Model/Enhancements.php b/src/Model/Enhancements.php index 053b89f..cdad5aa 100644 --- a/src/Model/Enhancements.php +++ b/src/Model/Enhancements.php @@ -5,7 +5,7 @@ * PHP version 7.4 * * @category Class - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech */ @@ -26,17 +26,17 @@ * Do not edit the class manually. */ -namespace Shotstack\Client\Model; +namespace ShotstackClient\Model; use \ArrayAccess; -use \Shotstack\Client\ObjectSerializer; +use \ShotstackClient\ObjectSerializer; /** * Enhancements Class Doc Comment * * @category Class * @description Enhancements that can be applied to a rendition. Currently only supports the Dolby audio enhancement. - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech * @implements \ArrayAccess @@ -58,7 +58,7 @@ class Enhancements implements ModelInterface, ArrayAccess, \JsonSerializable * @var string[] */ protected static $openAPITypes = [ - 'audio' => '\Shotstack\Client\Model\AudioEnhancement' + 'audio' => '\ShotstackClient\Model\AudioEnhancement' ]; /** @@ -293,7 +293,7 @@ public function valid() /** * Gets audio * - * @return \Shotstack\Client\Model\AudioEnhancement|null + * @return \ShotstackClient\Model\AudioEnhancement|null */ public function getAudio() { @@ -303,7 +303,7 @@ public function getAudio() /** * Sets audio * - * @param \Shotstack\Client\Model\AudioEnhancement|null $audio audio + * @param \ShotstackClient\Model\AudioEnhancement|null $audio audio * * @return self */ diff --git a/src/Model/FlipTransformation.php b/src/Model/FlipTransformation.php index bea3460..c994058 100644 --- a/src/Model/FlipTransformation.php +++ b/src/Model/FlipTransformation.php @@ -5,7 +5,7 @@ * PHP version 7.4 * * @category Class - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech */ @@ -26,17 +26,17 @@ * Do not edit the class manually. */ -namespace Shotstack\Client\Model; +namespace ShotstackClient\Model; use \ArrayAccess; -use \Shotstack\Client\ObjectSerializer; +use \ShotstackClient\ObjectSerializer; /** * FlipTransformation Class Doc Comment * * @category Class * @description Flip a clip vertically or horizontally. Acts as a mirror effect of the clip along the selected plane. - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech * @implements \ArrayAccess diff --git a/src/Model/Font.php b/src/Model/Font.php index 81b61bb..eab33db 100644 --- a/src/Model/Font.php +++ b/src/Model/Font.php @@ -5,7 +5,7 @@ * PHP version 7.4 * * @category Class - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech */ @@ -26,17 +26,17 @@ * Do not edit the class manually. */ -namespace Shotstack\Client\Model; +namespace ShotstackClient\Model; use \ArrayAccess; -use \Shotstack\Client\ObjectSerializer; +use \ShotstackClient\ObjectSerializer; /** * Font Class Doc Comment * * @category Class * @description Download a custom font to use with the HTML asset type, using the font name in the CSS or font tag. See our [custom fonts](https://shotstack.io/learn/html-custom-fonts/) getting started guide for more details. - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech * @implements \ArrayAccess diff --git a/src/Model/GeneratedAsset.php b/src/Model/GeneratedAsset.php deleted file mode 100644 index 67fe0c9..0000000 --- a/src/Model/GeneratedAsset.php +++ /dev/null @@ -1,485 +0,0 @@ - - */ -class GeneratedAsset implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = 'provider'; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'GeneratedAsset'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'provider' => 'string', - 'options' => '\Shotstack\Client\Model\StabilityAiGeneratedAssetOptions' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'provider' => null, - 'options' => null - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static array $openAPINullables = [ - 'provider' => false, - 'options' => 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; - } - - /** - * Setter - Array of nullable field names deliberately set to null - * - * @param boolean[] $openAPINullablesSetToNull - */ - private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void - { - $this->openAPINullablesSetToNull = $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 = [ - 'provider' => 'provider', - 'options' => 'options' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'provider' => 'setProvider', - 'options' => 'setOptions' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'provider' => 'getProvider', - 'options' => 'getOptions' - ]; - - /** - * 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 PROVIDER_STABILITY_AI = 'stability-ai'; - - /** - * Gets allowable values of the enum - * - * @return string[] - */ - public function getProviderAllowableValues() - { - return [ - self::PROVIDER_STABILITY_AI, - ]; - } - - /** - * 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) - { - $this->setIfExists('provider', $data ?? [], 'stability-ai'); - $this->setIfExists('options', $data ?? [], null); - - // Initialize discriminator property with the model name. - $this->container['provider'] = static::$openAPIModelName; - } - - /** - * 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 ($this->container['provider'] === null) { - $invalidProperties[] = "'provider' can't be null"; - } - $allowedValues = $this->getProviderAllowableValues(); - if (!is_null($this->container['provider']) && !in_array($this->container['provider'], $allowedValues, true)) { - $invalidProperties[] = sprintf( - "invalid value '%s' for 'provider', must be one of '%s'", - $this->container['provider'], - implode("', '", $allowedValues) - ); - } - - if ($this->container['options'] === null) { - $invalidProperties[] = "'options' can't be null"; - } - 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 provider - * - * @return string - */ - public function getProvider() - { - return $this->container['provider']; - } - - /** - * Sets provider - * - * @param string $provider The name of the provider - set to `stability-ai` for Stability AI. - * - * @return self - */ - public function setProvider($provider) - { - if (is_null($provider)) { - throw new \InvalidArgumentException('non-nullable provider cannot be null'); - } - $allowedValues = $this->getProviderAllowableValues(); - if (!in_array($provider, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value '%s' for 'provider', must be one of '%s'", - $provider, - implode("', '", $allowedValues) - ) - ); - } - $this->container['provider'] = $provider; - - return $this; - } - - /** - * Gets options - * - * @return \Shotstack\Client\Model\StabilityAiGeneratedAssetOptions - */ - public function getOptions() - { - return $this->container['options']; - } - - /** - * Sets options - * - * @param \Shotstack\Client\Model\StabilityAiGeneratedAssetOptions $options options - * - * @return self - */ - public function setOptions($options) - { - if (is_null($options)) { - throw new \InvalidArgumentException('non-nullable options cannot be null'); - } - $this->container['options'] = $options; - - 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() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/src/Model/GoogleCloudStorageDestination.php b/src/Model/GoogleCloudStorageDestination.php index 6f21724..4d4c0eb 100644 --- a/src/Model/GoogleCloudStorageDestination.php +++ b/src/Model/GoogleCloudStorageDestination.php @@ -5,7 +5,7 @@ * PHP version 7.4 * * @category Class - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech */ @@ -26,17 +26,17 @@ * Do not edit the class manually. */ -namespace Shotstack\Client\Model; +namespace ShotstackClient\Model; use \ArrayAccess; -use \Shotstack\Client\ObjectSerializer; +use \ShotstackClient\ObjectSerializer; /** * GoogleCloudStorageDestination Class Doc Comment * * @category Class * @description Send videos and assets to a [Google Cloud Storage](https://cloud.google.com/storage) bucket. Send files with your own prefix and filename. Google Cloud credentials are required and added via the [dashboard](https://dashboard.shotstack.io/integrations/google-cloud-storage), not in the request. - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech * @implements \ArrayAccess @@ -59,7 +59,7 @@ class GoogleCloudStorageDestination implements ModelInterface, ArrayAccess, \Jso */ protected static $openAPITypes = [ 'provider' => 'string', - 'options' => '\Shotstack\Client\Model\GoogleCloudStorageDestinationOptions' + 'options' => '\ShotstackClient\Model\GoogleCloudStorageDestinationOptions' ]; /** @@ -330,7 +330,7 @@ public function setProvider($provider) /** * Gets options * - * @return \Shotstack\Client\Model\GoogleCloudStorageDestinationOptions|null + * @return \ShotstackClient\Model\GoogleCloudStorageDestinationOptions|null */ public function getOptions() { @@ -340,7 +340,7 @@ public function getOptions() /** * Sets options * - * @param \Shotstack\Client\Model\GoogleCloudStorageDestinationOptions|null $options options + * @param \ShotstackClient\Model\GoogleCloudStorageDestinationOptions|null $options options * * @return self */ diff --git a/src/Model/GoogleCloudStorageDestinationOptions.php b/src/Model/GoogleCloudStorageDestinationOptions.php index 2e1bdd8..2b0bbee 100644 --- a/src/Model/GoogleCloudStorageDestinationOptions.php +++ b/src/Model/GoogleCloudStorageDestinationOptions.php @@ -5,7 +5,7 @@ * PHP version 7.4 * * @category Class - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech */ @@ -26,17 +26,17 @@ * Do not edit the class manually. */ -namespace Shotstack\Client\Model; +namespace ShotstackClient\Model; use \ArrayAccess; -use \Shotstack\Client\ObjectSerializer; +use \ShotstackClient\ObjectSerializer; /** * GoogleCloudStorageDestinationOptions Class Doc Comment * * @category Class * @description Pass additional options to control how files are stored in Google Cloud Storage. - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech * @implements \ArrayAccess diff --git a/src/Model/GoogleDriveDestination.php b/src/Model/GoogleDriveDestination.php index e94194e..4fdccbb 100644 --- a/src/Model/GoogleDriveDestination.php +++ b/src/Model/GoogleDriveDestination.php @@ -5,7 +5,7 @@ * PHP version 7.4 * * @category Class - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech */ @@ -26,17 +26,17 @@ * Do not edit the class manually. */ -namespace Shotstack\Client\Model; +namespace ShotstackClient\Model; use \ArrayAccess; -use \Shotstack\Client\ObjectSerializer; +use \ShotstackClient\ObjectSerializer; /** * GoogleDriveDestination Class Doc Comment * * @category Class * @description Send rendered videos and assets to the [Google Drive](https://shotstack.io/docs/guide/serving-assets/destinations/google-drive/) cloud storage service. Google Drive uses OAuth and you must authenticate and link your Google account via [dashboard](https://dashboard.shotstack.io/integrations/google-drive), not in the request. - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech * @implements \ArrayAccess @@ -59,7 +59,7 @@ class GoogleDriveDestination implements ModelInterface, ArrayAccess, \JsonSerial */ protected static $openAPITypes = [ 'provider' => 'string', - 'options' => '\Shotstack\Client\Model\GoogleDriveDestinationOptions' + 'options' => '\ShotstackClient\Model\GoogleDriveDestinationOptions' ]; /** @@ -333,7 +333,7 @@ public function setProvider($provider) /** * Gets options * - * @return \Shotstack\Client\Model\GoogleDriveDestinationOptions + * @return \ShotstackClient\Model\GoogleDriveDestinationOptions */ public function getOptions() { @@ -343,7 +343,7 @@ public function getOptions() /** * Sets options * - * @param \Shotstack\Client\Model\GoogleDriveDestinationOptions $options options + * @param \ShotstackClient\Model\GoogleDriveDestinationOptions $options options * * @return self */ diff --git a/src/Model/GoogleDriveDestinationOptions.php b/src/Model/GoogleDriveDestinationOptions.php index c3bba10..3530bfa 100644 --- a/src/Model/GoogleDriveDestinationOptions.php +++ b/src/Model/GoogleDriveDestinationOptions.php @@ -5,7 +5,7 @@ * PHP version 7.4 * * @category Class - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech */ @@ -26,17 +26,17 @@ * Do not edit the class manually. */ -namespace Shotstack\Client\Model; +namespace ShotstackClient\Model; use \ArrayAccess; -use \Shotstack\Client\ObjectSerializer; +use \ShotstackClient\ObjectSerializer; /** * GoogleDriveDestinationOptions Class Doc Comment * * @category Class * @description Pass the folder ID and options to configure how assets are stored in Google Drive. - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech * @implements \ArrayAccess diff --git a/src/Model/HeyGenGeneratedAssetOptions.php b/src/Model/HeyGenGeneratedAssetOptions.php deleted file mode 100644 index 2baefb9..0000000 --- a/src/Model/HeyGenGeneratedAssetOptions.php +++ /dev/null @@ -1,1041 +0,0 @@ - - */ -class HeyGenGeneratedAssetOptions implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = 'type'; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'HeyGenGeneratedAssetOptions'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'type' => 'string', - 'text' => 'string', - 'avatar' => 'string', - 'voice' => 'string', - 'avatar_style' => 'string', - 'background' => 'string', - 'ratio' => 'string', - 'test' => 'bool' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'type' => null, - 'text' => null, - 'avatar' => null, - 'voice' => null, - 'avatar_style' => null, - 'background' => null, - 'ratio' => null, - 'test' => null - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static array $openAPINullables = [ - 'type' => false, - 'text' => false, - 'avatar' => false, - 'voice' => false, - 'avatar_style' => false, - 'background' => false, - 'ratio' => 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; - } - - /** - * Setter - Array of nullable field names deliberately set to null - * - * @param boolean[] $openAPINullablesSetToNull - */ - private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void - { - $this->openAPINullablesSetToNull = $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 = [ - 'type' => 'type', - 'text' => 'text', - 'avatar' => 'avatar', - 'voice' => 'voice', - 'avatar_style' => 'avatarStyle', - 'background' => 'background', - 'ratio' => 'ratio', - 'test' => 'test' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'type' => 'setType', - 'text' => 'setText', - 'avatar' => 'setAvatar', - 'voice' => 'setVoice', - 'avatar_style' => 'setAvatarStyle', - 'background' => 'setBackground', - 'ratio' => 'setRatio', - 'test' => 'setTest' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'type' => 'getType', - 'text' => 'getText', - 'avatar' => 'getAvatar', - 'voice' => 'getVoice', - 'avatar_style' => 'getAvatarStyle', - 'background' => 'getBackground', - 'ratio' => 'getRatio', - '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; - } - - public const TYPE_TEXT_TO_AVATAR = 'text-to-avatar'; - public const AVATAR_ANGELA = 'Angela'; - public const AVATAR_BILL = 'Bill'; - public const AVATAR_DAISY = 'Daisy'; - public const AVATAR_DEREK = 'Derek'; - public const AVATAR_EVA = 'Eva'; - public const AVATAR_JAKE = 'Jake'; - public const AVATAR_JEFF = 'Jeff'; - public const AVATAR_JEROME = 'Jerome'; - public const AVATAR_JOON = 'Joon'; - public const AVATAR_KAYLA = 'Kayla'; - public const AVATAR_KENT = 'Kent'; - public const AVATAR_LUNA = 'Luna'; - public const AVATAR_MARK = 'Mark'; - public const AVATAR_MATTHEW = 'Matthew'; - public const AVATAR_MONICA = 'Monica'; - public const AVATAR_PETER = 'Peter'; - public const AVATAR_SELINA = 'Selina'; - public const AVATAR_TANYA = 'Tanya'; - public const AVATAR_THOMAS = 'Thomas'; - public const AVATAR_TINA = 'Tina'; - public const AVATAR_TYLER = 'Tyler'; - public const AVATAR_VANESSA = 'Vanessa'; - public const AVATAR_VERA = 'Vera'; - public const AVATAR_WILSON = 'Wilson'; - public const AVATAR_ZOEY = 'Zoey'; - public const VOICE_ABBI___NATURAL = 'Abbi - Natural'; - public const VOICE_ADAM___NATURAL = 'Adam - Natural'; - public const VOICE_AISTON___FRIENDLY = 'Aiston - Friendly'; - public const VOICE_ALICE___NEWSCASTER = 'Alice - Newscaster'; - public const VOICE_ALISON___CHEERFUL = 'Alison - Cheerful'; - public const VOICE_AMBER___FRIENDLY = 'Amber - Friendly'; - public const VOICE_AMY___WARM = 'Amy - Warm'; - public const VOICE_ANA___CHEERFUL = 'Ana - Cheerful'; - public const VOICE_ANTONI___FRIENDLY = 'Antoni - Friendly'; - public const VOICE_ARIA___NEWSCASTER = 'Aria - Newscaster'; - public const VOICE_ARNOLD___CHEERFUL = 'Arnold - Cheerful'; - public const VOICE_ARTHUR___NATURAL = 'Arthur - Natural'; - public const VOICE_BELLA___FRIENDLY = 'Bella - Friendly'; - public const VOICE_BELLE___NATURAL = 'Belle - Natural'; - public const VOICE_BRANDON___WARM = 'Brandon - Warm'; - public const VOICE_BRIAN___NATURAL = 'Brian - Natural'; - public const VOICE_BRUCE___NATURAL = 'Bruce - Natural'; - public const VOICE_CERISE___CHEERFUL = 'Cerise - Cheerful'; - public const VOICE_CHRISTOPHER___CALM = 'Christopher - Calm'; - public const VOICE_CLARA___PROFESSIONAL = 'Clara - Professional'; - public const VOICE_CONNOR___NATURAL = 'Connor - Natural'; - public const VOICE_DAHLIA___FRIENDLY = 'Dahlia - Friendly'; - public const VOICE_DAVIS___PROFESSIONAL = 'Davis - Professional'; - public const VOICE_DEAN___NATURAL = 'Dean - Natural'; - public const VOICE_DELBERT___CHEERFUL = 'Delbert - Cheerful'; - public const VOICE_EDWARD___FRIENDLY = 'Edward - Friendly'; - public const VOICE_ELAINE___CALM = 'Elaine - Calm'; - public const VOICE_EMILY___NATURAL = 'Emily - Natural'; - public const VOICE_EMMA___NEWSCASTER = 'Emma - Newscaster'; - public const VOICE_ERIC___NEWSCASTER = 'Eric - Newscaster'; - public const VOICE_GRACE___NATURAL = 'Grace - Natural'; - public const VOICE_HAILEY___CALM = 'Hailey - Calm'; - public const VOICE_INDIRA___CHEERFUL = 'Indira - Cheerful'; - public const VOICE_ISABELLA___CHEERFUL = 'Isabella - Cheerful'; - public const VOICE_JACOB___NATURAL = 'Jacob - Natural'; - public const VOICE_JAHMAI___FRIENDLY = 'Jahmai - Friendly'; - public const VOICE_JANE___SERIOUS = 'Jane - Serious'; - public const VOICE_JASON___SERIOUS = 'Jason - Serious'; - public const VOICE_JELLE___FRIENDLY = 'Jelle - Friendly'; - public const VOICE_JEN___NATURAL = 'Jen - Natural'; - public const VOICE_JENNY___PROFESSIONAL = 'Jenny - Professional'; - public const VOICE_JODI___CHEERFUL = 'Jodi - Cheerful'; - public const VOICE_JOEY___CALM = 'Joey - Calm'; - public const VOICE_JOHAN___FRIENDLY = 'Johan - Friendly'; - public const VOICE_JOSIE___CHEERFUL = 'Josie - Cheerful'; - public const VOICE_KEANAN___NATURAL = 'Keanan - Natural'; - public const VOICE_KEITH___CHEERFUL = 'Keith - Cheerful'; - public const VOICE_KELLIE___FRIENDLY = 'Kellie - Friendly'; - public const VOICE_LAUREN___FRIENDLY = 'Lauren - Friendly'; - public const VOICE_LEAH___NATURAL = 'Leah - Natural'; - public const VOICE_LIAM___PROFESSIONAL = 'Liam - Professional'; - public const VOICE_LIBBY___NATURAL = 'Libby - Natural'; - public const VOICE_LILY___PROFESSIONAL = 'Lily - Professional'; - public const VOICE_LUCAS___NATURAL = 'Lucas - Natural'; - public const VOICE_LUKE___PROFESSIONAL = 'Luke - Professional'; - public const VOICE_LUNA___NATURAL = 'Luna - Natural'; - public const VOICE_MARIEKE___NATURAL = 'Marieke - Natural'; - public const VOICE_MATTHEW___PROFESSIONAL = 'Matthew - Professional'; - public const VOICE_MICHELLE___NATURAL = 'Michelle - Natural'; - public const VOICE_MITCHELL___NATURAL = 'Mitchell - Natural'; - public const VOICE_MOLLY___NEWSCASTER = 'Molly - Newscaster'; - public const VOICE_MONICA___CALM = 'Monica - Calm'; - public const VOICE_NATASHA___PROFESSIONAL = 'Natasha - Professional'; - public const VOICE_NEERJA___NEWSCASTER = 'Neerja - Newscaster'; - public const VOICE_NOAH___SERIOUS = 'Noah - Serious'; - public const VOICE_OLIVER___NEWSCASTER = 'Oliver - Newscaster'; - public const VOICE_OLIVIA___CALM = 'Olivia - Calm'; - public const VOICE_PAUL___NATURAL = 'Paul - Natural'; - public const VOICE_PRABHAT___NATURAL = 'Prabhat - Natural'; - public const VOICE_RAVEENA___NATURAL = 'Raveena - Natural'; - public const VOICE_RUDI___FRIENDLY = 'Rudi - Friendly'; - public const VOICE_RYAN___PROFESSIONAL = 'Ryan - Professional'; - public const VOICE_SAM___NATURAL = 'Sam - Natural'; - public const VOICE_SARA___CHEERFUL = 'Sara - Cheerful'; - public const VOICE_SHERRY___FRIENDLY = 'Sherry - Friendly'; - public const VOICE_SONIA___WARM = 'Sonia - Warm'; - public const VOICE_THOMAS___NATURAL = 'Thomas - Natural'; - public const VOICE_TODD___PROFESSIONAL = 'Todd - Professional'; - public const VOICE_TONY___PROFESSIONAL = 'Tony - Professional'; - public const VOICE_TRACY___CHEERFUL = 'Tracy - Cheerful'; - public const VOICE_WAYNE___NATURAL = 'Wayne - Natural'; - public const VOICE_WILDER___NATURAL = 'Wilder - Natural'; - public const VOICE_WILLE___NATURAL = 'Wille - Natural'; - public const VOICE_WILLIAM___FRIENDLY = 'William - Friendly'; - public const AVATAR_STYLE_NORMAL = 'normal'; - public const AVATAR_STYLE_CIRCLE = 'circle'; - public const RATIO__169 = '16:9'; - public const RATIO__916 = '9:16'; - - /** - * Gets allowable values of the enum - * - * @return string[] - */ - public function getTypeAllowableValues() - { - return [ - self::TYPE_TEXT_TO_AVATAR, - ]; - } - - /** - * Gets allowable values of the enum - * - * @return string[] - */ - public function getAvatarAllowableValues() - { - return [ - self::AVATAR_ANGELA, - self::AVATAR_BILL, - self::AVATAR_DAISY, - self::AVATAR_DEREK, - self::AVATAR_EVA, - self::AVATAR_JAKE, - self::AVATAR_JEFF, - self::AVATAR_JEROME, - self::AVATAR_JOON, - self::AVATAR_KAYLA, - self::AVATAR_KENT, - self::AVATAR_LUNA, - self::AVATAR_MARK, - self::AVATAR_MATTHEW, - self::AVATAR_MONICA, - self::AVATAR_PETER, - self::AVATAR_SELINA, - self::AVATAR_TANYA, - self::AVATAR_THOMAS, - self::AVATAR_TINA, - self::AVATAR_TYLER, - self::AVATAR_VANESSA, - self::AVATAR_VERA, - self::AVATAR_WILSON, - self::AVATAR_ZOEY, - ]; - } - - /** - * Gets allowable values of the enum - * - * @return string[] - */ - public function getVoiceAllowableValues() - { - return [ - self::VOICE_ABBI___NATURAL, - self::VOICE_ADAM___NATURAL, - self::VOICE_AISTON___FRIENDLY, - self::VOICE_ALICE___NEWSCASTER, - self::VOICE_ALISON___CHEERFUL, - self::VOICE_AMBER___FRIENDLY, - self::VOICE_AMY___WARM, - self::VOICE_ANA___CHEERFUL, - self::VOICE_ANTONI___FRIENDLY, - self::VOICE_ARIA___NEWSCASTER, - self::VOICE_ARNOLD___CHEERFUL, - self::VOICE_ARTHUR___NATURAL, - self::VOICE_BELLA___FRIENDLY, - self::VOICE_BELLE___NATURAL, - self::VOICE_BRANDON___WARM, - self::VOICE_BRIAN___NATURAL, - self::VOICE_BRUCE___NATURAL, - self::VOICE_CERISE___CHEERFUL, - self::VOICE_CHRISTOPHER___CALM, - self::VOICE_CLARA___PROFESSIONAL, - self::VOICE_CONNOR___NATURAL, - self::VOICE_DAHLIA___FRIENDLY, - self::VOICE_DAVIS___PROFESSIONAL, - self::VOICE_DEAN___NATURAL, - self::VOICE_DELBERT___CHEERFUL, - self::VOICE_EDWARD___FRIENDLY, - self::VOICE_ELAINE___CALM, - self::VOICE_EMILY___NATURAL, - self::VOICE_EMMA___NEWSCASTER, - self::VOICE_ERIC___NEWSCASTER, - self::VOICE_GRACE___NATURAL, - self::VOICE_HAILEY___CALM, - self::VOICE_INDIRA___CHEERFUL, - self::VOICE_ISABELLA___CHEERFUL, - self::VOICE_JACOB___NATURAL, - self::VOICE_JAHMAI___FRIENDLY, - self::VOICE_JANE___SERIOUS, - self::VOICE_JASON___SERIOUS, - self::VOICE_JELLE___FRIENDLY, - self::VOICE_JEN___NATURAL, - self::VOICE_JENNY___PROFESSIONAL, - self::VOICE_JODI___CHEERFUL, - self::VOICE_JOEY___CALM, - self::VOICE_JOHAN___FRIENDLY, - self::VOICE_JOSIE___CHEERFUL, - self::VOICE_KEANAN___NATURAL, - self::VOICE_KEITH___CHEERFUL, - self::VOICE_KELLIE___FRIENDLY, - self::VOICE_LAUREN___FRIENDLY, - self::VOICE_LEAH___NATURAL, - self::VOICE_LIAM___PROFESSIONAL, - self::VOICE_LIBBY___NATURAL, - self::VOICE_LILY___PROFESSIONAL, - self::VOICE_LUCAS___NATURAL, - self::VOICE_LUKE___PROFESSIONAL, - self::VOICE_LUNA___NATURAL, - self::VOICE_MARIEKE___NATURAL, - self::VOICE_MATTHEW___PROFESSIONAL, - self::VOICE_MICHELLE___NATURAL, - self::VOICE_MITCHELL___NATURAL, - self::VOICE_MOLLY___NEWSCASTER, - self::VOICE_MONICA___CALM, - self::VOICE_NATASHA___PROFESSIONAL, - self::VOICE_NEERJA___NEWSCASTER, - self::VOICE_NOAH___SERIOUS, - self::VOICE_OLIVER___NEWSCASTER, - self::VOICE_OLIVIA___CALM, - self::VOICE_PAUL___NATURAL, - self::VOICE_PRABHAT___NATURAL, - self::VOICE_RAVEENA___NATURAL, - self::VOICE_RUDI___FRIENDLY, - self::VOICE_RYAN___PROFESSIONAL, - self::VOICE_SAM___NATURAL, - self::VOICE_SARA___CHEERFUL, - self::VOICE_SHERRY___FRIENDLY, - self::VOICE_SONIA___WARM, - self::VOICE_THOMAS___NATURAL, - self::VOICE_TODD___PROFESSIONAL, - self::VOICE_TONY___PROFESSIONAL, - self::VOICE_TRACY___CHEERFUL, - self::VOICE_WAYNE___NATURAL, - self::VOICE_WILDER___NATURAL, - self::VOICE_WILLE___NATURAL, - self::VOICE_WILLIAM___FRIENDLY, - ]; - } - - /** - * Gets allowable values of the enum - * - * @return string[] - */ - public function getAvatarStyleAllowableValues() - { - return [ - self::AVATAR_STYLE_NORMAL, - self::AVATAR_STYLE_CIRCLE, - ]; - } - - /** - * Gets allowable values of the enum - * - * @return string[] - */ - public function getRatioAllowableValues() - { - return [ - self::RATIO__169, - self::RATIO__916, - ]; - } - - /** - * 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) - { - $this->setIfExists('type', $data ?? [], null); - $this->setIfExists('text', $data ?? [], null); - $this->setIfExists('avatar', $data ?? [], null); - $this->setIfExists('voice', $data ?? [], null); - $this->setIfExists('avatar_style', $data ?? [], null); - $this->setIfExists('background', $data ?? [], null); - $this->setIfExists('ratio', $data ?? [], null); - $this->setIfExists('test', $data ?? [], null); - - // Initialize discriminator property with the model name. - $this->container['type'] = static::$openAPIModelName; - } - - /** - * 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 ($this->container['type'] === null) { - $invalidProperties[] = "'type' can't be null"; - } - $allowedValues = $this->getTypeAllowableValues(); - if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { - $invalidProperties[] = sprintf( - "invalid value '%s' for 'type', must be one of '%s'", - $this->container['type'], - implode("', '", $allowedValues) - ); - } - - if ($this->container['text'] === null) { - $invalidProperties[] = "'text' can't be null"; - } - if ($this->container['avatar'] === null) { - $invalidProperties[] = "'avatar' can't be null"; - } - $allowedValues = $this->getAvatarAllowableValues(); - if (!is_null($this->container['avatar']) && !in_array($this->container['avatar'], $allowedValues, true)) { - $invalidProperties[] = sprintf( - "invalid value '%s' for 'avatar', must be one of '%s'", - $this->container['avatar'], - implode("', '", $allowedValues) - ); - } - - if ($this->container['voice'] === null) { - $invalidProperties[] = "'voice' can't be null"; - } - $allowedValues = $this->getVoiceAllowableValues(); - if (!is_null($this->container['voice']) && !in_array($this->container['voice'], $allowedValues, true)) { - $invalidProperties[] = sprintf( - "invalid value '%s' for 'voice', must be one of '%s'", - $this->container['voice'], - implode("', '", $allowedValues) - ); - } - - $allowedValues = $this->getAvatarStyleAllowableValues(); - if (!is_null($this->container['avatar_style']) && !in_array($this->container['avatar_style'], $allowedValues, true)) { - $invalidProperties[] = sprintf( - "invalid value '%s' for 'avatar_style', must be one of '%s'", - $this->container['avatar_style'], - implode("', '", $allowedValues) - ); - } - - $allowedValues = $this->getRatioAllowableValues(); - if (!is_null($this->container['ratio']) && !in_array($this->container['ratio'], $allowedValues, true)) { - $invalidProperties[] = sprintf( - "invalid value '%s' for 'ratio', must be one of '%s'", - $this->container['ratio'], - 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 type - * - * @return string - */ - public function getType() - { - return $this->container['type']; - } - - /** - * Sets type - * - * @param string $type The type of asset to generate - set to `text-to-avatar` for text-to-avatar. - * - * @return self - */ - public function setType($type) - { - if (is_null($type)) { - throw new \InvalidArgumentException('non-nullable type cannot be null'); - } - $allowedValues = $this->getTypeAllowableValues(); - if (!in_array($type, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value '%s' for 'type', must be one of '%s'", - $type, - implode("', '", $allowedValues) - ) - ); - } - $this->container['type'] = $type; - - return $this; - } - - /** - * Gets text - * - * @return string - */ - public function getText() - { - return $this->container['text']; - } - - /** - * Sets text - * - * @param string $text The text or script that the avatar will narrate. - * - * @return self - */ - public function setText($text) - { - if (is_null($text)) { - throw new \InvalidArgumentException('non-nullable text cannot be null'); - } - $this->container['text'] = $text; - - return $this; - } - - /** - * Gets avatar - * - * @return string - */ - public function getAvatar() - { - return $this->container['avatar']; - } - - /** - * Sets avatar - * - * @param string $avatar The avatar character to generate. Select from the list of available avatars:
  • `Angela`
  • `Bill`
  • `Daisy`
  • `Derek`
  • `Eva`
  • `Jake`
  • `Jeff`
  • `Jerome`
  • `Joon`
  • `Kayla`
  • `Kent`
  • `Luna`
  • `Mark`
  • `Matthew`
  • `Monica`
  • `Peter`
  • `Selina`
  • `Tanya`
  • `Thomas`
  • `Tina`
  • `Tyler`
  • `Vanessa`
  • `Vera`
  • `Wilson`
  • `Zoey`
- * - * @return self - */ - public function setAvatar($avatar) - { - if (is_null($avatar)) { - throw new \InvalidArgumentException('non-nullable avatar cannot be null'); - } - $allowedValues = $this->getAvatarAllowableValues(); - if (!in_array($avatar, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value '%s' for 'avatar', must be one of '%s'", - $avatar, - implode("', '", $allowedValues) - ) - ); - } - $this->container['avatar'] = $avatar; - - return $this; - } - - /** - * Gets voice - * - * @return string - */ - public function getVoice() - { - return $this->container['voice']; - } - - /** - * Sets voice - * - * @param string $voice The avatars voice and speaking style. Select from the list of available voices:
  • `Abb- - Natural`
  • `Adam - Natural`
  • `Aiston - Friendly`
  • `Alice - Newscaster`
  • `Alison - Cheerful`
  • `Amber - Friendly`
  • `Amy - Warm`
  • `Ana - Cheerful`
  • `Antoni - Friendly`
  • `Aria - Newscaster`
  • `Arnold - Cheerful`
  • `Arthur - Natural`
  • `Bella - Friendly`
  • `Belle - Natural`
  • `Brandon - Warm`
  • `Brian - Natural`
  • `Bruce - Natural`
  • `Cerise - Cheerful`
  • `Christopher - Calm`
  • `Clara - Professional`
  • `Connor - Natural`
  • `Dahlia - Friendly`
  • `Davis - Professional`
  • `Dean - Natural`
  • `Delbert - Cheerful`
  • `Edward - Friendly`
  • `Elaine - Calm`
  • `Emily - Natural`
  • `Emma - Newscaster`
  • `Eric - Newscaster`
  • `Grace - Natural`
  • `Hailey - Calm`
  • `Indira - Cheerful`
  • `Isabella - Cheerful`
  • `Jacob - Natural`
  • `Jahmai - Friendly`
  • `Jane - Serious`
  • `Jason - Serious`
  • `Jelle - Friendly`
  • `Jen - Natural`
  • `Jenny - Professional`
  • `Jodi - Cheerful`
  • `Joey - Calm`
  • `Johan - Friendly`
  • `Josie - Cheerful`
  • `Keanan - Natural`
  • `Keith - Cheerful`
  • `Kellie - Friendly`
  • `Lauren - Friendly`
  • `Leah - Natural`
  • `Liam - Professional`
  • `Libby - Natural`
  • `Lily - Professional`
  • `Lucas - Natural`
  • `Luke - Professional`
  • `Luna - Natural`
  • `Marieke - Natural`
  • `Matthew - Professional`
  • `Michelle - Natural`
  • `Mitchell - Natural`
  • `Molly - Newscaster`
  • `Monica - Calm`
  • `Natasha - Professional`
  • `Neerja - Newscaster`
  • `Noah - Serious`
  • `Oliver - Newscaster`
  • `Olivia - Calm`
  • `Paul - Natural`
  • `Prabhat - Natural`
  • `Raveena - Natural`
  • `Rudi - Friendly`
  • `Ryan - Professional`
  • `Sam - Natural`
  • `Sara - Cheerful`
  • `Sherry - Friendly`
  • `Sonia - Warm`
  • `Thomas - Natural`
  • `Todd - Professional`
  • `Tony - Professional`
  • `Tracy - Cheerful`
  • `Wayne - Natural`
  • `Wilder - Natural`
  • `Wille - Natural`
  • `William - Friendly`
- * - * @return self - */ - public function setVoice($voice) - { - if (is_null($voice)) { - throw new \InvalidArgumentException('non-nullable voice cannot be null'); - } - $allowedValues = $this->getVoiceAllowableValues(); - if (!in_array($voice, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value '%s' for 'voice', must be one of '%s'", - $voice, - implode("', '", $allowedValues) - ) - ); - } - $this->container['voice'] = $voice; - - return $this; - } - - /** - * Gets avatar_style - * - * @return string|null - */ - public function getAvatarStyle() - { - return $this->container['avatar_style']; - } - - /** - * Sets avatar_style - * - * @param string|null $avatar_style The display style of the avatar, a rectangle `normal` or circular `circle` background. Defaults to `normal`. - * - * @return self - */ - public function setAvatarStyle($avatar_style) - { - if (is_null($avatar_style)) { - throw new \InvalidArgumentException('non-nullable avatar_style cannot be null'); - } - $allowedValues = $this->getAvatarStyleAllowableValues(); - if (!in_array($avatar_style, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value '%s' for 'avatar_style', must be one of '%s'", - $avatar_style, - implode("', '", $allowedValues) - ) - ); - } - $this->container['avatar_style'] = $avatar_style; - - return $this; - } - - /** - * Gets background - * - * @return string|null - */ - public function getBackground() - { - return $this->container['background']; - } - - /** - * Sets background - * - * @param string|null $background The background color of the video. Defaults to `#ffffff`. - * - * @return self - */ - public function setBackground($background) - { - if (is_null($background)) { - throw new \InvalidArgumentException('non-nullable background cannot be null'); - } - $this->container['background'] = $background; - - return $this; - } - - /** - * Gets ratio - * - * @return string|null - */ - public function getRatio() - { - return $this->container['ratio']; - } - - /** - * Sets ratio - * - * @param string|null $ratio The aspect ratio of the video, `16:9` horizontal or `9:16` vertical. Defaults to `16:9`. - * - * @return self - */ - public function setRatio($ratio) - { - if (is_null($ratio)) { - throw new \InvalidArgumentException('non-nullable ratio cannot be null'); - } - $allowedValues = $this->getRatioAllowableValues(); - if (!in_array($ratio, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value '%s' for 'ratio', must be one of '%s'", - $ratio, - implode("', '", $allowedValues) - ) - ); - } - $this->container['ratio'] = $ratio; - - return $this; - } - - /** - * Gets test - * - * @return bool|null - */ - public function getTest() - { - return $this->container['test']; - } - - /** - * Sets test - * - * @param bool|null $test A boolean flag indicating whether the video is for testing purposes. See the \"test\" parameter in [HeyGen](https://docs.heygen.com/reference/generate-video) for more details. - * - * @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() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/src/Model/HeyGenTextToAvatarOptions.php b/src/Model/HeyGenTextToAvatarOptions.php deleted file mode 100644 index 82d343a..0000000 --- a/src/Model/HeyGenTextToAvatarOptions.php +++ /dev/null @@ -1,1038 +0,0 @@ - - */ -class HeyGenTextToAvatarOptions implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'HeyGenTextToAvatarOptions'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'type' => 'string', - 'text' => 'string', - 'avatar' => 'string', - 'voice' => 'string', - 'avatar_style' => 'string', - 'background' => 'string', - 'ratio' => 'string', - 'test' => 'bool' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'type' => null, - 'text' => null, - 'avatar' => null, - 'voice' => null, - 'avatar_style' => null, - 'background' => null, - 'ratio' => null, - 'test' => null - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static array $openAPINullables = [ - 'type' => false, - 'text' => false, - 'avatar' => false, - 'voice' => false, - 'avatar_style' => false, - 'background' => false, - 'ratio' => 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; - } - - /** - * Setter - Array of nullable field names deliberately set to null - * - * @param boolean[] $openAPINullablesSetToNull - */ - private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void - { - $this->openAPINullablesSetToNull = $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 = [ - 'type' => 'type', - 'text' => 'text', - 'avatar' => 'avatar', - 'voice' => 'voice', - 'avatar_style' => 'avatarStyle', - 'background' => 'background', - 'ratio' => 'ratio', - 'test' => 'test' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'type' => 'setType', - 'text' => 'setText', - 'avatar' => 'setAvatar', - 'voice' => 'setVoice', - 'avatar_style' => 'setAvatarStyle', - 'background' => 'setBackground', - 'ratio' => 'setRatio', - 'test' => 'setTest' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'type' => 'getType', - 'text' => 'getText', - 'avatar' => 'getAvatar', - 'voice' => 'getVoice', - 'avatar_style' => 'getAvatarStyle', - 'background' => 'getBackground', - 'ratio' => 'getRatio', - '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; - } - - public const TYPE_TEXT_TO_AVATAR = 'text-to-avatar'; - public const AVATAR_ANGELA = 'Angela'; - public const AVATAR_BILL = 'Bill'; - public const AVATAR_DAISY = 'Daisy'; - public const AVATAR_DEREK = 'Derek'; - public const AVATAR_EVA = 'Eva'; - public const AVATAR_JAKE = 'Jake'; - public const AVATAR_JEFF = 'Jeff'; - public const AVATAR_JEROME = 'Jerome'; - public const AVATAR_JOON = 'Joon'; - public const AVATAR_KAYLA = 'Kayla'; - public const AVATAR_KENT = 'Kent'; - public const AVATAR_LUNA = 'Luna'; - public const AVATAR_MARK = 'Mark'; - public const AVATAR_MATTHEW = 'Matthew'; - public const AVATAR_MONICA = 'Monica'; - public const AVATAR_PETER = 'Peter'; - public const AVATAR_SELINA = 'Selina'; - public const AVATAR_TANYA = 'Tanya'; - public const AVATAR_THOMAS = 'Thomas'; - public const AVATAR_TINA = 'Tina'; - public const AVATAR_TYLER = 'Tyler'; - public const AVATAR_VANESSA = 'Vanessa'; - public const AVATAR_VERA = 'Vera'; - public const AVATAR_WILSON = 'Wilson'; - public const AVATAR_ZOEY = 'Zoey'; - public const VOICE_ABBI___NATURAL = 'Abbi - Natural'; - public const VOICE_ADAM___NATURAL = 'Adam - Natural'; - public const VOICE_AISTON___FRIENDLY = 'Aiston - Friendly'; - public const VOICE_ALICE___NEWSCASTER = 'Alice - Newscaster'; - public const VOICE_ALISON___CHEERFUL = 'Alison - Cheerful'; - public const VOICE_AMBER___FRIENDLY = 'Amber - Friendly'; - public const VOICE_AMY___WARM = 'Amy - Warm'; - public const VOICE_ANA___CHEERFUL = 'Ana - Cheerful'; - public const VOICE_ANTONI___FRIENDLY = 'Antoni - Friendly'; - public const VOICE_ARIA___NEWSCASTER = 'Aria - Newscaster'; - public const VOICE_ARNOLD___CHEERFUL = 'Arnold - Cheerful'; - public const VOICE_ARTHUR___NATURAL = 'Arthur - Natural'; - public const VOICE_BELLA___FRIENDLY = 'Bella - Friendly'; - public const VOICE_BELLE___NATURAL = 'Belle - Natural'; - public const VOICE_BRANDON___WARM = 'Brandon - Warm'; - public const VOICE_BRIAN___NATURAL = 'Brian - Natural'; - public const VOICE_BRUCE___NATURAL = 'Bruce - Natural'; - public const VOICE_CERISE___CHEERFUL = 'Cerise - Cheerful'; - public const VOICE_CHRISTOPHER___CALM = 'Christopher - Calm'; - public const VOICE_CLARA___PROFESSIONAL = 'Clara - Professional'; - public const VOICE_CONNOR___NATURAL = 'Connor - Natural'; - public const VOICE_DAHLIA___FRIENDLY = 'Dahlia - Friendly'; - public const VOICE_DAVIS___PROFESSIONAL = 'Davis - Professional'; - public const VOICE_DEAN___NATURAL = 'Dean - Natural'; - public const VOICE_DELBERT___CHEERFUL = 'Delbert - Cheerful'; - public const VOICE_EDWARD___FRIENDLY = 'Edward - Friendly'; - public const VOICE_ELAINE___CALM = 'Elaine - Calm'; - public const VOICE_EMILY___NATURAL = 'Emily - Natural'; - public const VOICE_EMMA___NEWSCASTER = 'Emma - Newscaster'; - public const VOICE_ERIC___NEWSCASTER = 'Eric - Newscaster'; - public const VOICE_GRACE___NATURAL = 'Grace - Natural'; - public const VOICE_HAILEY___CALM = 'Hailey - Calm'; - public const VOICE_INDIRA___CHEERFUL = 'Indira - Cheerful'; - public const VOICE_ISABELLA___CHEERFUL = 'Isabella - Cheerful'; - public const VOICE_JACOB___NATURAL = 'Jacob - Natural'; - public const VOICE_JAHMAI___FRIENDLY = 'Jahmai - Friendly'; - public const VOICE_JANE___SERIOUS = 'Jane - Serious'; - public const VOICE_JASON___SERIOUS = 'Jason - Serious'; - public const VOICE_JELLE___FRIENDLY = 'Jelle - Friendly'; - public const VOICE_JEN___NATURAL = 'Jen - Natural'; - public const VOICE_JENNY___PROFESSIONAL = 'Jenny - Professional'; - public const VOICE_JODI___CHEERFUL = 'Jodi - Cheerful'; - public const VOICE_JOEY___CALM = 'Joey - Calm'; - public const VOICE_JOHAN___FRIENDLY = 'Johan - Friendly'; - public const VOICE_JOSIE___CHEERFUL = 'Josie - Cheerful'; - public const VOICE_KEANAN___NATURAL = 'Keanan - Natural'; - public const VOICE_KEITH___CHEERFUL = 'Keith - Cheerful'; - public const VOICE_KELLIE___FRIENDLY = 'Kellie - Friendly'; - public const VOICE_LAUREN___FRIENDLY = 'Lauren - Friendly'; - public const VOICE_LEAH___NATURAL = 'Leah - Natural'; - public const VOICE_LIAM___PROFESSIONAL = 'Liam - Professional'; - public const VOICE_LIBBY___NATURAL = 'Libby - Natural'; - public const VOICE_LILY___PROFESSIONAL = 'Lily - Professional'; - public const VOICE_LUCAS___NATURAL = 'Lucas - Natural'; - public const VOICE_LUKE___PROFESSIONAL = 'Luke - Professional'; - public const VOICE_LUNA___NATURAL = 'Luna - Natural'; - public const VOICE_MARIEKE___NATURAL = 'Marieke - Natural'; - public const VOICE_MATTHEW___PROFESSIONAL = 'Matthew - Professional'; - public const VOICE_MICHELLE___NATURAL = 'Michelle - Natural'; - public const VOICE_MITCHELL___NATURAL = 'Mitchell - Natural'; - public const VOICE_MOLLY___NEWSCASTER = 'Molly - Newscaster'; - public const VOICE_MONICA___CALM = 'Monica - Calm'; - public const VOICE_NATASHA___PROFESSIONAL = 'Natasha - Professional'; - public const VOICE_NEERJA___NEWSCASTER = 'Neerja - Newscaster'; - public const VOICE_NOAH___SERIOUS = 'Noah - Serious'; - public const VOICE_OLIVER___NEWSCASTER = 'Oliver - Newscaster'; - public const VOICE_OLIVIA___CALM = 'Olivia - Calm'; - public const VOICE_PAUL___NATURAL = 'Paul - Natural'; - public const VOICE_PRABHAT___NATURAL = 'Prabhat - Natural'; - public const VOICE_RAVEENA___NATURAL = 'Raveena - Natural'; - public const VOICE_RUDI___FRIENDLY = 'Rudi - Friendly'; - public const VOICE_RYAN___PROFESSIONAL = 'Ryan - Professional'; - public const VOICE_SAM___NATURAL = 'Sam - Natural'; - public const VOICE_SARA___CHEERFUL = 'Sara - Cheerful'; - public const VOICE_SHERRY___FRIENDLY = 'Sherry - Friendly'; - public const VOICE_SONIA___WARM = 'Sonia - Warm'; - public const VOICE_THOMAS___NATURAL = 'Thomas - Natural'; - public const VOICE_TODD___PROFESSIONAL = 'Todd - Professional'; - public const VOICE_TONY___PROFESSIONAL = 'Tony - Professional'; - public const VOICE_TRACY___CHEERFUL = 'Tracy - Cheerful'; - public const VOICE_WAYNE___NATURAL = 'Wayne - Natural'; - public const VOICE_WILDER___NATURAL = 'Wilder - Natural'; - public const VOICE_WILLE___NATURAL = 'Wille - Natural'; - public const VOICE_WILLIAM___FRIENDLY = 'William - Friendly'; - public const AVATAR_STYLE_NORMAL = 'normal'; - public const AVATAR_STYLE_CIRCLE = 'circle'; - public const RATIO__169 = '16:9'; - public const RATIO__916 = '9:16'; - - /** - * Gets allowable values of the enum - * - * @return string[] - */ - public function getTypeAllowableValues() - { - return [ - self::TYPE_TEXT_TO_AVATAR, - ]; - } - - /** - * Gets allowable values of the enum - * - * @return string[] - */ - public function getAvatarAllowableValues() - { - return [ - self::AVATAR_ANGELA, - self::AVATAR_BILL, - self::AVATAR_DAISY, - self::AVATAR_DEREK, - self::AVATAR_EVA, - self::AVATAR_JAKE, - self::AVATAR_JEFF, - self::AVATAR_JEROME, - self::AVATAR_JOON, - self::AVATAR_KAYLA, - self::AVATAR_KENT, - self::AVATAR_LUNA, - self::AVATAR_MARK, - self::AVATAR_MATTHEW, - self::AVATAR_MONICA, - self::AVATAR_PETER, - self::AVATAR_SELINA, - self::AVATAR_TANYA, - self::AVATAR_THOMAS, - self::AVATAR_TINA, - self::AVATAR_TYLER, - self::AVATAR_VANESSA, - self::AVATAR_VERA, - self::AVATAR_WILSON, - self::AVATAR_ZOEY, - ]; - } - - /** - * Gets allowable values of the enum - * - * @return string[] - */ - public function getVoiceAllowableValues() - { - return [ - self::VOICE_ABBI___NATURAL, - self::VOICE_ADAM___NATURAL, - self::VOICE_AISTON___FRIENDLY, - self::VOICE_ALICE___NEWSCASTER, - self::VOICE_ALISON___CHEERFUL, - self::VOICE_AMBER___FRIENDLY, - self::VOICE_AMY___WARM, - self::VOICE_ANA___CHEERFUL, - self::VOICE_ANTONI___FRIENDLY, - self::VOICE_ARIA___NEWSCASTER, - self::VOICE_ARNOLD___CHEERFUL, - self::VOICE_ARTHUR___NATURAL, - self::VOICE_BELLA___FRIENDLY, - self::VOICE_BELLE___NATURAL, - self::VOICE_BRANDON___WARM, - self::VOICE_BRIAN___NATURAL, - self::VOICE_BRUCE___NATURAL, - self::VOICE_CERISE___CHEERFUL, - self::VOICE_CHRISTOPHER___CALM, - self::VOICE_CLARA___PROFESSIONAL, - self::VOICE_CONNOR___NATURAL, - self::VOICE_DAHLIA___FRIENDLY, - self::VOICE_DAVIS___PROFESSIONAL, - self::VOICE_DEAN___NATURAL, - self::VOICE_DELBERT___CHEERFUL, - self::VOICE_EDWARD___FRIENDLY, - self::VOICE_ELAINE___CALM, - self::VOICE_EMILY___NATURAL, - self::VOICE_EMMA___NEWSCASTER, - self::VOICE_ERIC___NEWSCASTER, - self::VOICE_GRACE___NATURAL, - self::VOICE_HAILEY___CALM, - self::VOICE_INDIRA___CHEERFUL, - self::VOICE_ISABELLA___CHEERFUL, - self::VOICE_JACOB___NATURAL, - self::VOICE_JAHMAI___FRIENDLY, - self::VOICE_JANE___SERIOUS, - self::VOICE_JASON___SERIOUS, - self::VOICE_JELLE___FRIENDLY, - self::VOICE_JEN___NATURAL, - self::VOICE_JENNY___PROFESSIONAL, - self::VOICE_JODI___CHEERFUL, - self::VOICE_JOEY___CALM, - self::VOICE_JOHAN___FRIENDLY, - self::VOICE_JOSIE___CHEERFUL, - self::VOICE_KEANAN___NATURAL, - self::VOICE_KEITH___CHEERFUL, - self::VOICE_KELLIE___FRIENDLY, - self::VOICE_LAUREN___FRIENDLY, - self::VOICE_LEAH___NATURAL, - self::VOICE_LIAM___PROFESSIONAL, - self::VOICE_LIBBY___NATURAL, - self::VOICE_LILY___PROFESSIONAL, - self::VOICE_LUCAS___NATURAL, - self::VOICE_LUKE___PROFESSIONAL, - self::VOICE_LUNA___NATURAL, - self::VOICE_MARIEKE___NATURAL, - self::VOICE_MATTHEW___PROFESSIONAL, - self::VOICE_MICHELLE___NATURAL, - self::VOICE_MITCHELL___NATURAL, - self::VOICE_MOLLY___NEWSCASTER, - self::VOICE_MONICA___CALM, - self::VOICE_NATASHA___PROFESSIONAL, - self::VOICE_NEERJA___NEWSCASTER, - self::VOICE_NOAH___SERIOUS, - self::VOICE_OLIVER___NEWSCASTER, - self::VOICE_OLIVIA___CALM, - self::VOICE_PAUL___NATURAL, - self::VOICE_PRABHAT___NATURAL, - self::VOICE_RAVEENA___NATURAL, - self::VOICE_RUDI___FRIENDLY, - self::VOICE_RYAN___PROFESSIONAL, - self::VOICE_SAM___NATURAL, - self::VOICE_SARA___CHEERFUL, - self::VOICE_SHERRY___FRIENDLY, - self::VOICE_SONIA___WARM, - self::VOICE_THOMAS___NATURAL, - self::VOICE_TODD___PROFESSIONAL, - self::VOICE_TONY___PROFESSIONAL, - self::VOICE_TRACY___CHEERFUL, - self::VOICE_WAYNE___NATURAL, - self::VOICE_WILDER___NATURAL, - self::VOICE_WILLE___NATURAL, - self::VOICE_WILLIAM___FRIENDLY, - ]; - } - - /** - * Gets allowable values of the enum - * - * @return string[] - */ - public function getAvatarStyleAllowableValues() - { - return [ - self::AVATAR_STYLE_NORMAL, - self::AVATAR_STYLE_CIRCLE, - ]; - } - - /** - * Gets allowable values of the enum - * - * @return string[] - */ - public function getRatioAllowableValues() - { - return [ - self::RATIO__169, - self::RATIO__916, - ]; - } - - /** - * 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) - { - $this->setIfExists('type', $data ?? [], null); - $this->setIfExists('text', $data ?? [], null); - $this->setIfExists('avatar', $data ?? [], null); - $this->setIfExists('voice', $data ?? [], null); - $this->setIfExists('avatar_style', $data ?? [], null); - $this->setIfExists('background', $data ?? [], null); - $this->setIfExists('ratio', $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 ($this->container['type'] === null) { - $invalidProperties[] = "'type' can't be null"; - } - $allowedValues = $this->getTypeAllowableValues(); - if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { - $invalidProperties[] = sprintf( - "invalid value '%s' for 'type', must be one of '%s'", - $this->container['type'], - implode("', '", $allowedValues) - ); - } - - if ($this->container['text'] === null) { - $invalidProperties[] = "'text' can't be null"; - } - if ($this->container['avatar'] === null) { - $invalidProperties[] = "'avatar' can't be null"; - } - $allowedValues = $this->getAvatarAllowableValues(); - if (!is_null($this->container['avatar']) && !in_array($this->container['avatar'], $allowedValues, true)) { - $invalidProperties[] = sprintf( - "invalid value '%s' for 'avatar', must be one of '%s'", - $this->container['avatar'], - implode("', '", $allowedValues) - ); - } - - if ($this->container['voice'] === null) { - $invalidProperties[] = "'voice' can't be null"; - } - $allowedValues = $this->getVoiceAllowableValues(); - if (!is_null($this->container['voice']) && !in_array($this->container['voice'], $allowedValues, true)) { - $invalidProperties[] = sprintf( - "invalid value '%s' for 'voice', must be one of '%s'", - $this->container['voice'], - implode("', '", $allowedValues) - ); - } - - $allowedValues = $this->getAvatarStyleAllowableValues(); - if (!is_null($this->container['avatar_style']) && !in_array($this->container['avatar_style'], $allowedValues, true)) { - $invalidProperties[] = sprintf( - "invalid value '%s' for 'avatar_style', must be one of '%s'", - $this->container['avatar_style'], - implode("', '", $allowedValues) - ); - } - - $allowedValues = $this->getRatioAllowableValues(); - if (!is_null($this->container['ratio']) && !in_array($this->container['ratio'], $allowedValues, true)) { - $invalidProperties[] = sprintf( - "invalid value '%s' for 'ratio', must be one of '%s'", - $this->container['ratio'], - 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 type - * - * @return string - */ - public function getType() - { - return $this->container['type']; - } - - /** - * Sets type - * - * @param string $type The type of asset to generate - set to `text-to-avatar` for text-to-avatar. - * - * @return self - */ - public function setType($type) - { - if (is_null($type)) { - throw new \InvalidArgumentException('non-nullable type cannot be null'); - } - $allowedValues = $this->getTypeAllowableValues(); - if (!in_array($type, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value '%s' for 'type', must be one of '%s'", - $type, - implode("', '", $allowedValues) - ) - ); - } - $this->container['type'] = $type; - - return $this; - } - - /** - * Gets text - * - * @return string - */ - public function getText() - { - return $this->container['text']; - } - - /** - * Sets text - * - * @param string $text The text or script that the avatar will narrate. - * - * @return self - */ - public function setText($text) - { - if (is_null($text)) { - throw new \InvalidArgumentException('non-nullable text cannot be null'); - } - $this->container['text'] = $text; - - return $this; - } - - /** - * Gets avatar - * - * @return string - */ - public function getAvatar() - { - return $this->container['avatar']; - } - - /** - * Sets avatar - * - * @param string $avatar The avatar character to generate. Select from the list of available avatars:
  • `Angela`
  • `Bill`
  • `Daisy`
  • `Derek`
  • `Eva`
  • `Jake`
  • `Jeff`
  • `Jerome`
  • `Joon`
  • `Kayla`
  • `Kent`
  • `Luna`
  • `Mark`
  • `Matthew`
  • `Monica`
  • `Peter`
  • `Selina`
  • `Tanya`
  • `Thomas`
  • `Tina`
  • `Tyler`
  • `Vanessa`
  • `Vera`
  • `Wilson`
  • `Zoey`
- * - * @return self - */ - public function setAvatar($avatar) - { - if (is_null($avatar)) { - throw new \InvalidArgumentException('non-nullable avatar cannot be null'); - } - $allowedValues = $this->getAvatarAllowableValues(); - if (!in_array($avatar, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value '%s' for 'avatar', must be one of '%s'", - $avatar, - implode("', '", $allowedValues) - ) - ); - } - $this->container['avatar'] = $avatar; - - return $this; - } - - /** - * Gets voice - * - * @return string - */ - public function getVoice() - { - return $this->container['voice']; - } - - /** - * Sets voice - * - * @param string $voice The avatars voice and speaking style. Select from the list of available voices:
  • `Abb- - Natural`
  • `Adam - Natural`
  • `Aiston - Friendly`
  • `Alice - Newscaster`
  • `Alison - Cheerful`
  • `Amber - Friendly`
  • `Amy - Warm`
  • `Ana - Cheerful`
  • `Antoni - Friendly`
  • `Aria - Newscaster`
  • `Arnold - Cheerful`
  • `Arthur - Natural`
  • `Bella - Friendly`
  • `Belle - Natural`
  • `Brandon - Warm`
  • `Brian - Natural`
  • `Bruce - Natural`
  • `Cerise - Cheerful`
  • `Christopher - Calm`
  • `Clara - Professional`
  • `Connor - Natural`
  • `Dahlia - Friendly`
  • `Davis - Professional`
  • `Dean - Natural`
  • `Delbert - Cheerful`
  • `Edward - Friendly`
  • `Elaine - Calm`
  • `Emily - Natural`
  • `Emma - Newscaster`
  • `Eric - Newscaster`
  • `Grace - Natural`
  • `Hailey - Calm`
  • `Indira - Cheerful`
  • `Isabella - Cheerful`
  • `Jacob - Natural`
  • `Jahmai - Friendly`
  • `Jane - Serious`
  • `Jason - Serious`
  • `Jelle - Friendly`
  • `Jen - Natural`
  • `Jenny - Professional`
  • `Jodi - Cheerful`
  • `Joey - Calm`
  • `Johan - Friendly`
  • `Josie - Cheerful`
  • `Keanan - Natural`
  • `Keith - Cheerful`
  • `Kellie - Friendly`
  • `Lauren - Friendly`
  • `Leah - Natural`
  • `Liam - Professional`
  • `Libby - Natural`
  • `Lily - Professional`
  • `Lucas - Natural`
  • `Luke - Professional`
  • `Luna - Natural`
  • `Marieke - Natural`
  • `Matthew - Professional`
  • `Michelle - Natural`
  • `Mitchell - Natural`
  • `Molly - Newscaster`
  • `Monica - Calm`
  • `Natasha - Professional`
  • `Neerja - Newscaster`
  • `Noah - Serious`
  • `Oliver - Newscaster`
  • `Olivia - Calm`
  • `Paul - Natural`
  • `Prabhat - Natural`
  • `Raveena - Natural`
  • `Rudi - Friendly`
  • `Ryan - Professional`
  • `Sam - Natural`
  • `Sara - Cheerful`
  • `Sherry - Friendly`
  • `Sonia - Warm`
  • `Thomas - Natural`
  • `Todd - Professional`
  • `Tony - Professional`
  • `Tracy - Cheerful`
  • `Wayne - Natural`
  • `Wilder - Natural`
  • `Wille - Natural`
  • `William - Friendly`
- * - * @return self - */ - public function setVoice($voice) - { - if (is_null($voice)) { - throw new \InvalidArgumentException('non-nullable voice cannot be null'); - } - $allowedValues = $this->getVoiceAllowableValues(); - if (!in_array($voice, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value '%s' for 'voice', must be one of '%s'", - $voice, - implode("', '", $allowedValues) - ) - ); - } - $this->container['voice'] = $voice; - - return $this; - } - - /** - * Gets avatar_style - * - * @return string|null - */ - public function getAvatarStyle() - { - return $this->container['avatar_style']; - } - - /** - * Sets avatar_style - * - * @param string|null $avatar_style The display style of the avatar, a rectangle `normal` or circular `circle` background. Defaults to `normal`. - * - * @return self - */ - public function setAvatarStyle($avatar_style) - { - if (is_null($avatar_style)) { - throw new \InvalidArgumentException('non-nullable avatar_style cannot be null'); - } - $allowedValues = $this->getAvatarStyleAllowableValues(); - if (!in_array($avatar_style, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value '%s' for 'avatar_style', must be one of '%s'", - $avatar_style, - implode("', '", $allowedValues) - ) - ); - } - $this->container['avatar_style'] = $avatar_style; - - return $this; - } - - /** - * Gets background - * - * @return string|null - */ - public function getBackground() - { - return $this->container['background']; - } - - /** - * Sets background - * - * @param string|null $background The background color of the video. Defaults to `#ffffff`. - * - * @return self - */ - public function setBackground($background) - { - if (is_null($background)) { - throw new \InvalidArgumentException('non-nullable background cannot be null'); - } - $this->container['background'] = $background; - - return $this; - } - - /** - * Gets ratio - * - * @return string|null - */ - public function getRatio() - { - return $this->container['ratio']; - } - - /** - * Sets ratio - * - * @param string|null $ratio The aspect ratio of the video, `16:9` horizontal or `9:16` vertical. Defaults to `16:9`. - * - * @return self - */ - public function setRatio($ratio) - { - if (is_null($ratio)) { - throw new \InvalidArgumentException('non-nullable ratio cannot be null'); - } - $allowedValues = $this->getRatioAllowableValues(); - if (!in_array($ratio, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value '%s' for 'ratio', must be one of '%s'", - $ratio, - implode("', '", $allowedValues) - ) - ); - } - $this->container['ratio'] = $ratio; - - return $this; - } - - /** - * Gets test - * - * @return bool|null - */ - public function getTest() - { - return $this->container['test']; - } - - /** - * Sets test - * - * @param bool|null $test A boolean flag indicating whether the video is for testing purposes. See the \"test\" parameter in [HeyGen](https://docs.heygen.com/reference/generate-video) for more details. - * - * @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() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/src/Model/HtmlAsset.php b/src/Model/HtmlAsset.php index 5babd81..390e730 100644 --- a/src/Model/HtmlAsset.php +++ b/src/Model/HtmlAsset.php @@ -5,7 +5,7 @@ * PHP version 7.4 * * @category Class - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech */ @@ -26,17 +26,17 @@ * Do not edit the class manually. */ -namespace Shotstack\Client\Model; +namespace ShotstackClient\Model; use \ArrayAccess; -use \Shotstack\Client\ObjectSerializer; +use \ShotstackClient\ObjectSerializer; /** * HtmlAsset Class Doc Comment * * @category Class - * @description The HtmlAsset clip type lets you create text based layout and formatting using HTML and CSS. You can also set the height and width of a bounding box for the HTML content to sit within. Text and elements will wrap within the bounding box. - * @package Shotstack\Client + * @description **Notice: The HtmlAsset is deprecated, use the [TextAsset](#tocs_textasset) instead.** The HtmlAsset clip type lets you create text based layout and formatting using HTML and CSS. You can also set the height and width of a bounding box for the HTML content to sit within. Text and elements will wrap within the bounding box. + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech * @implements \ArrayAccess @@ -265,6 +265,7 @@ public function getModelName() return self::$openAPIModelName; } + public const TYPE_HTML = 'html'; public const POSITION_TOP = 'top'; public const POSITION_TOP_RIGHT = 'topRight'; public const POSITION_RIGHT = 'right'; @@ -275,6 +276,18 @@ public function getModelName() public const POSITION_TOP_LEFT = 'topLeft'; public const POSITION_CENTER = 'center'; + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_HTML, + ]; + } + /** * Gets allowable values of the enum * @@ -349,6 +362,15 @@ public function listInvalidProperties() if ($this->container['type'] === null) { $invalidProperties[] = "'type' can't be null"; } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + if ($this->container['html'] === null) { $invalidProperties[] = "'html' can't be null"; } @@ -398,6 +420,16 @@ public function setType($type) if (is_null($type)) { throw new \InvalidArgumentException('non-nullable type cannot be null'); } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } $this->container['type'] = $type; return $this; diff --git a/src/Model/ImageAsset.php b/src/Model/ImageAsset.php index 48d841e..657e952 100644 --- a/src/Model/ImageAsset.php +++ b/src/Model/ImageAsset.php @@ -5,7 +5,7 @@ * PHP version 7.4 * * @category Class - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech */ @@ -26,17 +26,17 @@ * Do not edit the class manually. */ -namespace Shotstack\Client\Model; +namespace ShotstackClient\Model; use \ArrayAccess; -use \Shotstack\Client\ObjectSerializer; +use \ShotstackClient\ObjectSerializer; /** * ImageAsset Class Doc Comment * * @category Class * @description The ImageAsset is used to create video from images to compose an image. The src must be a publicly accessible URL to an image resource such as a jpg or png file. - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech * @implements \ArrayAccess @@ -60,7 +60,7 @@ class ImageAsset implements ModelInterface, ArrayAccess, \JsonSerializable protected static $openAPITypes = [ 'type' => 'string', 'src' => 'string', - 'crop' => '\Shotstack\Client\Model\Crop' + 'crop' => '\ShotstackClient\Model\Crop' ]; /** @@ -241,6 +241,19 @@ public function getModelName() return self::$openAPIModelName; } + public const TYPE_IMAGE = 'image'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_IMAGE, + ]; + } /** * Associative array for storing property values @@ -292,9 +305,26 @@ public function listInvalidProperties() if ($this->container['type'] === null) { $invalidProperties[] = "'type' can't be null"; } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + if ($this->container['src'] === null) { $invalidProperties[] = "'src' can't be null"; } + if ((mb_strlen($this->container['src']) < 1)) { + $invalidProperties[] = "invalid value for 'src', the character length must be bigger than or equal to 1."; + } + + if (!preg_match("/\\S/", $this->container['src'])) { + $invalidProperties[] = "invalid value for 'src', must be conform to the pattern /\\S/."; + } + return $invalidProperties; } @@ -332,6 +362,16 @@ public function setType($type) if (is_null($type)) { throw new \InvalidArgumentException('non-nullable type cannot be null'); } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } $this->container['type'] = $type; return $this; @@ -359,6 +399,14 @@ public function setSrc($src) if (is_null($src)) { throw new \InvalidArgumentException('non-nullable src cannot be null'); } + + if ((mb_strlen($src) < 1)) { + throw new \InvalidArgumentException('invalid length for $src when calling ImageAsset., must be bigger than or equal to 1.'); + } + if ((!preg_match("/\\S/", ObjectSerializer::toString($src)))) { + throw new \InvalidArgumentException("invalid value for \$src when calling ImageAsset., must conform to the pattern /\\S/."); + } + $this->container['src'] = $src; return $this; @@ -367,7 +415,7 @@ public function setSrc($src) /** * Gets crop * - * @return \Shotstack\Client\Model\Crop|null + * @return \ShotstackClient\Model\Crop|null */ public function getCrop() { @@ -377,7 +425,7 @@ public function getCrop() /** * Sets crop * - * @param \Shotstack\Client\Model\Crop|null $crop crop + * @param \ShotstackClient\Model\Crop|null $crop crop * * @return self */ diff --git a/src/Model/OpenAiTextGeneratorOptions.php b/src/Model/ImageToVideoAsset.php similarity index 63% rename from src/Model/OpenAiTextGeneratorOptions.php rename to src/Model/ImageToVideoAsset.php index bb8d22b..c4eb44f 100644 --- a/src/Model/OpenAiTextGeneratorOptions.php +++ b/src/Model/ImageToVideoAsset.php @@ -1,11 +1,11 @@ */ -class OpenAiTextGeneratorOptions implements ModelInterface, ArrayAccess, \JsonSerializable +class ImageToVideoAsset implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; @@ -50,7 +50,7 @@ class OpenAiTextGeneratorOptions implements ModelInterface, ArrayAccess, \JsonSe * * @var string */ - protected static $openAPIModelName = 'OpenAiTextGeneratorOptions'; + protected static $openAPIModelName = 'ImageToVideoAsset'; /** * Array of property to type mappings. Used for (de)serialization @@ -59,9 +59,11 @@ class OpenAiTextGeneratorOptions implements ModelInterface, ArrayAccess, \JsonSe */ protected static $openAPITypes = [ 'type' => 'string', + 'src' => 'string', 'prompt' => 'string', - 'model' => 'string', - 'system_prompt' => 'string' + 'aspect_ratio' => 'string', + 'speed' => 'float', + 'crop' => '\ShotstackClient\Model\Crop' ]; /** @@ -73,9 +75,11 @@ class OpenAiTextGeneratorOptions implements ModelInterface, ArrayAccess, \JsonSe */ protected static $openAPIFormats = [ 'type' => null, + 'src' => null, 'prompt' => null, - 'model' => null, - 'system_prompt' => null + 'aspect_ratio' => null, + 'speed' => 'float', + 'crop' => null ]; /** @@ -85,9 +89,11 @@ class OpenAiTextGeneratorOptions implements ModelInterface, ArrayAccess, \JsonSe */ protected static array $openAPINullables = [ 'type' => false, + 'src' => false, 'prompt' => false, - 'model' => false, - 'system_prompt' => false + 'aspect_ratio' => false, + 'speed' => false, + 'crop' => false ]; /** @@ -177,9 +183,11 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'type' => 'type', + 'src' => 'src', 'prompt' => 'prompt', - 'model' => 'model', - 'system_prompt' => 'systemPrompt' + 'aspect_ratio' => 'aspectRatio', + 'speed' => 'speed', + 'crop' => 'crop' ]; /** @@ -189,9 +197,11 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'type' => 'setType', + 'src' => 'setSrc', 'prompt' => 'setPrompt', - 'model' => 'setModel', - 'system_prompt' => 'setSystemPrompt' + 'aspect_ratio' => 'setAspectRatio', + 'speed' => 'setSpeed', + 'crop' => 'setCrop' ]; /** @@ -201,9 +211,11 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'type' => 'getType', + 'src' => 'getSrc', 'prompt' => 'getPrompt', - 'model' => 'getModel', - 'system_prompt' => 'getSystemPrompt' + 'aspect_ratio' => 'getAspectRatio', + 'speed' => 'getSpeed', + 'crop' => 'getCrop' ]; /** @@ -247,9 +259,14 @@ public function getModelName() return self::$openAPIModelName; } - public const TYPE_TEXT_GENERATOR = 'text-generator'; - public const MODEL__3_5_TURBO = 'gpt-3.5-turbo'; - public const MODEL__4 = 'gpt-4'; + public const TYPE_IMAGE_TO_VIDEO = 'image-to-video'; + public const ASPECT_RATIO__11 = '1:1'; + public const ASPECT_RATIO__43 = '4:3'; + public const ASPECT_RATIO__169 = '16:9'; + public const ASPECT_RATIO__916 = '9:16'; + public const ASPECT_RATIO__34 = '3:4'; + public const ASPECT_RATIO__219 = '21:9'; + public const ASPECT_RATIO__921 = '9:21'; /** * Gets allowable values of the enum @@ -259,7 +276,7 @@ public function getModelName() public function getTypeAllowableValues() { return [ - self::TYPE_TEXT_GENERATOR, + self::TYPE_IMAGE_TO_VIDEO, ]; } @@ -268,11 +285,16 @@ public function getTypeAllowableValues() * * @return string[] */ - public function getModelAllowableValues() + public function getAspectRatioAllowableValues() { return [ - self::MODEL__3_5_TURBO, - self::MODEL__4, + self::ASPECT_RATIO__11, + self::ASPECT_RATIO__43, + self::ASPECT_RATIO__169, + self::ASPECT_RATIO__916, + self::ASPECT_RATIO__34, + self::ASPECT_RATIO__219, + self::ASPECT_RATIO__921, ]; } @@ -291,10 +313,12 @@ public function getModelAllowableValues() */ public function __construct(array $data = null) { - $this->setIfExists('type', $data ?? [], 'text-generator'); + $this->setIfExists('type', $data ?? [], 'image-to-video'); + $this->setIfExists('src', $data ?? [], null); $this->setIfExists('prompt', $data ?? [], null); - $this->setIfExists('model', $data ?? [], null); - $this->setIfExists('system_prompt', $data ?? [], null); + $this->setIfExists('aspect_ratio', $data ?? [], null); + $this->setIfExists('speed', $data ?? [], null); + $this->setIfExists('crop', $data ?? [], null); } /** @@ -336,21 +360,30 @@ public function listInvalidProperties() ); } - if ($this->container['prompt'] === null) { - $invalidProperties[] = "'prompt' can't be null"; + if ($this->container['src'] === null) { + $invalidProperties[] = "'src' can't be null"; } - if ($this->container['model'] === null) { - $invalidProperties[] = "'model' can't be null"; + if ((mb_strlen($this->container['src']) < 1)) { + $invalidProperties[] = "invalid value for 'src', the character length must be bigger than or equal to 1."; } - $allowedValues = $this->getModelAllowableValues(); - if (!is_null($this->container['model']) && !in_array($this->container['model'], $allowedValues, true)) { + + $allowedValues = $this->getAspectRatioAllowableValues(); + if (!is_null($this->container['aspect_ratio']) && !in_array($this->container['aspect_ratio'], $allowedValues, true)) { $invalidProperties[] = sprintf( - "invalid value '%s' for 'model', must be one of '%s'", - $this->container['model'], + "invalid value '%s' for 'aspect_ratio', must be one of '%s'", + $this->container['aspect_ratio'], implode("', '", $allowedValues) ); } + if (!is_null($this->container['speed']) && ($this->container['speed'] > 10)) { + $invalidProperties[] = "invalid value for 'speed', must be smaller than or equal to 10."; + } + + if (!is_null($this->container['speed']) && ($this->container['speed'] < 0)) { + $invalidProperties[] = "invalid value for 'speed', must be bigger than or equal to 0."; + } + return $invalidProperties; } @@ -379,7 +412,7 @@ public function getType() /** * Sets type * - * @param string $type The type of asset to generate - set to `text-generator` for text generation. + * @param string $type The type of asset to generate - set to `image-to-video` for image-to-video. * * @return self */ @@ -404,10 +437,42 @@ public function setType($type) } /** - * Gets prompt + * Gets src * * @return string */ + public function getSrc() + { + return $this->container['src']; + } + + /** + * Sets src + * + * @param string $src The image source URL. The URL must be publicly accessible or include credentials. + * + * @return self + */ + public function setSrc($src) + { + if (is_null($src)) { + throw new \InvalidArgumentException('non-nullable src cannot be null'); + } + + if ((mb_strlen($src) < 1)) { + throw new \InvalidArgumentException('invalid length for $src when calling ImageToVideoAsset., must be bigger than or equal to 1.'); + } + + $this->container['src'] = $src; + + return $this; + } + + /** + * Gets prompt + * + * @return string|null + */ public function getPrompt() { return $this->container['prompt']; @@ -416,7 +481,7 @@ public function getPrompt() /** * Sets prompt * - * @param string $prompt The text prompt to generate text from. + * @param string|null $prompt The instructions for modifying the image into a video sequence. * * @return self */ @@ -431,65 +496,100 @@ public function setPrompt($prompt) } /** - * Gets model + * Gets aspect_ratio * - * @return string + * @return string|null */ - public function getModel() + public function getAspectRatio() { - return $this->container['model']; + return $this->container['aspect_ratio']; } /** - * Sets model + * Sets aspect_ratio * - * @param string $model The model to use for generating the text. Select from the list of available models:
  • `gpt-3.5-turbo`
  • `gpt-4`
+ * @param string|null $aspect_ratio The aspect ratio (shape) of the video output. * * @return self */ - public function setModel($model) + public function setAspectRatio($aspect_ratio) { - if (is_null($model)) { - throw new \InvalidArgumentException('non-nullable model cannot be null'); + if (is_null($aspect_ratio)) { + throw new \InvalidArgumentException('non-nullable aspect_ratio cannot be null'); } - $allowedValues = $this->getModelAllowableValues(); - if (!in_array($model, $allowedValues, true)) { + $allowedValues = $this->getAspectRatioAllowableValues(); + if (!in_array($aspect_ratio, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( - "Invalid value '%s' for 'model', must be one of '%s'", - $model, + "Invalid value '%s' for 'aspect_ratio', must be one of '%s'", + $aspect_ratio, implode("', '", $allowedValues) ) ); } - $this->container['model'] = $model; + $this->container['aspect_ratio'] = $aspect_ratio; return $this; } /** - * Gets system_prompt + * Gets speed * - * @return string|null + * @return float|null + */ + public function getSpeed() + { + return $this->container['speed']; + } + + /** + * Sets speed + * + * @param float|null $speed Adjust the playback speed of the video clip between 0 (paused) and 10 (10x normal speed) where 1 is normal speed (defaults to 1). Adjusting the speed will also adjust the duration of the clip and may require you to adjust the Clip length. For example, if you set speed to 0.5, the clip will need to be 2x as long to play the entire video (i.e. original length / 0.5). If you set speed to 2, the clip will need to be half as long to play the entire video (i.e. original length / 2). + * + * @return self + */ + public function setSpeed($speed) + { + if (is_null($speed)) { + throw new \InvalidArgumentException('non-nullable speed cannot be null'); + } + + if (($speed > 10)) { + throw new \InvalidArgumentException('invalid value for $speed when calling ImageToVideoAsset., must be smaller than or equal to 10.'); + } + if (($speed < 0)) { + throw new \InvalidArgumentException('invalid value for $speed when calling ImageToVideoAsset., must be bigger than or equal to 0.'); + } + + $this->container['speed'] = $speed; + + return $this; + } + + /** + * Gets crop + * + * @return \ShotstackClient\Model\Crop|null */ - public function getSystemPrompt() + public function getCrop() { - return $this->container['system_prompt']; + return $this->container['crop']; } /** - * Sets system_prompt + * Sets crop * - * @param string|null $system_prompt The system prompt to use for generating the text. This is an optional prompt that can be used to provide context or additional information to the model. + * @param \ShotstackClient\Model\Crop|null $crop crop * * @return self */ - public function setSystemPrompt($system_prompt) + public function setCrop($crop) { - if (is_null($system_prompt)) { - throw new \InvalidArgumentException('non-nullable system_prompt cannot be null'); + if (is_null($crop)) { + throw new \InvalidArgumentException('non-nullable crop cannot be null'); } - $this->container['system_prompt'] = $system_prompt; + $this->container['crop'] = $crop; return $this; } diff --git a/src/Model/IngestErrorResponse.php b/src/Model/IngestErrorResponse.php index 3006390..0d48658 100644 --- a/src/Model/IngestErrorResponse.php +++ b/src/Model/IngestErrorResponse.php @@ -5,7 +5,7 @@ * PHP version 7.4 * * @category Class - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech */ @@ -26,17 +26,17 @@ * Do not edit the class manually. */ -namespace Shotstack\Client\Model; +namespace ShotstackClient\Model; use \ArrayAccess; -use \Shotstack\Client\ObjectSerializer; +use \ShotstackClient\ObjectSerializer; /** * IngestErrorResponse Class Doc Comment * * @category Class * @description Error response data for validation and other errors returned by the Ingest API. - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech * @implements \ArrayAccess @@ -58,7 +58,7 @@ class IngestErrorResponse implements ModelInterface, ArrayAccess, \JsonSerializa * @var string[] */ protected static $openAPITypes = [ - 'errors' => '\Shotstack\Client\Model\IngestErrorResponseData[]' + 'errors' => '\ShotstackClient\Model\IngestErrorResponseData[]' ]; /** @@ -296,7 +296,7 @@ public function valid() /** * Gets errors * - * @return \Shotstack\Client\Model\IngestErrorResponseData[] + * @return \ShotstackClient\Model\IngestErrorResponseData[] */ public function getErrors() { @@ -306,7 +306,7 @@ public function getErrors() /** * Sets errors * - * @param \Shotstack\Client\Model\IngestErrorResponseData[] $errors An array of errors. + * @param \ShotstackClient\Model\IngestErrorResponseData[] $errors An array of errors. * * @return self */ diff --git a/src/Model/IngestErrorResponseData.php b/src/Model/IngestErrorResponseData.php index 54e9a8e..84083cf 100644 --- a/src/Model/IngestErrorResponseData.php +++ b/src/Model/IngestErrorResponseData.php @@ -5,7 +5,7 @@ * PHP version 7.4 * * @category Class - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech */ @@ -26,17 +26,17 @@ * Do not edit the class manually. */ -namespace Shotstack\Client\Model; +namespace ShotstackClient\Model; use \ArrayAccess; -use \Shotstack\Client\ObjectSerializer; +use \ShotstackClient\ObjectSerializer; /** * IngestErrorResponseData Class Doc Comment * * @category Class * @description Individual errors returned by the Ingest API. - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech * @implements \ArrayAccess diff --git a/src/Model/LumaAsset.php b/src/Model/LumaAsset.php index 7058991..646312e 100644 --- a/src/Model/LumaAsset.php +++ b/src/Model/LumaAsset.php @@ -5,7 +5,7 @@ * PHP version 7.4 * * @category Class - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech */ @@ -26,17 +26,17 @@ * Do not edit the class manually. */ -namespace Shotstack\Client\Model; +namespace ShotstackClient\Model; use \ArrayAccess; -use \Shotstack\Client\ObjectSerializer; +use \ShotstackClient\ObjectSerializer; /** * LumaAsset Class Doc Comment * * @category Class * @description The LumaAsset is used to create luma matte masks, transitions and effects between other assets. A luma matte is a grey scale image or animated video where the black areas are transparent and the white areas solid. The luma matte animation should be provided as an mp4 video file. The src must be a publicly accessible URL to the file. - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech * @implements \ArrayAccess @@ -241,6 +241,19 @@ public function getModelName() return self::$openAPIModelName; } + public const TYPE_LUMA = 'luma'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_LUMA, + ]; + } /** * Associative array for storing property values @@ -292,9 +305,26 @@ public function listInvalidProperties() if ($this->container['type'] === null) { $invalidProperties[] = "'type' can't be null"; } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + if ($this->container['src'] === null) { $invalidProperties[] = "'src' can't be null"; } + if ((mb_strlen($this->container['src']) < 1)) { + $invalidProperties[] = "invalid value for 'src', the character length must be bigger than or equal to 1."; + } + + if (!preg_match("/\\S/", $this->container['src'])) { + $invalidProperties[] = "invalid value for 'src', must be conform to the pattern /\\S/."; + } + return $invalidProperties; } @@ -332,6 +362,16 @@ public function setType($type) if (is_null($type)) { throw new \InvalidArgumentException('non-nullable type cannot be null'); } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } $this->container['type'] = $type; return $this; @@ -359,6 +399,14 @@ public function setSrc($src) if (is_null($src)) { throw new \InvalidArgumentException('non-nullable src cannot be null'); } + + if ((mb_strlen($src) < 1)) { + throw new \InvalidArgumentException('invalid length for $src when calling LumaAsset., must be bigger than or equal to 1.'); + } + if ((!preg_match("/\\S/", ObjectSerializer::toString($src)))) { + throw new \InvalidArgumentException("invalid value for \$src when calling LumaAsset., must conform to the pattern /\\S/."); + } + $this->container['src'] = $src; return $this; diff --git a/src/Model/MergeField.php b/src/Model/MergeField.php index d7ad949..983e8c7 100644 --- a/src/Model/MergeField.php +++ b/src/Model/MergeField.php @@ -5,7 +5,7 @@ * PHP version 7.4 * * @category Class - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech */ @@ -26,17 +26,17 @@ * Do not edit the class manually. */ -namespace Shotstack\Client\Model; +namespace ShotstackClient\Model; use \ArrayAccess; -use \Shotstack\Client\ObjectSerializer; +use \ShotstackClient\ObjectSerializer; /** * MergeField Class Doc Comment * * @category Class * @description A merge field consists of a key; `find`, and a value; `replace`. Merge fields can be used to replace placeholders within the JSON edit to create re-usable templates. Placeholders should be a string with double brace delimiters, i.e. `\"{{NAME}}\"`. A placeholder can be used for any value within the JSON edit. - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech * @implements \ArrayAccess diff --git a/src/Model/ModelInterface.php b/src/Model/ModelInterface.php index 49d2b35..3bd9aac 100644 --- a/src/Model/ModelInterface.php +++ b/src/Model/ModelInterface.php @@ -5,7 +5,7 @@ * PHP version 7.4 * * @category Class - * @package Shotstack\Client\Model + * @package ShotstackClient\Model * @author OpenAPI Generator team * @link https://openapi-generator.tech */ @@ -26,12 +26,12 @@ * Do not edit the class manually. */ -namespace Shotstack\Client\Model; +namespace ShotstackClient\Model; /** * Interface abstracting model access. * - * @package Shotstack\Client\Model + * @package ShotstackClient\Model * @author OpenAPI Generator team */ interface ModelInterface diff --git a/src/Model/MuxDestination.php b/src/Model/MuxDestination.php index 782f6d1..67d24bc 100644 --- a/src/Model/MuxDestination.php +++ b/src/Model/MuxDestination.php @@ -5,7 +5,7 @@ * PHP version 7.4 * * @category Class - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech */ @@ -26,17 +26,17 @@ * Do not edit the class manually. */ -namespace Shotstack\Client\Model; +namespace ShotstackClient\Model; use \ArrayAccess; -use \Shotstack\Client\ObjectSerializer; +use \ShotstackClient\ObjectSerializer; /** * MuxDestination Class Doc Comment * * @category Class * @description Send videos to the [Mux](https://shotstack.io/docs/guide/serving-assets/destinations/mux/) video hosting and streaming service. Mux credentials are required and added via the [dashboard](https://dashboard.shotstack.io/integrations/mux), not in the request. - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech * @implements \ArrayAccess @@ -59,7 +59,7 @@ class MuxDestination implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPITypes = [ 'provider' => 'string', - 'options' => '\Shotstack\Client\Model\MuxDestinationOptions' + 'options' => '\ShotstackClient\Model\MuxDestinationOptions' ]; /** @@ -330,7 +330,7 @@ public function setProvider($provider) /** * Gets options * - * @return \Shotstack\Client\Model\MuxDestinationOptions|null + * @return \ShotstackClient\Model\MuxDestinationOptions|null */ public function getOptions() { @@ -340,7 +340,7 @@ public function getOptions() /** * Sets options * - * @param \Shotstack\Client\Model\MuxDestinationOptions|null $options options + * @param \ShotstackClient\Model\MuxDestinationOptions|null $options options * * @return self */ diff --git a/src/Model/MuxDestinationOptions.php b/src/Model/MuxDestinationOptions.php index 119d27c..85d4fc3 100644 --- a/src/Model/MuxDestinationOptions.php +++ b/src/Model/MuxDestinationOptions.php @@ -5,7 +5,7 @@ * PHP version 7.4 * * @category Class - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech */ @@ -26,17 +26,17 @@ * Do not edit the class manually. */ -namespace Shotstack\Client\Model; +namespace ShotstackClient\Model; use \ArrayAccess; -use \Shotstack\Client\ObjectSerializer; +use \ShotstackClient\ObjectSerializer; /** * MuxDestinationOptions Class Doc Comment * * @category Class * @description Pass additional options to control how Mux processes video. Currently supports playback_policy and passthrough options. - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech * @implements \ArrayAccess diff --git a/src/Model/Offset.php b/src/Model/Offset.php index c0f75c7..2edf11e 100644 --- a/src/Model/Offset.php +++ b/src/Model/Offset.php @@ -5,7 +5,7 @@ * PHP version 7.4 * * @category Class - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech */ @@ -26,17 +26,17 @@ * Do not edit the class manually. */ -namespace Shotstack\Client\Model; +namespace ShotstackClient\Model; use \ArrayAccess; -use \Shotstack\Client\ObjectSerializer; +use \ShotstackClient\ObjectSerializer; /** * Offset Class Doc Comment * * @category Class * @description Offsets the position of an asset horizontally or vertically by a relative distance. - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech * @implements \ArrayAccess @@ -58,8 +58,8 @@ class Offset implements ModelInterface, ArrayAccess, \JsonSerializable * @var string[] */ protected static $openAPITypes = [ - 'x' => 'float', - 'y' => 'float' + 'x' => '\ShotstackClient\Model\OffsetX', + 'y' => '\ShotstackClient\Model\OffsetY' ]; /** @@ -70,8 +70,8 @@ class Offset implements ModelInterface, ArrayAccess, \JsonSerializable * @psalm-var array */ protected static $openAPIFormats = [ - 'x' => 'float', - 'y' => 'float' + 'x' => null, + 'y' => null ]; /** @@ -282,22 +282,6 @@ public function listInvalidProperties() { $invalidProperties = []; - if (!is_null($this->container['x']) && ($this->container['x'] > 10)) { - $invalidProperties[] = "invalid value for 'x', must be smaller than or equal to 10."; - } - - if (!is_null($this->container['x']) && ($this->container['x'] < -10)) { - $invalidProperties[] = "invalid value for 'x', must be bigger than or equal to -10."; - } - - if (!is_null($this->container['y']) && ($this->container['y'] > 10)) { - $invalidProperties[] = "invalid value for 'y', must be smaller than or equal to 10."; - } - - if (!is_null($this->container['y']) && ($this->container['y'] < -10)) { - $invalidProperties[] = "invalid value for 'y', must be bigger than or equal to -10."; - } - return $invalidProperties; } @@ -316,7 +300,7 @@ public function valid() /** * Gets x * - * @return float|null + * @return \ShotstackClient\Model\OffsetX|null */ public function getX() { @@ -326,7 +310,7 @@ public function getX() /** * Sets x * - * @param float|null $x Offset an asset on the horizontal axis (left or right), range varies from -10 to 10. Positive numbers move the asset right, negative left. For all assets except titles the distance moved is relative to the width of the viewport - i.e. an X offset of 0.5 will move the asset half the screen width to the right. + * @param \ShotstackClient\Model\OffsetX|null $x x * * @return self */ @@ -335,14 +319,6 @@ public function setX($x) if (is_null($x)) { throw new \InvalidArgumentException('non-nullable x cannot be null'); } - - if (($x > 10)) { - throw new \InvalidArgumentException('invalid value for $x when calling Offset., must be smaller than or equal to 10.'); - } - if (($x < -10)) { - throw new \InvalidArgumentException('invalid value for $x when calling Offset., must be bigger than or equal to -10.'); - } - $this->container['x'] = $x; return $this; @@ -351,7 +327,7 @@ public function setX($x) /** * Gets y * - * @return float|null + * @return \ShotstackClient\Model\OffsetY|null */ public function getY() { @@ -361,7 +337,7 @@ public function getY() /** * Sets y * - * @param float|null $y Offset an asset on the vertical axis (up or down), range varies from -10 to 10. Positive numbers move the asset up, negative down. For all assets except titles the distance moved is relative to the height of the viewport - i.e. an Y offset of 0.5 will move the asset up half the screen height. + * @param \ShotstackClient\Model\OffsetY|null $y y * * @return self */ @@ -370,14 +346,6 @@ public function setY($y) if (is_null($y)) { throw new \InvalidArgumentException('non-nullable y cannot be null'); } - - if (($y > 10)) { - throw new \InvalidArgumentException('invalid value for $y when calling Offset., must be smaller than or equal to 10.'); - } - if (($y < -10)) { - throw new \InvalidArgumentException('invalid value for $y when calling Offset., must be bigger than or equal to -10.'); - } - $this->container['y'] = $y; return $this; diff --git a/src/Model/OffsetX.php b/src/Model/OffsetX.php new file mode 100644 index 0000000..508b479 --- /dev/null +++ b/src/Model/OffsetX.php @@ -0,0 +1,382 @@ + + */ +class OffsetX implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Offset_x'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + + ]; + + /** + * 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; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $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 = [ + + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + + ]; + + /** + * 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) + { + } + + /** + * 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 = []; + + 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; + } + + /** + * 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() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/OffsetY.php b/src/Model/OffsetY.php new file mode 100644 index 0000000..3ccc18f --- /dev/null +++ b/src/Model/OffsetY.php @@ -0,0 +1,382 @@ + + */ +class OffsetY implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Offset_y'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + + ]; + + /** + * 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; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $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 = [ + + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + + ]; + + /** + * 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) + { + } + + /** + * 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 = []; + + 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; + } + + /** + * 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() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/Output.php b/src/Model/Output.php index 793870f..277a62f 100644 --- a/src/Model/Output.php +++ b/src/Model/Output.php @@ -5,7 +5,7 @@ * PHP version 7.4 * * @category Class - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech */ @@ -26,17 +26,17 @@ * Do not edit the class manually. */ -namespace Shotstack\Client\Model; +namespace ShotstackClient\Model; use \ArrayAccess; -use \Shotstack\Client\ObjectSerializer; +use \ShotstackClient\ObjectSerializer; /** * Output Class Doc Comment * * @category Class * @description The output format, render range and type of media to generate. - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech * @implements \ArrayAccess @@ -61,16 +61,16 @@ class Output implements ModelInterface, ArrayAccess, \JsonSerializable 'format' => 'string', 'resolution' => 'string', 'aspect_ratio' => 'string', - 'size' => '\Shotstack\Client\Model\Size', + 'size' => '\ShotstackClient\Model\Size', 'fps' => 'float', 'scale_to' => 'string', 'quality' => 'string', 'repeat' => 'bool', 'mute' => 'bool', - 'range' => '\Shotstack\Client\Model\Range', - 'poster' => '\Shotstack\Client\Model\Poster', - 'thumbnail' => '\Shotstack\Client\Model\Thumbnail', - 'destinations' => '\Shotstack\Client\Model\Destinations[]' + 'range' => '\ShotstackClient\Model\Range', + 'poster' => '\ShotstackClient\Model\Poster', + 'thumbnail' => '\ShotstackClient\Model\Thumbnail', + 'destinations' => '\ShotstackClient\Model\Destinations[]' ]; /** @@ -334,6 +334,7 @@ public function getModelName() public const SCALE_TO_SD = 'sd'; public const SCALE_TO_HD = 'hd'; public const SCALE_TO__1080 = '1080'; + public const SCALE_TO__4K = '4k'; public const QUALITY_VERYLOW = 'verylow'; public const QUALITY_LOW = 'low'; public const QUALITY_MEDIUM = 'medium'; @@ -425,6 +426,7 @@ public function getScaleToAllowableValues() self::SCALE_TO_SD, self::SCALE_TO_HD, self::SCALE_TO__1080, + self::SCALE_TO__4K, ]; } @@ -687,7 +689,7 @@ public function setAspectRatio($aspect_ratio) /** * Gets size * - * @return \Shotstack\Client\Model\Size|null + * @return \ShotstackClient\Model\Size|null */ public function getSize() { @@ -697,7 +699,7 @@ public function getSize() /** * Sets size * - * @param \Shotstack\Client\Model\Size|null $size size + * @param \ShotstackClient\Model\Size|null $size size * * @return self */ @@ -879,7 +881,7 @@ public function setMute($mute) /** * Gets range * - * @return \Shotstack\Client\Model\Range|null + * @return \ShotstackClient\Model\Range|null */ public function getRange() { @@ -889,7 +891,7 @@ public function getRange() /** * Sets range * - * @param \Shotstack\Client\Model\Range|null $range range + * @param \ShotstackClient\Model\Range|null $range range * * @return self */ @@ -906,7 +908,7 @@ public function setRange($range) /** * Gets poster * - * @return \Shotstack\Client\Model\Poster|null + * @return \ShotstackClient\Model\Poster|null */ public function getPoster() { @@ -916,7 +918,7 @@ public function getPoster() /** * Sets poster * - * @param \Shotstack\Client\Model\Poster|null $poster poster + * @param \ShotstackClient\Model\Poster|null $poster poster * * @return self */ @@ -933,7 +935,7 @@ public function setPoster($poster) /** * Gets thumbnail * - * @return \Shotstack\Client\Model\Thumbnail|null + * @return \ShotstackClient\Model\Thumbnail|null */ public function getThumbnail() { @@ -943,7 +945,7 @@ public function getThumbnail() /** * Sets thumbnail * - * @param \Shotstack\Client\Model\Thumbnail|null $thumbnail thumbnail + * @param \ShotstackClient\Model\Thumbnail|null $thumbnail thumbnail * * @return self */ @@ -960,7 +962,7 @@ public function setThumbnail($thumbnail) /** * Gets destinations * - * @return \Shotstack\Client\Model\Destinations[]|null + * @return \ShotstackClient\Model\Destinations[]|null */ public function getDestinations() { @@ -970,7 +972,7 @@ public function getDestinations() /** * Sets destinations * - * @param \Shotstack\Client\Model\Destinations[]|null $destinations Specify the storage locations and hosting services to send rendered videos to. + * @param \ShotstackClient\Model\Destinations[]|null $destinations Specify the storage locations and hosting services to send rendered videos to. * * @return self */ diff --git a/src/Model/Outputs.php b/src/Model/Outputs.php index 6b14345..4ea63eb 100644 --- a/src/Model/Outputs.php +++ b/src/Model/Outputs.php @@ -5,7 +5,7 @@ * PHP version 7.4 * * @category Class - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech */ @@ -26,17 +26,17 @@ * Do not edit the class manually. */ -namespace Shotstack\Client\Model; +namespace ShotstackClient\Model; use \ArrayAccess; -use \Shotstack\Client\ObjectSerializer; +use \ShotstackClient\ObjectSerializer; /** * Outputs Class Doc Comment * * @category Class * @description The output renditions and transformations that should be generated from the source file. - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech * @implements \ArrayAccess @@ -58,8 +58,8 @@ class Outputs implements ModelInterface, ArrayAccess, \JsonSerializable * @var string[] */ protected static $openAPITypes = [ - 'renditions' => '\Shotstack\Client\Model\Rendition[]', - 'transcription' => '\Shotstack\Client\Model\Transcription' + 'renditions' => '\ShotstackClient\Model\Rendition[]', + 'transcription' => '\ShotstackClient\Model\Transcription' ]; /** @@ -300,7 +300,7 @@ public function valid() /** * Gets renditions * - * @return \Shotstack\Client\Model\Rendition[]|null + * @return \ShotstackClient\Model\Rendition[]|null */ public function getRenditions() { @@ -310,7 +310,7 @@ public function getRenditions() /** * Sets renditions * - * @param \Shotstack\Client\Model\Rendition[]|null $renditions The output renditions and transformations that should be generated from the source file. + * @param \ShotstackClient\Model\Rendition[]|null $renditions The output renditions and transformations that should be generated from the source file. * * @return self */ @@ -327,7 +327,7 @@ public function setRenditions($renditions) /** * Gets transcription * - * @return \Shotstack\Client\Model\Transcription|null + * @return \ShotstackClient\Model\Transcription|null */ public function getTranscription() { @@ -337,7 +337,7 @@ public function getTranscription() /** * Sets transcription * - * @param \Shotstack\Client\Model\Transcription|null $transcription transcription + * @param \ShotstackClient\Model\Transcription|null $transcription transcription * * @return self */ diff --git a/src/Model/OutputsResponse.php b/src/Model/OutputsResponse.php index 32dbc40..be1792a 100644 --- a/src/Model/OutputsResponse.php +++ b/src/Model/OutputsResponse.php @@ -5,7 +5,7 @@ * PHP version 7.4 * * @category Class - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech */ @@ -26,17 +26,17 @@ * Do not edit the class manually. */ -namespace Shotstack\Client\Model; +namespace ShotstackClient\Model; use \ArrayAccess; -use \Shotstack\Client\ObjectSerializer; +use \ShotstackClient\ObjectSerializer; /** * OutputsResponse Class Doc Comment * * @category Class * @description The list of outputs generated from the source file. Currently supports renditions which are versions of the source file with different transformations applied. - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech * @implements \ArrayAccess @@ -58,7 +58,7 @@ class OutputsResponse implements ModelInterface, ArrayAccess, \JsonSerializable * @var string[] */ protected static $openAPITypes = [ - 'renditions' => '\Shotstack\Client\Model\RenditionResponseAttributes[]' + 'renditions' => '\ShotstackClient\Model\RenditionResponseAttributes[]' ]; /** @@ -293,7 +293,7 @@ public function valid() /** * Gets renditions * - * @return \Shotstack\Client\Model\RenditionResponseAttributes[]|null + * @return \ShotstackClient\Model\RenditionResponseAttributes[]|null */ public function getRenditions() { @@ -303,7 +303,7 @@ public function getRenditions() /** * Sets renditions * - * @param \Shotstack\Client\Model\RenditionResponseAttributes[]|null $renditions The list of renditions generated from the source file. + * @param \ShotstackClient\Model\RenditionResponseAttributes[]|null $renditions The list of renditions generated from the source file. * * @return self */ diff --git a/src/Model/Poster.php b/src/Model/Poster.php index 5bb103e..13fc450 100644 --- a/src/Model/Poster.php +++ b/src/Model/Poster.php @@ -5,7 +5,7 @@ * PHP version 7.4 * * @category Class - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech */ @@ -26,17 +26,17 @@ * Do not edit the class manually. */ -namespace Shotstack\Client\Model; +namespace ShotstackClient\Model; use \ArrayAccess; -use \Shotstack\Client\ObjectSerializer; +use \ShotstackClient\ObjectSerializer; /** * Poster Class Doc Comment * * @category Class * @description Generate a poster image for the video at a specific point from the timeline. The poster image size will match the size of the output video. - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech * @implements \ArrayAccess diff --git a/src/Model/ProbeResponse.php b/src/Model/ProbeResponse.php index 26a7d23..1ddc24d 100644 --- a/src/Model/ProbeResponse.php +++ b/src/Model/ProbeResponse.php @@ -5,7 +5,7 @@ * PHP version 7.4 * * @category Class - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech */ @@ -26,17 +26,17 @@ * Do not edit the class manually. */ -namespace Shotstack\Client\Model; +namespace ShotstackClient\Model; use \ArrayAccess; -use \Shotstack\Client\ObjectSerializer; +use \ShotstackClient\ObjectSerializer; /** * ProbeResponse Class Doc Comment * * @category Class * @description The response received after a [probe request](#inspect-media) is submitted. The probe requests returns data from FFprobe formatted as JSON. - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech * @implements \ArrayAccess diff --git a/src/Model/QueuedResponse.php b/src/Model/QueuedResponse.php index be494e5..ec108c1 100644 --- a/src/Model/QueuedResponse.php +++ b/src/Model/QueuedResponse.php @@ -5,7 +5,7 @@ * PHP version 7.4 * * @category Class - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech */ @@ -26,17 +26,17 @@ * Do not edit the class manually. */ -namespace Shotstack\Client\Model; +namespace ShotstackClient\Model; use \ArrayAccess; -use \Shotstack\Client\ObjectSerializer; +use \ShotstackClient\ObjectSerializer; /** * QueuedResponse Class Doc Comment * * @category Class * @description The response received after a [render request](#render-asset) or [template render](#render-template) is submitted. The render task is queued for rendering and a unique render id is returned. - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech * @implements \ArrayAccess @@ -60,7 +60,7 @@ class QueuedResponse implements ModelInterface, ArrayAccess, \JsonSerializable protected static $openAPITypes = [ 'success' => 'bool', 'message' => 'string', - 'response' => '\Shotstack\Client\Model\QueuedResponseData' + 'response' => '\ShotstackClient\Model\QueuedResponseData' ]; /** @@ -370,7 +370,7 @@ public function setMessage($message) /** * Gets response * - * @return \Shotstack\Client\Model\QueuedResponseData + * @return \ShotstackClient\Model\QueuedResponseData */ public function getResponse() { @@ -380,7 +380,7 @@ public function getResponse() /** * Sets response * - * @param \Shotstack\Client\Model\QueuedResponseData $response response + * @param \ShotstackClient\Model\QueuedResponseData $response response * * @return self */ diff --git a/src/Model/QueuedResponseData.php b/src/Model/QueuedResponseData.php index 4482d52..d66a616 100644 --- a/src/Model/QueuedResponseData.php +++ b/src/Model/QueuedResponseData.php @@ -5,7 +5,7 @@ * PHP version 7.4 * * @category Class - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech */ @@ -26,17 +26,17 @@ * Do not edit the class manually. */ -namespace Shotstack\Client\Model; +namespace ShotstackClient\Model; use \ArrayAccess; -use \Shotstack\Client\ObjectSerializer; +use \ShotstackClient\ObjectSerializer; /** * QueuedResponseData Class Doc Comment * * @category Class * @description The response data returned with the [QueuedResponse](#tocs_queuedresponse). - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech * @implements \ArrayAccess diff --git a/src/Model/QueuedSourceResponse.php b/src/Model/QueuedSourceResponse.php index 118123c..dc51315 100644 --- a/src/Model/QueuedSourceResponse.php +++ b/src/Model/QueuedSourceResponse.php @@ -5,7 +5,7 @@ * PHP version 7.4 * * @category Class - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech */ @@ -26,17 +26,17 @@ * Do not edit the class manually. */ -namespace Shotstack\Client\Model; +namespace ShotstackClient\Model; use \ArrayAccess; -use \Shotstack\Client\ObjectSerializer; +use \ShotstackClient\ObjectSerializer; /** * QueuedSourceResponse Class Doc Comment * * @category Class * @description The response returned by the Ingest API [fetch source](#fetch-source) request. Includes the id of the source file. The response follows the [json:api](https://jsonapi.org/) specification. - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech * @implements \ArrayAccess @@ -58,7 +58,7 @@ class QueuedSourceResponse implements ModelInterface, ArrayAccess, \JsonSerializ * @var string[] */ protected static $openAPITypes = [ - 'data' => '\Shotstack\Client\Model\QueuedSourceResponseData' + 'data' => '\ShotstackClient\Model\QueuedSourceResponseData' ]; /** @@ -296,7 +296,7 @@ public function valid() /** * Gets data * - * @return \Shotstack\Client\Model\QueuedSourceResponseData + * @return \ShotstackClient\Model\QueuedSourceResponseData */ public function getData() { @@ -306,7 +306,7 @@ public function getData() /** * Sets data * - * @param \Shotstack\Client\Model\QueuedSourceResponseData $data data + * @param \ShotstackClient\Model\QueuedSourceResponseData $data data * * @return self */ diff --git a/src/Model/QueuedSourceResponseData.php b/src/Model/QueuedSourceResponseData.php index 0ab2857..c02afc4 100644 --- a/src/Model/QueuedSourceResponseData.php +++ b/src/Model/QueuedSourceResponseData.php @@ -5,7 +5,7 @@ * PHP version 7.4 * * @category Class - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech */ @@ -26,17 +26,17 @@ * Do not edit the class manually. */ -namespace Shotstack\Client\Model; +namespace ShotstackClient\Model; use \ArrayAccess; -use \Shotstack\Client\ObjectSerializer; +use \ShotstackClient\ObjectSerializer; /** * QueuedSourceResponseData Class Doc Comment * * @category Class * @description The type of resource (a source) and the newly created source id. Returned with [QueuedSourceResponse](#tocs_queuedsourceresponse). - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech * @implements \ArrayAccess diff --git a/src/Model/Range.php b/src/Model/Range.php index 907d3ef..8e8a406 100644 --- a/src/Model/Range.php +++ b/src/Model/Range.php @@ -5,7 +5,7 @@ * PHP version 7.4 * * @category Class - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech */ @@ -26,17 +26,17 @@ * Do not edit the class manually. */ -namespace Shotstack\Client\Model; +namespace ShotstackClient\Model; use \ArrayAccess; -use \Shotstack\Client\ObjectSerializer; +use \ShotstackClient\ObjectSerializer; /** * Range Class Doc Comment * * @category Class * @description Specify a time range to render, i.e. to render only a portion of a video or audio file. Omit this setting to export the entire video. Range can also be used to render a frame at a specific time point - setting a range and output format as `jpg` will output a single frame image at the range `start` point. - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech * @implements \ArrayAccess diff --git a/src/Model/RenderResponse.php b/src/Model/RenderResponse.php index 263ec1d..1ee675f 100644 --- a/src/Model/RenderResponse.php +++ b/src/Model/RenderResponse.php @@ -5,7 +5,7 @@ * PHP version 7.4 * * @category Class - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech */ @@ -26,17 +26,17 @@ * Do not edit the class manually. */ -namespace Shotstack\Client\Model; +namespace ShotstackClient\Model; use \ArrayAccess; -use \Shotstack\Client\ObjectSerializer; +use \ShotstackClient\ObjectSerializer; /** * RenderResponse Class Doc Comment * * @category Class * @description The response received after a [render status request](#get-render-status) is submitted. The response includes details about status of a render and the output URL. - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech * @implements \ArrayAccess @@ -60,7 +60,7 @@ class RenderResponse implements ModelInterface, ArrayAccess, \JsonSerializable protected static $openAPITypes = [ 'success' => 'bool', 'message' => 'string', - 'response' => '\Shotstack\Client\Model\RenderResponseData' + 'response' => '\ShotstackClient\Model\RenderResponseData' ]; /** @@ -370,7 +370,7 @@ public function setMessage($message) /** * Gets response * - * @return \Shotstack\Client\Model\RenderResponseData + * @return \ShotstackClient\Model\RenderResponseData */ public function getResponse() { @@ -380,7 +380,7 @@ public function getResponse() /** * Sets response * - * @param \Shotstack\Client\Model\RenderResponseData $response response + * @param \ShotstackClient\Model\RenderResponseData $response response * * @return self */ diff --git a/src/Model/RenderResponseData.php b/src/Model/RenderResponseData.php index 24623b5..bf28ab3 100644 --- a/src/Model/RenderResponseData.php +++ b/src/Model/RenderResponseData.php @@ -5,7 +5,7 @@ * PHP version 7.4 * * @category Class - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech */ @@ -26,17 +26,17 @@ * Do not edit the class manually. */ -namespace Shotstack\Client\Model; +namespace ShotstackClient\Model; use \ArrayAccess; -use \Shotstack\Client\ObjectSerializer; +use \ShotstackClient\ObjectSerializer; /** * RenderResponseData Class Doc Comment * * @category Class * @description The response data returned with the [RenderResponse](#tocs_renderresponse) including status and URL. - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech * @implements \ArrayAccess @@ -68,7 +68,7 @@ class RenderResponseData implements ModelInterface, ArrayAccess, \JsonSerializab 'url' => 'string', 'poster' => 'string', 'thumbnail' => 'string', - 'data' => '\Shotstack\Client\Model\Edit', + 'data' => '\ShotstackClient\Model\Edit', 'created' => 'string', 'updated' => 'string' ]; @@ -303,6 +303,7 @@ public function getModelName() public const STATUS_QUEUED = 'queued'; public const STATUS_FETCHING = 'fetching'; + public const STATUS_PREPROCESSING = 'preprocessing'; public const STATUS_RENDERING = 'rendering'; public const STATUS_SAVING = 'saving'; public const STATUS_DONE = 'done'; @@ -318,6 +319,7 @@ public function getStatusAllowableValues() return [ self::STATUS_QUEUED, self::STATUS_FETCHING, + self::STATUS_PREPROCESSING, self::STATUS_RENDERING, self::STATUS_SAVING, self::STATUS_DONE, @@ -509,7 +511,7 @@ public function getStatus() /** * Sets status * - * @param string $status The status of the render task.
  • `queued` - render is queued waiting to be rendered
  • `fetching` - assets are being fetched
  • `rendering` - the asset is being rendered
  • `saving` - the final asset is being saved to storage
  • `done` - the asset is ready to be downloaded
  • `failed` - there was an error rendering the asset
+ * @param string $status The status of the render task.
  • `queued` - render is queued waiting to be rendered
  • `fetching` - assets are being fetched
  • `preprocessing` - video assets are being processed for compatibility
  • `rendering` - the asset is being rendered
  • `saving` - the final asset is being saved to storage
  • `done` - the asset is ready to be downloaded
  • `failed` - there was an error rendering the asset
* * @return self */ @@ -712,7 +714,7 @@ public function setThumbnail($thumbnail) /** * Gets data * - * @return \Shotstack\Client\Model\Edit|null + * @return \ShotstackClient\Model\Edit|null */ public function getData() { @@ -722,7 +724,7 @@ public function getData() /** * Sets data * - * @param \Shotstack\Client\Model\Edit|null $data data + * @param \ShotstackClient\Model\Edit|null $data data * * @return self */ diff --git a/src/Model/Rendition.php b/src/Model/Rendition.php index d3fb868..22e853c 100644 --- a/src/Model/Rendition.php +++ b/src/Model/Rendition.php @@ -5,7 +5,7 @@ * PHP version 7.4 * * @category Class - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech */ @@ -26,17 +26,17 @@ * Do not edit the class manually. */ -namespace Shotstack\Client\Model; +namespace ShotstackClient\Model; use \ArrayAccess; -use \Shotstack\Client\ObjectSerializer; +use \ShotstackClient\ObjectSerializer; /** * Rendition Class Doc Comment * * @category Class * @description A rendition is a new output file that is generated from the source. The rendition can be encoded to a different format and have transformations applied to it such as resizing, cropping, etc... - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech * @implements \ArrayAccess @@ -59,14 +59,16 @@ class Rendition implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPITypes = [ 'format' => 'string', - 'size' => '\Shotstack\Client\Model\Size', + 'size' => '\ShotstackClient\Model\Size', 'fit' => 'string', 'resolution' => 'string', 'quality' => 'int', 'fps' => 'float', - 'speed' => '\Shotstack\Client\Model\Speed', + 'speed' => '\ShotstackClient\Model\Speed', 'keyframe_interval' => 'int', - 'enhance' => '\Shotstack\Client\Model\Enhancements', + 'fix_offset' => 'bool', + 'fix_rotation' => 'bool', + 'enhance' => '\ShotstackClient\Model\Enhancements', 'filename' => 'string' ]; @@ -86,6 +88,8 @@ class Rendition implements ModelInterface, ArrayAccess, \JsonSerializable 'fps' => null, 'speed' => null, 'keyframe_interval' => null, + 'fix_offset' => null, + 'fix_rotation' => null, 'enhance' => null, 'filename' => null ]; @@ -104,6 +108,8 @@ class Rendition implements ModelInterface, ArrayAccess, \JsonSerializable 'fps' => false, 'speed' => false, 'keyframe_interval' => false, + 'fix_offset' => false, + 'fix_rotation' => false, 'enhance' => false, 'filename' => false ]; @@ -202,6 +208,8 @@ public function isNullableSetToNull(string $property): bool 'fps' => 'fps', 'speed' => 'speed', 'keyframe_interval' => 'keyframeInterval', + 'fix_offset' => 'fixOffset', + 'fix_rotation' => 'fixRotation', 'enhance' => 'enhance', 'filename' => 'filename' ]; @@ -220,6 +228,8 @@ public function isNullableSetToNull(string $property): bool 'fps' => 'setFps', 'speed' => 'setSpeed', 'keyframe_interval' => 'setKeyframeInterval', + 'fix_offset' => 'setFixOffset', + 'fix_rotation' => 'setFixRotation', 'enhance' => 'setEnhance', 'filename' => 'setFilename' ]; @@ -238,6 +248,8 @@ public function isNullableSetToNull(string $property): bool 'fps' => 'getFps', 'speed' => 'getSpeed', 'keyframe_interval' => 'getKeyframeInterval', + 'fix_offset' => 'getFixOffset', + 'fix_rotation' => 'getFixRotation', 'enhance' => 'getEnhance', 'filename' => 'getFilename' ]; @@ -419,6 +431,8 @@ public function __construct(array $data = null) $this->setIfExists('fps', $data ?? [], null); $this->setIfExists('speed', $data ?? [], null); $this->setIfExists('keyframe_interval', $data ?? [], null); + $this->setIfExists('fix_offset', $data ?? [], null); + $this->setIfExists('fix_rotation', $data ?? [], null); $this->setIfExists('enhance', $data ?? [], null); $this->setIfExists('filename', $data ?? [], null); } @@ -557,7 +571,7 @@ public function setFormat($format) /** * Gets size * - * @return \Shotstack\Client\Model\Size|null + * @return \ShotstackClient\Model\Size|null */ public function getSize() { @@ -567,7 +581,7 @@ public function getSize() /** * Sets size * - * @param \Shotstack\Client\Model\Size|null $size size + * @param \ShotstackClient\Model\Size|null $size size * * @return self */ @@ -730,7 +744,7 @@ public function setFps($fps) /** * Gets speed * - * @return \Shotstack\Client\Model\Speed|null + * @return \ShotstackClient\Model\Speed|null */ public function getSpeed() { @@ -740,7 +754,7 @@ public function getSpeed() /** * Sets speed * - * @param \Shotstack\Client\Model\Speed|null $speed speed + * @param \ShotstackClient\Model\Speed|null $speed speed * * @return self */ @@ -789,10 +803,64 @@ public function setKeyframeInterval($keyframe_interval) return $this; } + /** + * Gets fix_offset + * + * @return bool|null + */ + public function getFixOffset() + { + return $this->container['fix_offset']; + } + + /** + * Sets fix_offset + * + * @param bool|null $fix_offset Attempt to fix audio and video sync issues. This can occur when recording devices, such as smartphones and web cams use compression techniques like [Variable Frame Rate](https://en.wikipedia.org/wiki/Variable_frame_rate) (VFR) which can cause audio and video to go out of sync. This option will attempt to fix the sync issues. + * + * @return self + */ + public function setFixOffset($fix_offset) + { + if (is_null($fix_offset)) { + throw new \InvalidArgumentException('non-nullable fix_offset cannot be null'); + } + $this->container['fix_offset'] = $fix_offset; + + return $this; + } + + /** + * Gets fix_rotation + * + * @return bool|null + */ + public function getFixRotation() + { + return $this->container['fix_rotation']; + } + + /** + * Sets fix_rotation + * + * @param bool|null $fix_rotation Automatically reset the rotation of the video based on the orientation metadata in the video file. This is useful for videos recorded on smartphones that have orientation metadata that may not work correctly with certain video editing software, including the Shotstack Edit API. + * + * @return self + */ + public function setFixRotation($fix_rotation) + { + if (is_null($fix_rotation)) { + throw new \InvalidArgumentException('non-nullable fix_rotation cannot be null'); + } + $this->container['fix_rotation'] = $fix_rotation; + + return $this; + } + /** * Gets enhance * - * @return \Shotstack\Client\Model\Enhancements|null + * @return \ShotstackClient\Model\Enhancements|null */ public function getEnhance() { @@ -802,7 +870,7 @@ public function getEnhance() /** * Sets enhance * - * @param \Shotstack\Client\Model\Enhancements|null $enhance enhance + * @param \ShotstackClient\Model\Enhancements|null $enhance enhance * * @return self */ diff --git a/src/Model/RenditionResponseAttributes.php b/src/Model/RenditionResponseAttributes.php index 7d8494d..21a5273 100644 --- a/src/Model/RenditionResponseAttributes.php +++ b/src/Model/RenditionResponseAttributes.php @@ -5,7 +5,7 @@ * PHP version 7.4 * * @category Class - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech */ @@ -26,17 +26,17 @@ * Do not edit the class manually. */ -namespace Shotstack\Client\Model; +namespace ShotstackClient\Model; use \ArrayAccess; -use \Shotstack\Client\ObjectSerializer; +use \ShotstackClient\ObjectSerializer; /** * RenditionResponseAttributes Class Doc Comment * * @category Class * @description The id and attributes of the generated rendition file. - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech * @implements \ArrayAccess @@ -62,7 +62,7 @@ class RenditionResponseAttributes implements ModelInterface, ArrayAccess, \JsonS 'status' => 'string', 'url' => 'string', 'execution_time' => 'float', - 'transformation' => '\Shotstack\Client\Model\Rendition', + 'transformation' => '\ShotstackClient\Model\Rendition', 'width' => 'int', 'height' => 'int', 'duration' => 'float', @@ -502,7 +502,7 @@ public function setExecutionTime($execution_time) /** * Gets transformation * - * @return \Shotstack\Client\Model\Rendition|null + * @return \ShotstackClient\Model\Rendition|null */ public function getTransformation() { @@ -512,7 +512,7 @@ public function getTransformation() /** * Sets transformation * - * @param \Shotstack\Client\Model\Rendition|null $transformation transformation + * @param \ShotstackClient\Model\Rendition|null $transformation transformation * * @return self */ diff --git a/src/Model/GeneratedAssetErrorResponseData.php b/src/Model/RichCaptionActive.php similarity index 76% rename from src/Model/GeneratedAssetErrorResponseData.php rename to src/Model/RichCaptionActive.php index 6f71aca..bd3706a 100644 --- a/src/Model/GeneratedAssetErrorResponseData.php +++ b/src/Model/RichCaptionActive.php @@ -1,11 +1,11 @@ */ -class GeneratedAssetErrorResponseData implements ModelInterface, ArrayAccess, \JsonSerializable +class RichCaptionActive implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; @@ -50,7 +50,7 @@ class GeneratedAssetErrorResponseData implements ModelInterface, ArrayAccess, \J * * @var string */ - protected static $openAPIModelName = 'GeneratedAssetErrorResponseData'; + protected static $openAPIModelName = 'RichCaptionActive'; /** * Array of property to type mappings. Used for (de)serialization @@ -58,9 +58,9 @@ class GeneratedAssetErrorResponseData implements ModelInterface, ArrayAccess, \J * @var string[] */ protected static $openAPITypes = [ - 'status' => 'string', - 'title' => 'string', - 'detail' => 'string' + 'font' => '\ShotstackClient\Model\RichCaptionActiveFont', + 'stroke' => '\ShotstackClient\Model\RichCaptionActiveStroke', + 'shadow' => '\ShotstackClient\Model\RichCaptionActiveShadow' ]; /** @@ -71,9 +71,9 @@ class GeneratedAssetErrorResponseData implements ModelInterface, ArrayAccess, \J * @psalm-var array */ protected static $openAPIFormats = [ - 'status' => null, - 'title' => null, - 'detail' => null + 'font' => null, + 'stroke' => null, + 'shadow' => null ]; /** @@ -82,9 +82,9 @@ class GeneratedAssetErrorResponseData implements ModelInterface, ArrayAccess, \J * @var boolean[] */ protected static array $openAPINullables = [ - 'status' => false, - 'title' => false, - 'detail' => false + 'font' => false, + 'stroke' => false, + 'shadow' => false ]; /** @@ -173,9 +173,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'status' => 'status', - 'title' => 'title', - 'detail' => 'detail' + 'font' => 'font', + 'stroke' => 'stroke', + 'shadow' => 'shadow' ]; /** @@ -184,9 +184,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'status' => 'setStatus', - 'title' => 'setTitle', - 'detail' => 'setDetail' + 'font' => 'setFont', + 'stroke' => 'setStroke', + 'shadow' => 'setShadow' ]; /** @@ -195,9 +195,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'status' => 'getStatus', - 'title' => 'getTitle', - 'detail' => 'getDetail' + 'font' => 'getFont', + 'stroke' => 'getStroke', + 'shadow' => 'getShadow' ]; /** @@ -257,9 +257,9 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->setIfExists('status', $data ?? [], null); - $this->setIfExists('title', $data ?? [], null); - $this->setIfExists('detail', $data ?? [], null); + $this->setIfExists('font', $data ?? [], null); + $this->setIfExists('stroke', $data ?? [], null); + $this->setIfExists('shadow', $data ?? [], null); } /** @@ -289,15 +289,6 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['status'] === null) { - $invalidProperties[] = "'status' can't be null"; - } - if ($this->container['title'] === null) { - $invalidProperties[] = "'title' can't be null"; - } - if ($this->container['detail'] === null) { - $invalidProperties[] = "'detail' can't be null"; - } return $invalidProperties; } @@ -314,82 +305,82 @@ public function valid() /** - * Gets status + * Gets font * - * @return string + * @return \ShotstackClient\Model\RichCaptionActiveFont|null */ - public function getStatus() + public function getFont() { - return $this->container['status']; + return $this->container['font']; } /** - * Sets status + * Sets font * - * @param string $status The http status code. + * @param \ShotstackClient\Model\RichCaptionActiveFont|null $font font * * @return self */ - public function setStatus($status) + public function setFont($font) { - if (is_null($status)) { - throw new \InvalidArgumentException('non-nullable status cannot be null'); + if (is_null($font)) { + throw new \InvalidArgumentException('non-nullable font cannot be null'); } - $this->container['status'] = $status; + $this->container['font'] = $font; return $this; } /** - * Gets title + * Gets stroke * - * @return string + * @return \ShotstackClient\Model\RichCaptionActiveStroke|null */ - public function getTitle() + public function getStroke() { - return $this->container['title']; + return $this->container['stroke']; } /** - * Sets title + * Sets stroke * - * @param string $title A short summary of the error. + * @param \ShotstackClient\Model\RichCaptionActiveStroke|null $stroke stroke * * @return self */ - public function setTitle($title) + public function setStroke($stroke) { - if (is_null($title)) { - throw new \InvalidArgumentException('non-nullable title cannot be null'); + if (is_null($stroke)) { + throw new \InvalidArgumentException('non-nullable stroke cannot be null'); } - $this->container['title'] = $title; + $this->container['stroke'] = $stroke; return $this; } /** - * Gets detail + * Gets shadow * - * @return string + * @return \ShotstackClient\Model\RichCaptionActiveShadow|null */ - public function getDetail() + public function getShadow() { - return $this->container['detail']; + return $this->container['shadow']; } /** - * Sets detail + * Sets shadow * - * @param string $detail A detailed description of the error. + * @param \ShotstackClient\Model\RichCaptionActiveShadow|null $shadow shadow * * @return self */ - public function setDetail($detail) + public function setShadow($shadow) { - if (is_null($detail)) { - throw new \InvalidArgumentException('non-nullable detail cannot be null'); + if (is_null($shadow)) { + throw new \InvalidArgumentException('non-nullable shadow cannot be null'); } - $this->container['detail'] = $detail; + $this->container['shadow'] = $shadow; return $this; } diff --git a/src/Model/RichCaptionActiveFont.php b/src/Model/RichCaptionActiveFont.php new file mode 100644 index 0000000..b553cf1 --- /dev/null +++ b/src/Model/RichCaptionActiveFont.php @@ -0,0 +1,707 @@ + + */ +class RichCaptionActiveFont implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'RichCaptionActiveFont'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'family' => 'string', + 'weight' => 'mixed', + 'color' => 'string', + 'background' => 'string', + 'opacity' => 'float', + 'size' => 'float', + 'text_decoration' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'family' => null, + 'weight' => null, + 'color' => null, + 'background' => null, + 'opacity' => null, + 'size' => null, + 'text_decoration' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'family' => false, + 'weight' => true, + 'color' => false, + 'background' => false, + 'opacity' => false, + 'size' => false, + 'text_decoration' => 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; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $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 = [ + 'family' => 'family', + 'weight' => 'weight', + 'color' => 'color', + 'background' => 'background', + 'opacity' => 'opacity', + 'size' => 'size', + 'text_decoration' => 'textDecoration' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'family' => 'setFamily', + 'weight' => 'setWeight', + 'color' => 'setColor', + 'background' => 'setBackground', + 'opacity' => 'setOpacity', + 'size' => 'setSize', + 'text_decoration' => 'setTextDecoration' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'family' => 'getFamily', + 'weight' => 'getWeight', + 'color' => 'getColor', + 'background' => 'getBackground', + 'opacity' => 'getOpacity', + 'size' => 'getSize', + 'text_decoration' => 'getTextDecoration' + ]; + + /** + * 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 TEXT_DECORATION_NONE = 'none'; + public const TEXT_DECORATION_UNDERLINE = 'underline'; + public const TEXT_DECORATION_LINE_THROUGH = 'line-through'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTextDecorationAllowableValues() + { + return [ + self::TEXT_DECORATION_NONE, + self::TEXT_DECORATION_UNDERLINE, + self::TEXT_DECORATION_LINE_THROUGH, + ]; + } + + /** + * 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) + { + $this->setIfExists('family', $data ?? [], null); + $this->setIfExists('weight', $data ?? [], null); + $this->setIfExists('color', $data ?? [], null); + $this->setIfExists('background', $data ?? [], null); + $this->setIfExists('opacity', $data ?? [], 1); + $this->setIfExists('size', $data ?? [], null); + $this->setIfExists('text_decoration', $data ?? [], 'none'); + } + + /** + * 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['color']) && !preg_match("/^#[A-Fa-f0-9]{6}$/", $this->container['color'])) { + $invalidProperties[] = "invalid value for 'color', must be conform to the pattern /^#[A-Fa-f0-9]{6}$/."; + } + + if (!is_null($this->container['background']) && !preg_match("/^#[A-Fa-f0-9]{6}$/", $this->container['background'])) { + $invalidProperties[] = "invalid value for 'background', must be conform to the pattern /^#[A-Fa-f0-9]{6}$/."; + } + + if (!is_null($this->container['opacity']) && ($this->container['opacity'] > 1)) { + $invalidProperties[] = "invalid value for 'opacity', must be smaller than or equal to 1."; + } + + if (!is_null($this->container['opacity']) && ($this->container['opacity'] < 0)) { + $invalidProperties[] = "invalid value for 'opacity', must be bigger than or equal to 0."; + } + + if (!is_null($this->container['size']) && ($this->container['size'] > 500)) { + $invalidProperties[] = "invalid value for 'size', must be smaller than or equal to 500."; + } + + if (!is_null($this->container['size']) && ($this->container['size'] < 1)) { + $invalidProperties[] = "invalid value for 'size', must be bigger than or equal to 1."; + } + + $allowedValues = $this->getTextDecorationAllowableValues(); + if (!is_null($this->container['text_decoration']) && !in_array($this->container['text_decoration'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'text_decoration', must be one of '%s'", + $this->container['text_decoration'], + 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 family + * + * @return string|null + */ + public function getFamily() + { + return $this->container['family']; + } + + /** + * Sets family + * + * @param string|null $family The font family for the active word. Inherits from the base font.family when not set. + * + * @return self + */ + public function setFamily($family) + { + if (is_null($family)) { + throw new \InvalidArgumentException('non-nullable family cannot be null'); + } + $this->container['family'] = $family; + + return $this; + } + + /** + * Gets weight + * + * @return mixed|null + */ + public function getWeight() + { + return $this->container['weight']; + } + + /** + * Sets weight + * + * @param mixed|null $weight The weight of the font for the active word. Can be a number (100-900) or a string. Inherits from the base font.weight when not set. + * + * @return self + */ + public function setWeight($weight) + { + if (is_null($weight)) { + array_push($this->openAPINullablesSetToNull, 'weight'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('weight', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['weight'] = $weight; + + return $this; + } + + /** + * Gets color + * + * @return string|null + */ + public function getColor() + { + return $this->container['color']; + } + + /** + * Sets color + * + * @param string|null $color The active word color using hexadecimal color notation. + * + * @return self + */ + public function setColor($color) + { + if (is_null($color)) { + throw new \InvalidArgumentException('non-nullable color cannot be null'); + } + + if ((!preg_match("/^#[A-Fa-f0-9]{6}$/", ObjectSerializer::toString($color)))) { + throw new \InvalidArgumentException("invalid value for \$color when calling RichCaptionActiveFont., must conform to the pattern /^#[A-Fa-f0-9]{6}$/."); + } + + $this->container['color'] = $color; + + return $this; + } + + /** + * Gets background + * + * @return string|null + */ + public function getBackground() + { + return $this->container['background']; + } + + /** + * Sets background + * + * @param string|null $background The background color behind the active word using hexadecimal color notation. + * + * @return self + */ + public function setBackground($background) + { + if (is_null($background)) { + throw new \InvalidArgumentException('non-nullable background cannot be null'); + } + + if ((!preg_match("/^#[A-Fa-f0-9]{6}$/", ObjectSerializer::toString($background)))) { + throw new \InvalidArgumentException("invalid value for \$background when calling RichCaptionActiveFont., must conform to the pattern /^#[A-Fa-f0-9]{6}$/."); + } + + $this->container['background'] = $background; + + return $this; + } + + /** + * Gets opacity + * + * @return float|null + */ + public function getOpacity() + { + return $this->container['opacity']; + } + + /** + * Sets opacity + * + * @param float|null $opacity The opacity of the active word where 1 is opaque and 0 is transparent. + * + * @return self + */ + public function setOpacity($opacity) + { + if (is_null($opacity)) { + throw new \InvalidArgumentException('non-nullable opacity cannot be null'); + } + + if (($opacity > 1)) { + throw new \InvalidArgumentException('invalid value for $opacity when calling RichCaptionActiveFont., must be smaller than or equal to 1.'); + } + if (($opacity < 0)) { + throw new \InvalidArgumentException('invalid value for $opacity when calling RichCaptionActiveFont., must be bigger than or equal to 0.'); + } + + $this->container['opacity'] = $opacity; + + return $this; + } + + /** + * Gets size + * + * @return float|null + */ + public function getSize() + { + return $this->container['size']; + } + + /** + * Sets size + * + * @param float|null $size The font size of the active word in pixels. + * + * @return self + */ + public function setSize($size) + { + if (is_null($size)) { + throw new \InvalidArgumentException('non-nullable size cannot be null'); + } + + if (($size > 500)) { + throw new \InvalidArgumentException('invalid value for $size when calling RichCaptionActiveFont., must be smaller than or equal to 500.'); + } + if (($size < 1)) { + throw new \InvalidArgumentException('invalid value for $size when calling RichCaptionActiveFont., must be bigger than or equal to 1.'); + } + + $this->container['size'] = $size; + + return $this; + } + + /** + * Gets text_decoration + * + * @return string|null + */ + public function getTextDecoration() + { + return $this->container['text_decoration']; + } + + /** + * Sets text_decoration + * + * @param string|null $text_decoration Text decoration to apply to the active word. + * + * @return self + */ + public function setTextDecoration($text_decoration) + { + if (is_null($text_decoration)) { + throw new \InvalidArgumentException('non-nullable text_decoration cannot be null'); + } + $allowedValues = $this->getTextDecorationAllowableValues(); + if (!in_array($text_decoration, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'text_decoration', must be one of '%s'", + $text_decoration, + implode("', '", $allowedValues) + ) + ); + } + $this->container['text_decoration'] = $text_decoration; + + 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() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/RichCaptionActiveShadow.php b/src/Model/RichCaptionActiveShadow.php new file mode 100644 index 0000000..db78509 --- /dev/null +++ b/src/Model/RichCaptionActiveShadow.php @@ -0,0 +1,580 @@ + + */ +class RichCaptionActiveShadow implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'RichCaptionActive_shadow'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'offset_x' => 'float', + 'offset_y' => 'float', + 'blur' => 'float', + 'color' => 'string', + 'opacity' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'offset_x' => null, + 'offset_y' => null, + 'blur' => null, + 'color' => null, + 'opacity' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'offset_x' => false, + 'offset_y' => false, + 'blur' => false, + 'color' => false, + 'opacity' => 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; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $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 = [ + 'offset_x' => 'offsetX', + 'offset_y' => 'offsetY', + 'blur' => 'blur', + 'color' => 'color', + 'opacity' => 'opacity' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'offset_x' => 'setOffsetX', + 'offset_y' => 'setOffsetY', + 'blur' => 'setBlur', + 'color' => 'setColor', + 'opacity' => 'setOpacity' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'offset_x' => 'getOffsetX', + 'offset_y' => 'getOffsetY', + 'blur' => 'getBlur', + 'color' => 'getColor', + 'opacity' => 'getOpacity' + ]; + + /** + * 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) + { + $this->setIfExists('offset_x', $data ?? [], 0); + $this->setIfExists('offset_y', $data ?? [], 0); + $this->setIfExists('blur', $data ?? [], 0); + $this->setIfExists('color', $data ?? [], '#000000'); + $this->setIfExists('opacity', $data ?? [], 0.5); + } + + /** + * 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['blur']) && ($this->container['blur'] < 0)) { + $invalidProperties[] = "invalid value for 'blur', must be bigger than or equal to 0."; + } + + if (!is_null($this->container['color']) && !preg_match("/^#[A-Fa-f0-9]{6}$/", $this->container['color'])) { + $invalidProperties[] = "invalid value for 'color', must be conform to the pattern /^#[A-Fa-f0-9]{6}$/."; + } + + if (!is_null($this->container['opacity']) && ($this->container['opacity'] > 1)) { + $invalidProperties[] = "invalid value for 'opacity', must be smaller than or equal to 1."; + } + + if (!is_null($this->container['opacity']) && ($this->container['opacity'] < 0)) { + $invalidProperties[] = "invalid value for 'opacity', must be bigger than or equal to 0."; + } + + 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 offset_x + * + * @return float|null + */ + public function getOffsetX() + { + return $this->container['offset_x']; + } + + /** + * Sets offset_x + * + * @param float|null $offset_x Horizontal offset of the shadow in pixels. Positive values move right, negative left. + * + * @return self + */ + public function setOffsetX($offset_x) + { + if (is_null($offset_x)) { + throw new \InvalidArgumentException('non-nullable offset_x cannot be null'); + } + $this->container['offset_x'] = $offset_x; + + return $this; + } + + /** + * Gets offset_y + * + * @return float|null + */ + public function getOffsetY() + { + return $this->container['offset_y']; + } + + /** + * Sets offset_y + * + * @param float|null $offset_y Vertical offset of the shadow in pixels. Positive values move down, negative up. + * + * @return self + */ + public function setOffsetY($offset_y) + { + if (is_null($offset_y)) { + throw new \InvalidArgumentException('non-nullable offset_y cannot be null'); + } + $this->container['offset_y'] = $offset_y; + + return $this; + } + + /** + * Gets blur + * + * @return float|null + */ + public function getBlur() + { + return $this->container['blur']; + } + + /** + * Sets blur + * + * @param float|null $blur The blur radius of the shadow in pixels. Must be 0 or greater. + * + * @return self + */ + public function setBlur($blur) + { + if (is_null($blur)) { + throw new \InvalidArgumentException('non-nullable blur cannot be null'); + } + + if (($blur < 0)) { + throw new \InvalidArgumentException('invalid value for $blur when calling RichCaptionActiveShadow., must be bigger than or equal to 0.'); + } + + $this->container['blur'] = $blur; + + return $this; + } + + /** + * Gets color + * + * @return string|null + */ + public function getColor() + { + return $this->container['color']; + } + + /** + * Sets color + * + * @param string|null $color The shadow color using hexadecimal color notation. + * + * @return self + */ + public function setColor($color) + { + if (is_null($color)) { + throw new \InvalidArgumentException('non-nullable color cannot be null'); + } + + if ((!preg_match("/^#[A-Fa-f0-9]{6}$/", ObjectSerializer::toString($color)))) { + throw new \InvalidArgumentException("invalid value for \$color when calling RichCaptionActiveShadow., must conform to the pattern /^#[A-Fa-f0-9]{6}$/."); + } + + $this->container['color'] = $color; + + return $this; + } + + /** + * Gets opacity + * + * @return float|null + */ + public function getOpacity() + { + return $this->container['opacity']; + } + + /** + * Sets opacity + * + * @param float|null $opacity The opacity of the shadow where 1 is opaque and 0 is transparent. + * + * @return self + */ + public function setOpacity($opacity) + { + if (is_null($opacity)) { + throw new \InvalidArgumentException('non-nullable opacity cannot be null'); + } + + if (($opacity > 1)) { + throw new \InvalidArgumentException('invalid value for $opacity when calling RichCaptionActiveShadow., must be smaller than or equal to 1.'); + } + if (($opacity < 0)) { + throw new \InvalidArgumentException('invalid value for $opacity when calling RichCaptionActiveShadow., must be bigger than or equal to 0.'); + } + + $this->container['opacity'] = $opacity; + + 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() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/RichCaptionActiveStroke.php b/src/Model/RichCaptionActiveStroke.php new file mode 100644 index 0000000..ca65d27 --- /dev/null +++ b/src/Model/RichCaptionActiveStroke.php @@ -0,0 +1,512 @@ + + */ +class RichCaptionActiveStroke implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'RichCaptionActive_stroke'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'width' => 'float', + 'color' => 'string', + 'opacity' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'width' => null, + 'color' => null, + 'opacity' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'width' => false, + 'color' => false, + 'opacity' => 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; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $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 = [ + 'width' => 'width', + 'color' => 'color', + 'opacity' => 'opacity' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'width' => 'setWidth', + 'color' => 'setColor', + 'opacity' => 'setOpacity' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'width' => 'getWidth', + 'color' => 'getColor', + 'opacity' => 'getOpacity' + ]; + + /** + * 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) + { + $this->setIfExists('width', $data ?? [], 0); + $this->setIfExists('color', $data ?? [], '#000000'); + $this->setIfExists('opacity', $data ?? [], 1); + } + + /** + * 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['width']) && ($this->container['width'] < 0)) { + $invalidProperties[] = "invalid value for 'width', must be bigger than or equal to 0."; + } + + if (!is_null($this->container['color']) && !preg_match("/^#[A-Fa-f0-9]{6}$/", $this->container['color'])) { + $invalidProperties[] = "invalid value for 'color', must be conform to the pattern /^#[A-Fa-f0-9]{6}$/."; + } + + if (!is_null($this->container['opacity']) && ($this->container['opacity'] > 1)) { + $invalidProperties[] = "invalid value for 'opacity', must be smaller than or equal to 1."; + } + + if (!is_null($this->container['opacity']) && ($this->container['opacity'] < 0)) { + $invalidProperties[] = "invalid value for 'opacity', must be bigger than or equal to 0."; + } + + 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 width + * + * @return float|null + */ + public function getWidth() + { + return $this->container['width']; + } + + /** + * Sets width + * + * @param float|null $width The width of the stroke in pixels. Must be 0 or greater. + * + * @return self + */ + public function setWidth($width) + { + if (is_null($width)) { + throw new \InvalidArgumentException('non-nullable width cannot be null'); + } + + if (($width < 0)) { + throw new \InvalidArgumentException('invalid value for $width when calling RichCaptionActiveStroke., must be bigger than or equal to 0.'); + } + + $this->container['width'] = $width; + + return $this; + } + + /** + * Gets color + * + * @return string|null + */ + public function getColor() + { + return $this->container['color']; + } + + /** + * Sets color + * + * @param string|null $color The stroke color using hexadecimal color notation. + * + * @return self + */ + public function setColor($color) + { + if (is_null($color)) { + throw new \InvalidArgumentException('non-nullable color cannot be null'); + } + + if ((!preg_match("/^#[A-Fa-f0-9]{6}$/", ObjectSerializer::toString($color)))) { + throw new \InvalidArgumentException("invalid value for \$color when calling RichCaptionActiveStroke., must conform to the pattern /^#[A-Fa-f0-9]{6}$/."); + } + + $this->container['color'] = $color; + + return $this; + } + + /** + * Gets opacity + * + * @return float|null + */ + public function getOpacity() + { + return $this->container['opacity']; + } + + /** + * Sets opacity + * + * @param float|null $opacity The opacity of the stroke where 1 is opaque and 0 is transparent. + * + * @return self + */ + public function setOpacity($opacity) + { + if (is_null($opacity)) { + throw new \InvalidArgumentException('non-nullable opacity cannot be null'); + } + + if (($opacity > 1)) { + throw new \InvalidArgumentException('invalid value for $opacity when calling RichCaptionActiveStroke., must be smaller than or equal to 1.'); + } + if (($opacity < 0)) { + throw new \InvalidArgumentException('invalid value for $opacity when calling RichCaptionActiveStroke., must be bigger than or equal to 0.'); + } + + $this->container['opacity'] = $opacity; + + 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() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ElevenLabsTextToSpeechOptions.php b/src/Model/RichCaptionAnimation.php similarity index 65% rename from src/Model/ElevenLabsTextToSpeechOptions.php rename to src/Model/RichCaptionAnimation.php index dbe8325..a60fb37 100644 --- a/src/Model/ElevenLabsTextToSpeechOptions.php +++ b/src/Model/RichCaptionAnimation.php @@ -1,11 +1,11 @@ */ -class ElevenLabsTextToSpeechOptions implements ModelInterface, ArrayAccess, \JsonSerializable +class RichCaptionAnimation implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; @@ -50,7 +50,7 @@ class ElevenLabsTextToSpeechOptions implements ModelInterface, ArrayAccess, \Jso * * @var string */ - protected static $openAPIModelName = 'ElevenLabsTextToSpeechOptions'; + protected static $openAPIModelName = 'RichCaptionAnimation'; /** * Array of property to type mappings. Used for (de)serialization @@ -58,9 +58,8 @@ class ElevenLabsTextToSpeechOptions implements ModelInterface, ArrayAccess, \Jso * @var string[] */ protected static $openAPITypes = [ - 'type' => 'string', - 'text' => 'string', - 'voice' => 'string' + 'style' => 'string', + 'direction' => 'string' ]; /** @@ -71,9 +70,8 @@ class ElevenLabsTextToSpeechOptions implements ModelInterface, ArrayAccess, \Jso * @psalm-var array */ protected static $openAPIFormats = [ - 'type' => null, - 'text' => null, - 'voice' => null + 'style' => null, + 'direction' => null ]; /** @@ -82,9 +80,8 @@ class ElevenLabsTextToSpeechOptions implements ModelInterface, ArrayAccess, \Jso * @var boolean[] */ protected static array $openAPINullables = [ - 'type' => false, - 'text' => false, - 'voice' => false + 'style' => false, + 'direction' => false ]; /** @@ -173,9 +170,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'type' => 'type', - 'text' => 'text', - 'voice' => 'voice' + 'style' => 'style', + 'direction' => 'direction' ]; /** @@ -184,9 +180,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'type' => 'setType', - 'text' => 'setText', - 'voice' => 'setVoice' + 'style' => 'setStyle', + 'direction' => 'setDirection' ]; /** @@ -195,9 +190,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'type' => 'getType', - 'text' => 'getText', - 'voice' => 'getVoice' + 'style' => 'getStyle', + 'direction' => 'getDirection' ]; /** @@ -241,26 +235,35 @@ public function getModelName() return self::$openAPIModelName; } - public const TYPE_TEXT_TO_SPEECH = 'text-to-speech'; - public const VOICE_ADAM = 'Adam'; - public const VOICE_ANTONI = 'Antoni'; - public const VOICE_ARNOLD = 'Arnold'; - public const VOICE_BELLA = 'Bella'; - public const VOICE_DOMI = 'Domi'; - public const VOICE_ELLI = 'Elli'; - public const VOICE_JOSH = 'Josh'; - public const VOICE_RACHEL = 'Rachel'; - public const VOICE_SAM = 'Sam'; + public const STYLE_KARAOKE = 'karaoke'; + public const STYLE_HIGHLIGHT = 'highlight'; + public const STYLE_POP = 'pop'; + public const STYLE_FADE = 'fade'; + public const STYLE_SLIDE = 'slide'; + public const STYLE_BOUNCE = 'bounce'; + public const STYLE_TYPEWRITER = 'typewriter'; + public const STYLE_NONE = 'none'; + public const DIRECTION_LEFT = 'left'; + public const DIRECTION_RIGHT = 'right'; + public const DIRECTION_UP = 'up'; + public const DIRECTION_DOWN = 'down'; /** * Gets allowable values of the enum * * @return string[] */ - public function getTypeAllowableValues() + public function getStyleAllowableValues() { return [ - self::TYPE_TEXT_TO_SPEECH, + self::STYLE_KARAOKE, + self::STYLE_HIGHLIGHT, + self::STYLE_POP, + self::STYLE_FADE, + self::STYLE_SLIDE, + self::STYLE_BOUNCE, + self::STYLE_TYPEWRITER, + self::STYLE_NONE, ]; } @@ -269,18 +272,13 @@ public function getTypeAllowableValues() * * @return string[] */ - public function getVoiceAllowableValues() + public function getDirectionAllowableValues() { return [ - self::VOICE_ADAM, - self::VOICE_ANTONI, - self::VOICE_ARNOLD, - self::VOICE_BELLA, - self::VOICE_DOMI, - self::VOICE_ELLI, - self::VOICE_JOSH, - self::VOICE_RACHEL, - self::VOICE_SAM, + self::DIRECTION_LEFT, + self::DIRECTION_RIGHT, + self::DIRECTION_UP, + self::DIRECTION_DOWN, ]; } @@ -299,9 +297,8 @@ public function getVoiceAllowableValues() */ public function __construct(array $data = null) { - $this->setIfExists('type', $data ?? [], null); - $this->setIfExists('text', $data ?? [], null); - $this->setIfExists('voice', $data ?? [], null); + $this->setIfExists('style', $data ?? [], 'highlight'); + $this->setIfExists('direction', $data ?? [], 'up'); } /** @@ -331,29 +328,23 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['type'] === null) { - $invalidProperties[] = "'type' can't be null"; + if ($this->container['style'] === null) { + $invalidProperties[] = "'style' can't be null"; } - $allowedValues = $this->getTypeAllowableValues(); - if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $allowedValues = $this->getStyleAllowableValues(); + if (!is_null($this->container['style']) && !in_array($this->container['style'], $allowedValues, true)) { $invalidProperties[] = sprintf( - "invalid value '%s' for 'type', must be one of '%s'", - $this->container['type'], + "invalid value '%s' for 'style', must be one of '%s'", + $this->container['style'], implode("', '", $allowedValues) ); } - if ($this->container['text'] === null) { - $invalidProperties[] = "'text' can't be null"; - } - if ($this->container['voice'] === null) { - $invalidProperties[] = "'voice' can't be null"; - } - $allowedValues = $this->getVoiceAllowableValues(); - if (!is_null($this->container['voice']) && !in_array($this->container['voice'], $allowedValues, true)) { + $allowedValues = $this->getDirectionAllowableValues(); + if (!is_null($this->container['direction']) && !in_array($this->container['direction'], $allowedValues, true)) { $invalidProperties[] = sprintf( - "invalid value '%s' for 'voice', must be one of '%s'", - $this->container['voice'], + "invalid value '%s' for 'direction', must be one of '%s'", + $this->container['direction'], implode("', '", $allowedValues) ); } @@ -374,102 +365,75 @@ public function valid() /** - * Gets type + * Gets style * * @return string */ - public function getType() + public function getStyle() { - return $this->container['type']; + return $this->container['style']; } /** - * Sets type + * Sets style * - * @param string $type The type of asset to generate - set to `text-to-speech` for text-to-speech. + * @param string $style The animation style to apply to words:
  • `karaoke` - Word-by-word color fill as spoken (shows all words, highlights active)
  • `highlight` - Word changes to active color when spoken (shows all words)
  • `pop` - Each word scales up when active
  • `fade` - Gradual opacity transition per word
  • `slide` - Words slide in from a direction
  • `bounce` - Spring animation on word appearance
  • `typewriter` - Words appear one by one and stay visible
  • `none` - No animation, all words visible immediately
* * @return self */ - public function setType($type) + public function setStyle($style) { - if (is_null($type)) { - throw new \InvalidArgumentException('non-nullable type cannot be null'); + if (is_null($style)) { + throw new \InvalidArgumentException('non-nullable style cannot be null'); } - $allowedValues = $this->getTypeAllowableValues(); - if (!in_array($type, $allowedValues, true)) { + $allowedValues = $this->getStyleAllowableValues(); + if (!in_array($style, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( - "Invalid value '%s' for 'type', must be one of '%s'", - $type, + "Invalid value '%s' for 'style', must be one of '%s'", + $style, implode("', '", $allowedValues) ) ); } - $this->container['type'] = $type; + $this->container['style'] = $style; return $this; } /** - * Gets text + * Gets direction * - * @return string - */ - public function getText() - { - return $this->container['text']; - } - - /** - * Sets text - * - * @param string $text The text to convert to speech. - * - * @return self - */ - public function setText($text) - { - if (is_null($text)) { - throw new \InvalidArgumentException('non-nullable text cannot be null'); - } - $this->container['text'] = $text; - - return $this; - } - - /** - * Gets voice - * - * @return string + * @return string|null */ - public function getVoice() + public function getDirection() { - return $this->container['voice']; + return $this->container['direction']; } /** - * Sets voice + * Sets direction * - * @param string $voice The voice to use for the text-to-speech conversion. Select a voice from the list of available voices:
  • `Adam`
  • `Antoni`
  • `Arnold`
  • `Bella`
  • `Domi`
  • `Elli`
  • `Josh`
  • `Rachel`
  • `Sam`
+ * @param string|null $direction Direction for directional animations (slide). Only applicable when style is `slide`. * * @return self */ - public function setVoice($voice) + public function setDirection($direction) { - if (is_null($voice)) { - throw new \InvalidArgumentException('non-nullable voice cannot be null'); + if (is_null($direction)) { + throw new \InvalidArgumentException('non-nullable direction cannot be null'); } - $allowedValues = $this->getVoiceAllowableValues(); - if (!in_array($voice, $allowedValues, true)) { + $allowedValues = $this->getDirectionAllowableValues(); + if (!in_array($direction, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( - "Invalid value '%s' for 'voice', must be one of '%s'", - $voice, + "Invalid value '%s' for 'direction', must be one of '%s'", + $direction, implode("', '", $allowedValues) ) ); } - $this->container['voice'] = $voice; + $this->container['direction'] = $direction; return $this; } diff --git a/src/Model/RichCaptionAsset.php b/src/Model/RichCaptionAsset.php new file mode 100644 index 0000000..07ef861 --- /dev/null +++ b/src/Model/RichCaptionAsset.php @@ -0,0 +1,831 @@ + + */ +class RichCaptionAsset implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'RichCaptionAsset'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'type' => 'string', + 'src' => 'string', + 'font' => '\ShotstackClient\Model\RichCaptionAssetFont', + 'style' => '\ShotstackClient\Model\RichCaptionAssetStyle', + 'stroke' => '\ShotstackClient\Model\RichTextStroke', + 'shadow' => '\ShotstackClient\Model\RichTextShadow', + 'background' => '\ShotstackClient\Model\RichTextBackground', + 'border' => '\ShotstackClient\Model\Border', + 'padding' => '\ShotstackClient\Model\RichCaptionAssetPadding', + 'align' => '\ShotstackClient\Model\RichTextAlignment', + 'active' => '\ShotstackClient\Model\RichCaptionActive', + 'animation' => '\ShotstackClient\Model\RichCaptionAnimation' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'type' => null, + 'src' => null, + 'font' => null, + 'style' => null, + 'stroke' => null, + 'shadow' => null, + 'background' => null, + 'border' => null, + 'padding' => null, + 'align' => null, + 'active' => null, + 'animation' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'type' => false, + 'src' => false, + 'font' => false, + 'style' => false, + 'stroke' => false, + 'shadow' => false, + 'background' => false, + 'border' => false, + 'padding' => false, + 'align' => false, + 'active' => false, + 'animation' => 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; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $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 = [ + 'type' => 'type', + 'src' => 'src', + 'font' => 'font', + 'style' => 'style', + 'stroke' => 'stroke', + 'shadow' => 'shadow', + 'background' => 'background', + 'border' => 'border', + 'padding' => 'padding', + 'align' => 'align', + 'active' => 'active', + 'animation' => 'animation' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'type' => 'setType', + 'src' => 'setSrc', + 'font' => 'setFont', + 'style' => 'setStyle', + 'stroke' => 'setStroke', + 'shadow' => 'setShadow', + 'background' => 'setBackground', + 'border' => 'setBorder', + 'padding' => 'setPadding', + 'align' => 'setAlign', + 'active' => 'setActive', + 'animation' => 'setAnimation' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'type' => 'getType', + 'src' => 'getSrc', + 'font' => 'getFont', + 'style' => 'getStyle', + 'stroke' => 'getStroke', + 'shadow' => 'getShadow', + 'background' => 'getBackground', + 'border' => 'getBorder', + 'padding' => 'getPadding', + 'align' => 'getAlign', + 'active' => 'getActive', + 'animation' => 'getAnimation' + ]; + + /** + * 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 TYPE_RICH_CAPTION = 'rich-caption'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_RICH_CAPTION, + ]; + } + + /** + * 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) + { + $this->setIfExists('type', $data ?? [], 'rich-caption'); + $this->setIfExists('src', $data ?? [], null); + $this->setIfExists('font', $data ?? [], null); + $this->setIfExists('style', $data ?? [], null); + $this->setIfExists('stroke', $data ?? [], null); + $this->setIfExists('shadow', $data ?? [], null); + $this->setIfExists('background', $data ?? [], null); + $this->setIfExists('border', $data ?? [], null); + $this->setIfExists('padding', $data ?? [], null); + $this->setIfExists('align', $data ?? [], null); + $this->setIfExists('active', $data ?? [], null); + $this->setIfExists('animation', $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 ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['src'] === null) { + $invalidProperties[] = "'src' can't be null"; + } + if ((mb_strlen($this->container['src']) < 1)) { + $invalidProperties[] = "invalid value for 'src', the character length must be bigger than or equal to 1."; + } + + 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 type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type The type of asset - set to `rich-caption` for rich captions. + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets src + * + * @return string + */ + public function getSrc() + { + return $this->container['src']; + } + + /** + * Sets src + * + * @param string $src The URL to an SRT or VTT subtitles file, or an alias reference to auto-generate captions from an audio or video clip. For file URLs, the URL must be publicly accessible or include credentials. For auto-captioning, use the format `alias://clip-name` where clip-name is the alias of an audio, video, or text-to-speech clip. + * + * @return self + */ + public function setSrc($src) + { + if (is_null($src)) { + throw new \InvalidArgumentException('non-nullable src cannot be null'); + } + + if ((mb_strlen($src) < 1)) { + throw new \InvalidArgumentException('invalid length for $src when calling RichCaptionAsset., must be bigger than or equal to 1.'); + } + + $this->container['src'] = $src; + + return $this; + } + + /** + * Gets font + * + * @return \ShotstackClient\Model\RichCaptionAssetFont|null + */ + public function getFont() + { + return $this->container['font']; + } + + /** + * Sets font + * + * @param \ShotstackClient\Model\RichCaptionAssetFont|null $font font + * + * @return self + */ + public function setFont($font) + { + if (is_null($font)) { + throw new \InvalidArgumentException('non-nullable font cannot be null'); + } + $this->container['font'] = $font; + + return $this; + } + + /** + * Gets style + * + * @return \ShotstackClient\Model\RichCaptionAssetStyle|null + */ + public function getStyle() + { + return $this->container['style']; + } + + /** + * Sets style + * + * @param \ShotstackClient\Model\RichCaptionAssetStyle|null $style style + * + * @return self + */ + public function setStyle($style) + { + if (is_null($style)) { + throw new \InvalidArgumentException('non-nullable style cannot be null'); + } + $this->container['style'] = $style; + + return $this; + } + + /** + * Gets stroke + * + * @return \ShotstackClient\Model\RichTextStroke|null + */ + public function getStroke() + { + return $this->container['stroke']; + } + + /** + * Sets stroke + * + * @param \ShotstackClient\Model\RichTextStroke|null $stroke stroke + * + * @return self + */ + public function setStroke($stroke) + { + if (is_null($stroke)) { + throw new \InvalidArgumentException('non-nullable stroke cannot be null'); + } + $this->container['stroke'] = $stroke; + + return $this; + } + + /** + * Gets shadow + * + * @return \ShotstackClient\Model\RichTextShadow|null + */ + public function getShadow() + { + return $this->container['shadow']; + } + + /** + * Sets shadow + * + * @param \ShotstackClient\Model\RichTextShadow|null $shadow shadow + * + * @return self + */ + public function setShadow($shadow) + { + if (is_null($shadow)) { + throw new \InvalidArgumentException('non-nullable shadow cannot be null'); + } + $this->container['shadow'] = $shadow; + + return $this; + } + + /** + * Gets background + * + * @return \ShotstackClient\Model\RichTextBackground|null + */ + public function getBackground() + { + return $this->container['background']; + } + + /** + * Sets background + * + * @param \ShotstackClient\Model\RichTextBackground|null $background background + * + * @return self + */ + public function setBackground($background) + { + if (is_null($background)) { + throw new \InvalidArgumentException('non-nullable background cannot be null'); + } + $this->container['background'] = $background; + + return $this; + } + + /** + * Gets border + * + * @return \ShotstackClient\Model\Border|null + */ + public function getBorder() + { + return $this->container['border']; + } + + /** + * Sets border + * + * @param \ShotstackClient\Model\Border|null $border border + * + * @return self + */ + public function setBorder($border) + { + if (is_null($border)) { + throw new \InvalidArgumentException('non-nullable border cannot be null'); + } + $this->container['border'] = $border; + + return $this; + } + + /** + * Gets padding + * + * @return \ShotstackClient\Model\RichCaptionAssetPadding|null + */ + public function getPadding() + { + return $this->container['padding']; + } + + /** + * Sets padding + * + * @param \ShotstackClient\Model\RichCaptionAssetPadding|null $padding padding + * + * @return self + */ + public function setPadding($padding) + { + if (is_null($padding)) { + throw new \InvalidArgumentException('non-nullable padding cannot be null'); + } + $this->container['padding'] = $padding; + + return $this; + } + + /** + * Gets align + * + * @return \ShotstackClient\Model\RichTextAlignment|null + */ + public function getAlign() + { + return $this->container['align']; + } + + /** + * Sets align + * + * @param \ShotstackClient\Model\RichTextAlignment|null $align align + * + * @return self + */ + public function setAlign($align) + { + if (is_null($align)) { + throw new \InvalidArgumentException('non-nullable align cannot be null'); + } + $this->container['align'] = $align; + + return $this; + } + + /** + * Gets active + * + * @return \ShotstackClient\Model\RichCaptionActive|null + */ + public function getActive() + { + return $this->container['active']; + } + + /** + * Sets active + * + * @param \ShotstackClient\Model\RichCaptionActive|null $active active + * + * @return self + */ + public function setActive($active) + { + if (is_null($active)) { + throw new \InvalidArgumentException('non-nullable active cannot be null'); + } + $this->container['active'] = $active; + + return $this; + } + + /** + * Gets animation + * + * @return \ShotstackClient\Model\RichCaptionAnimation|null + */ + public function getAnimation() + { + return $this->container['animation']; + } + + /** + * Sets animation + * + * @param \ShotstackClient\Model\RichCaptionAnimation|null $animation animation + * + * @return self + */ + public function setAnimation($animation) + { + if (is_null($animation)) { + throw new \InvalidArgumentException('non-nullable animation cannot be null'); + } + $this->container['animation'] = $animation; + + 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() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/RichCaptionAssetFont.php b/src/Model/RichCaptionAssetFont.php new file mode 100644 index 0000000..ddc642e --- /dev/null +++ b/src/Model/RichCaptionAssetFont.php @@ -0,0 +1,637 @@ + + */ +class RichCaptionAssetFont implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'RichCaptionAsset_font'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'family' => 'string', + 'size' => 'int', + 'weight' => 'mixed', + 'color' => 'string', + 'opacity' => 'float', + 'background' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'family' => null, + 'size' => null, + 'weight' => null, + 'color' => null, + 'opacity' => null, + 'background' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'family' => false, + 'size' => false, + 'weight' => true, + 'color' => false, + 'opacity' => false, + 'background' => 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; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $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 = [ + 'family' => 'family', + 'size' => 'size', + 'weight' => 'weight', + 'color' => 'color', + 'opacity' => 'opacity', + 'background' => 'background' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'family' => 'setFamily', + 'size' => 'setSize', + 'weight' => 'setWeight', + 'color' => 'setColor', + 'opacity' => 'setOpacity', + 'background' => 'setBackground' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'family' => 'getFamily', + 'size' => 'getSize', + 'weight' => 'getWeight', + 'color' => 'getColor', + 'opacity' => 'getOpacity', + 'background' => 'getBackground' + ]; + + /** + * 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) + { + $this->setIfExists('family', $data ?? [], 'Roboto'); + $this->setIfExists('size', $data ?? [], 24); + $this->setIfExists('weight', $data ?? [], null); + $this->setIfExists('color', $data ?? [], '#ffffff'); + $this->setIfExists('opacity', $data ?? [], 1); + $this->setIfExists('background', $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['size']) && ($this->container['size'] > 500)) { + $invalidProperties[] = "invalid value for 'size', must be smaller than or equal to 500."; + } + + if (!is_null($this->container['size']) && ($this->container['size'] < 1)) { + $invalidProperties[] = "invalid value for 'size', must be bigger than or equal to 1."; + } + + if (!is_null($this->container['color']) && !preg_match("/^#[A-Fa-f0-9]{6}$/", $this->container['color'])) { + $invalidProperties[] = "invalid value for 'color', must be conform to the pattern /^#[A-Fa-f0-9]{6}$/."; + } + + if (!is_null($this->container['opacity']) && ($this->container['opacity'] > 1)) { + $invalidProperties[] = "invalid value for 'opacity', must be smaller than or equal to 1."; + } + + if (!is_null($this->container['opacity']) && ($this->container['opacity'] < 0)) { + $invalidProperties[] = "invalid value for 'opacity', must be bigger than or equal to 0."; + } + + if (!is_null($this->container['background']) && !preg_match("/^#[A-Fa-f0-9]{6}$/", $this->container['background'])) { + $invalidProperties[] = "invalid value for 'background', must be conform to the pattern /^#[A-Fa-f0-9]{6}$/."; + } + + 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 family + * + * @return string|null + */ + public function getFamily() + { + return $this->container['family']; + } + + /** + * Sets family + * + * @param string|null $family The font family name. This must be the Family name embedded in the font, i.e. \"Roboto\". + * + * @return self + */ + public function setFamily($family) + { + if (is_null($family)) { + throw new \InvalidArgumentException('non-nullable family cannot be null'); + } + $this->container['family'] = $family; + + return $this; + } + + /** + * Gets size + * + * @return int|null + */ + public function getSize() + { + return $this->container['size']; + } + + /** + * Sets size + * + * @param int|null $size The size of the font in pixels (px). Must be between 1 and 500. + * + * @return self + */ + public function setSize($size) + { + if (is_null($size)) { + throw new \InvalidArgumentException('non-nullable size cannot be null'); + } + + if (($size > 500)) { + throw new \InvalidArgumentException('invalid value for $size when calling RichCaptionAssetFont., must be smaller than or equal to 500.'); + } + if (($size < 1)) { + throw new \InvalidArgumentException('invalid value for $size when calling RichCaptionAssetFont., must be bigger than or equal to 1.'); + } + + $this->container['size'] = $size; + + return $this; + } + + /** + * Gets weight + * + * @return mixed|null + */ + public function getWeight() + { + return $this->container['weight']; + } + + /** + * Sets weight + * + * @param mixed|null $weight The weight of the font. Can be a number (100-900) or a string ('normal', 'bold', etc.). 100 is lightest, 900 is heaviest (boldest). + * + * @return self + */ + public function setWeight($weight) + { + if (is_null($weight)) { + array_push($this->openAPINullablesSetToNull, 'weight'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('weight', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['weight'] = $weight; + + return $this; + } + + /** + * Gets color + * + * @return string|null + */ + public function getColor() + { + return $this->container['color']; + } + + /** + * Sets color + * + * @param string|null $color The text color using hexadecimal color notation. + * + * @return self + */ + public function setColor($color) + { + if (is_null($color)) { + throw new \InvalidArgumentException('non-nullable color cannot be null'); + } + + if ((!preg_match("/^#[A-Fa-f0-9]{6}$/", ObjectSerializer::toString($color)))) { + throw new \InvalidArgumentException("invalid value for \$color when calling RichCaptionAssetFont., must conform to the pattern /^#[A-Fa-f0-9]{6}$/."); + } + + $this->container['color'] = $color; + + return $this; + } + + /** + * Gets opacity + * + * @return float|null + */ + public function getOpacity() + { + return $this->container['opacity']; + } + + /** + * Sets opacity + * + * @param float|null $opacity The opacity of the text where 1 is opaque and 0 is transparent. + * + * @return self + */ + public function setOpacity($opacity) + { + if (is_null($opacity)) { + throw new \InvalidArgumentException('non-nullable opacity cannot be null'); + } + + if (($opacity > 1)) { + throw new \InvalidArgumentException('invalid value for $opacity when calling RichCaptionAssetFont., must be smaller than or equal to 1.'); + } + if (($opacity < 0)) { + throw new \InvalidArgumentException('invalid value for $opacity when calling RichCaptionAssetFont., must be bigger than or equal to 0.'); + } + + $this->container['opacity'] = $opacity; + + return $this; + } + + /** + * Gets background + * + * @return string|null + */ + public function getBackground() + { + return $this->container['background']; + } + + /** + * Sets background + * + * @param string|null $background The background color behind the text using hexadecimal color notation. + * + * @return self + */ + public function setBackground($background) + { + if (is_null($background)) { + throw new \InvalidArgumentException('non-nullable background cannot be null'); + } + + if ((!preg_match("/^#[A-Fa-f0-9]{6}$/", ObjectSerializer::toString($background)))) { + throw new \InvalidArgumentException("invalid value for \$background when calling RichCaptionAssetFont., must conform to the pattern /^#[A-Fa-f0-9]{6}$/."); + } + + $this->container['background'] = $background; + + 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() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/RichCaptionAssetPadding.php b/src/Model/RichCaptionAssetPadding.php new file mode 100644 index 0000000..f88f66e --- /dev/null +++ b/src/Model/RichCaptionAssetPadding.php @@ -0,0 +1,382 @@ + + */ +class RichCaptionAssetPadding implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'RichCaptionAsset_padding'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + + ]; + + /** + * 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; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $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 = [ + + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + + ]; + + /** + * 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) + { + } + + /** + * 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 = []; + + 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; + } + + /** + * 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() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/RichCaptionAssetStyle.php b/src/Model/RichCaptionAssetStyle.php new file mode 100644 index 0000000..6fcd5d5 --- /dev/null +++ b/src/Model/RichCaptionAssetStyle.php @@ -0,0 +1,686 @@ + + */ +class RichCaptionAssetStyle implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'RichCaptionAsset_style'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'letter_spacing' => 'float', + 'line_height' => 'float', + 'text_transform' => 'string', + 'size' => 'float', + 'text_decoration' => 'string', + 'gradient' => '\ShotstackClient\Model\RichTextGradient' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'letter_spacing' => null, + 'line_height' => null, + 'text_transform' => null, + 'size' => null, + 'text_decoration' => null, + 'gradient' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'letter_spacing' => false, + 'line_height' => false, + 'text_transform' => false, + 'size' => false, + 'text_decoration' => false, + 'gradient' => 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; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $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 = [ + 'letter_spacing' => 'letterSpacing', + 'line_height' => 'lineHeight', + 'text_transform' => 'textTransform', + 'size' => 'size', + 'text_decoration' => 'textDecoration', + 'gradient' => 'gradient' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'letter_spacing' => 'setLetterSpacing', + 'line_height' => 'setLineHeight', + 'text_transform' => 'setTextTransform', + 'size' => 'setSize', + 'text_decoration' => 'setTextDecoration', + 'gradient' => 'setGradient' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'letter_spacing' => 'getLetterSpacing', + 'line_height' => 'getLineHeight', + 'text_transform' => 'getTextTransform', + 'size' => 'getSize', + 'text_decoration' => 'getTextDecoration', + 'gradient' => 'getGradient' + ]; + + /** + * 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 TEXT_TRANSFORM_NONE = 'none'; + public const TEXT_TRANSFORM_UPPERCASE = 'uppercase'; + public const TEXT_TRANSFORM_LOWERCASE = 'lowercase'; + public const TEXT_TRANSFORM_CAPITALIZE = 'capitalize'; + public const TEXT_DECORATION_NONE = 'none'; + public const TEXT_DECORATION_UNDERLINE = 'underline'; + public const TEXT_DECORATION_LINE_THROUGH = 'line-through'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTextTransformAllowableValues() + { + return [ + self::TEXT_TRANSFORM_NONE, + self::TEXT_TRANSFORM_UPPERCASE, + self::TEXT_TRANSFORM_LOWERCASE, + self::TEXT_TRANSFORM_CAPITALIZE, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTextDecorationAllowableValues() + { + return [ + self::TEXT_DECORATION_NONE, + self::TEXT_DECORATION_UNDERLINE, + self::TEXT_DECORATION_LINE_THROUGH, + ]; + } + + /** + * 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) + { + $this->setIfExists('letter_spacing', $data ?? [], 0); + $this->setIfExists('line_height', $data ?? [], 1.2); + $this->setIfExists('text_transform', $data ?? [], 'none'); + $this->setIfExists('size', $data ?? [], null); + $this->setIfExists('text_decoration', $data ?? [], 'none'); + $this->setIfExists('gradient', $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['line_height']) && ($this->container['line_height'] > 10)) { + $invalidProperties[] = "invalid value for 'line_height', must be smaller than or equal to 10."; + } + + if (!is_null($this->container['line_height']) && ($this->container['line_height'] < 0)) { + $invalidProperties[] = "invalid value for 'line_height', must be bigger than or equal to 0."; + } + + $allowedValues = $this->getTextTransformAllowableValues(); + if (!is_null($this->container['text_transform']) && !in_array($this->container['text_transform'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'text_transform', must be one of '%s'", + $this->container['text_transform'], + implode("', '", $allowedValues) + ); + } + + if (!is_null($this->container['size']) && ($this->container['size'] > 500)) { + $invalidProperties[] = "invalid value for 'size', must be smaller than or equal to 500."; + } + + if (!is_null($this->container['size']) && ($this->container['size'] < 1)) { + $invalidProperties[] = "invalid value for 'size', must be bigger than or equal to 1."; + } + + $allowedValues = $this->getTextDecorationAllowableValues(); + if (!is_null($this->container['text_decoration']) && !in_array($this->container['text_decoration'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'text_decoration', must be one of '%s'", + $this->container['text_decoration'], + 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 letter_spacing + * + * @return float|null + */ + public function getLetterSpacing() + { + return $this->container['letter_spacing']; + } + + /** + * Sets letter_spacing + * + * @param float|null $letter_spacing Additional spacing between letters in pixels. Can be negative for tighter spacing. + * + * @return self + */ + public function setLetterSpacing($letter_spacing) + { + if (is_null($letter_spacing)) { + throw new \InvalidArgumentException('non-nullable letter_spacing cannot be null'); + } + $this->container['letter_spacing'] = $letter_spacing; + + return $this; + } + + /** + * Gets line_height + * + * @return float|null + */ + public function getLineHeight() + { + return $this->container['line_height']; + } + + /** + * Sets line_height + * + * @param float|null $line_height The line height as a multiplier of the font size. Must be between 0 and 10. + * + * @return self + */ + public function setLineHeight($line_height) + { + if (is_null($line_height)) { + throw new \InvalidArgumentException('non-nullable line_height cannot be null'); + } + + if (($line_height > 10)) { + throw new \InvalidArgumentException('invalid value for $line_height when calling RichCaptionAssetStyle., must be smaller than or equal to 10.'); + } + if (($line_height < 0)) { + throw new \InvalidArgumentException('invalid value for $line_height when calling RichCaptionAssetStyle., must be bigger than or equal to 0.'); + } + + $this->container['line_height'] = $line_height; + + return $this; + } + + /** + * Gets text_transform + * + * @return string|null + */ + public function getTextTransform() + { + return $this->container['text_transform']; + } + + /** + * Sets text_transform + * + * @param string|null $text_transform Text transformation to apply. + * + * @return self + */ + public function setTextTransform($text_transform) + { + if (is_null($text_transform)) { + throw new \InvalidArgumentException('non-nullable text_transform cannot be null'); + } + $allowedValues = $this->getTextTransformAllowableValues(); + if (!in_array($text_transform, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'text_transform', must be one of '%s'", + $text_transform, + implode("', '", $allowedValues) + ) + ); + } + $this->container['text_transform'] = $text_transform; + + return $this; + } + + /** + * Gets size + * + * @return float|null + */ + public function getSize() + { + return $this->container['size']; + } + + /** + * Sets size + * + * @param float|null $size The font size in pixels. Can be used as an alternative to font.size. + * + * @return self + */ + public function setSize($size) + { + if (is_null($size)) { + throw new \InvalidArgumentException('non-nullable size cannot be null'); + } + + if (($size > 500)) { + throw new \InvalidArgumentException('invalid value for $size when calling RichCaptionAssetStyle., must be smaller than or equal to 500.'); + } + if (($size < 1)) { + throw new \InvalidArgumentException('invalid value for $size when calling RichCaptionAssetStyle., must be bigger than or equal to 1.'); + } + + $this->container['size'] = $size; + + return $this; + } + + /** + * Gets text_decoration + * + * @return string|null + */ + public function getTextDecoration() + { + return $this->container['text_decoration']; + } + + /** + * Sets text_decoration + * + * @param string|null $text_decoration Text decoration to apply. + * + * @return self + */ + public function setTextDecoration($text_decoration) + { + if (is_null($text_decoration)) { + throw new \InvalidArgumentException('non-nullable text_decoration cannot be null'); + } + $allowedValues = $this->getTextDecorationAllowableValues(); + if (!in_array($text_decoration, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'text_decoration', must be one of '%s'", + $text_decoration, + implode("', '", $allowedValues) + ) + ); + } + $this->container['text_decoration'] = $text_decoration; + + return $this; + } + + /** + * Gets gradient + * + * @return \ShotstackClient\Model\RichTextGradient|null + */ + public function getGradient() + { + return $this->container['gradient']; + } + + /** + * Sets gradient + * + * @param \ShotstackClient\Model\RichTextGradient|null $gradient gradient + * + * @return self + */ + public function setGradient($gradient) + { + if (is_null($gradient)) { + throw new \InvalidArgumentException('non-nullable gradient cannot be null'); + } + $this->container['gradient'] = $gradient; + + 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() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/StabilityAiGeneratedAsset.php b/src/Model/RichTextAlignment.php similarity index 70% rename from src/Model/StabilityAiGeneratedAsset.php rename to src/Model/RichTextAlignment.php index 1165e69..8b2d4d6 100644 --- a/src/Model/StabilityAiGeneratedAsset.php +++ b/src/Model/RichTextAlignment.php @@ -1,11 +1,11 @@ */ -class StabilityAiGeneratedAsset implements ModelInterface, ArrayAccess, \JsonSerializable +class RichTextAlignment implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; @@ -50,7 +50,7 @@ class StabilityAiGeneratedAsset implements ModelInterface, ArrayAccess, \JsonSer * * @var string */ - protected static $openAPIModelName = 'StabilityAiGeneratedAsset'; + protected static $openAPIModelName = 'RichTextAlignment'; /** * Array of property to type mappings. Used for (de)serialization @@ -58,8 +58,8 @@ class StabilityAiGeneratedAsset implements ModelInterface, ArrayAccess, \JsonSer * @var string[] */ protected static $openAPITypes = [ - 'provider' => 'string', - 'options' => '\Shotstack\Client\Model\StabilityAiGeneratedAssetOptions' + 'horizontal' => 'string', + 'vertical' => 'string' ]; /** @@ -70,8 +70,8 @@ class StabilityAiGeneratedAsset implements ModelInterface, ArrayAccess, \JsonSer * @psalm-var array */ protected static $openAPIFormats = [ - 'provider' => null, - 'options' => null + 'horizontal' => null, + 'vertical' => null ]; /** @@ -80,8 +80,8 @@ class StabilityAiGeneratedAsset implements ModelInterface, ArrayAccess, \JsonSer * @var boolean[] */ protected static array $openAPINullables = [ - 'provider' => false, - 'options' => false + 'horizontal' => false, + 'vertical' => false ]; /** @@ -170,8 +170,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'provider' => 'provider', - 'options' => 'options' + 'horizontal' => 'horizontal', + 'vertical' => 'vertical' ]; /** @@ -180,8 +180,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'provider' => 'setProvider', - 'options' => 'setOptions' + 'horizontal' => 'setHorizontal', + 'vertical' => 'setVertical' ]; /** @@ -190,8 +190,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'provider' => 'getProvider', - 'options' => 'getOptions' + 'horizontal' => 'getHorizontal', + 'vertical' => 'getVertical' ]; /** @@ -235,17 +235,38 @@ public function getModelName() return self::$openAPIModelName; } - public const PROVIDER_STABILITY_AI = 'stability-ai'; + public const HORIZONTAL_LEFT = 'left'; + public const HORIZONTAL_CENTER = 'center'; + public const HORIZONTAL_RIGHT = 'right'; + public const VERTICAL_TOP = 'top'; + public const VERTICAL_MIDDLE = 'middle'; + public const VERTICAL_BOTTOM = 'bottom'; /** * Gets allowable values of the enum * * @return string[] */ - public function getProviderAllowableValues() + public function getHorizontalAllowableValues() { return [ - self::PROVIDER_STABILITY_AI, + self::HORIZONTAL_LEFT, + self::HORIZONTAL_CENTER, + self::HORIZONTAL_RIGHT, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getVerticalAllowableValues() + { + return [ + self::VERTICAL_TOP, + self::VERTICAL_MIDDLE, + self::VERTICAL_BOTTOM, ]; } @@ -264,8 +285,8 @@ public function getProviderAllowableValues() */ public function __construct(array $data = null) { - $this->setIfExists('provider', $data ?? [], 'stability-ai'); - $this->setIfExists('options', $data ?? [], null); + $this->setIfExists('horizontal', $data ?? [], 'center'); + $this->setIfExists('vertical', $data ?? [], 'middle'); } /** @@ -295,21 +316,24 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['provider'] === null) { - $invalidProperties[] = "'provider' can't be null"; - } - $allowedValues = $this->getProviderAllowableValues(); - if (!is_null($this->container['provider']) && !in_array($this->container['provider'], $allowedValues, true)) { + $allowedValues = $this->getHorizontalAllowableValues(); + if (!is_null($this->container['horizontal']) && !in_array($this->container['horizontal'], $allowedValues, true)) { $invalidProperties[] = sprintf( - "invalid value '%s' for 'provider', must be one of '%s'", - $this->container['provider'], + "invalid value '%s' for 'horizontal', must be one of '%s'", + $this->container['horizontal'], implode("', '", $allowedValues) ); } - if ($this->container['options'] === null) { - $invalidProperties[] = "'options' can't be null"; + $allowedValues = $this->getVerticalAllowableValues(); + if (!is_null($this->container['vertical']) && !in_array($this->container['vertical'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'vertical', must be one of '%s'", + $this->container['vertical'], + implode("', '", $allowedValues) + ); } + return $invalidProperties; } @@ -326,65 +350,75 @@ public function valid() /** - * Gets provider + * Gets horizontal * - * @return string + * @return string|null */ - public function getProvider() + public function getHorizontal() { - return $this->container['provider']; + return $this->container['horizontal']; } /** - * Sets provider + * Sets horizontal * - * @param string $provider The name of the provider - set to `stability-ai` for Stability AI. + * @param string|null $horizontal The horizontal alignment of the text. * * @return self */ - public function setProvider($provider) + public function setHorizontal($horizontal) { - if (is_null($provider)) { - throw new \InvalidArgumentException('non-nullable provider cannot be null'); + if (is_null($horizontal)) { + throw new \InvalidArgumentException('non-nullable horizontal cannot be null'); } - $allowedValues = $this->getProviderAllowableValues(); - if (!in_array($provider, $allowedValues, true)) { + $allowedValues = $this->getHorizontalAllowableValues(); + if (!in_array($horizontal, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( - "Invalid value '%s' for 'provider', must be one of '%s'", - $provider, + "Invalid value '%s' for 'horizontal', must be one of '%s'", + $horizontal, implode("', '", $allowedValues) ) ); } - $this->container['provider'] = $provider; + $this->container['horizontal'] = $horizontal; return $this; } /** - * Gets options + * Gets vertical * - * @return \Shotstack\Client\Model\StabilityAiGeneratedAssetOptions + * @return string|null */ - public function getOptions() + public function getVertical() { - return $this->container['options']; + return $this->container['vertical']; } /** - * Sets options + * Sets vertical * - * @param \Shotstack\Client\Model\StabilityAiGeneratedAssetOptions $options options + * @param string|null $vertical The vertical alignment of the text within the bounding box. * * @return self */ - public function setOptions($options) + public function setVertical($vertical) { - if (is_null($options)) { - throw new \InvalidArgumentException('non-nullable options cannot be null'); + if (is_null($vertical)) { + throw new \InvalidArgumentException('non-nullable vertical cannot be null'); + } + $allowedValues = $this->getVerticalAllowableValues(); + if (!in_array($vertical, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'vertical', must be one of '%s'", + $vertical, + implode("', '", $allowedValues) + ) + ); } - $this->container['options'] = $options; + $this->container['vertical'] = $vertical; return $this; } diff --git a/src/Model/RichTextAnimation.php b/src/Model/RichTextAnimation.php new file mode 100644 index 0000000..2e27de3 --- /dev/null +++ b/src/Model/RichTextAnimation.php @@ -0,0 +1,645 @@ + + */ +class RichTextAnimation implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'RichTextAnimation'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'preset' => 'string', + 'duration' => 'float', + 'style' => 'string', + 'direction' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'preset' => null, + 'duration' => null, + 'style' => null, + 'direction' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'preset' => false, + 'duration' => false, + 'style' => false, + 'direction' => 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; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $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 = [ + 'preset' => 'preset', + 'duration' => 'duration', + 'style' => 'style', + 'direction' => 'direction' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'preset' => 'setPreset', + 'duration' => 'setDuration', + 'style' => 'setStyle', + 'direction' => 'setDirection' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'preset' => 'getPreset', + 'duration' => 'getDuration', + 'style' => 'getStyle', + 'direction' => 'getDirection' + ]; + + /** + * 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 PRESET_FADE_IN = 'fadeIn'; + public const PRESET_SLIDE_IN = 'slideIn'; + public const PRESET_TYPEWRITER = 'typewriter'; + public const PRESET_ASCEND = 'ascend'; + public const PRESET_SHIFT = 'shift'; + public const PRESET_MOVING_LETTERS = 'movingLetters'; + public const STYLE_CHARACTER = 'character'; + public const STYLE_WORD = 'word'; + public const DIRECTION_LEFT = 'left'; + public const DIRECTION_RIGHT = 'right'; + public const DIRECTION_UP = 'up'; + public const DIRECTION_DOWN = 'down'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getPresetAllowableValues() + { + return [ + self::PRESET_FADE_IN, + self::PRESET_SLIDE_IN, + self::PRESET_TYPEWRITER, + self::PRESET_ASCEND, + self::PRESET_SHIFT, + self::PRESET_MOVING_LETTERS, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getStyleAllowableValues() + { + return [ + self::STYLE_CHARACTER, + self::STYLE_WORD, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getDirectionAllowableValues() + { + return [ + self::DIRECTION_LEFT, + self::DIRECTION_RIGHT, + self::DIRECTION_UP, + self::DIRECTION_DOWN, + ]; + } + + /** + * 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) + { + $this->setIfExists('preset', $data ?? [], null); + $this->setIfExists('duration', $data ?? [], null); + $this->setIfExists('style', $data ?? [], null); + $this->setIfExists('direction', $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 ($this->container['preset'] === null) { + $invalidProperties[] = "'preset' can't be null"; + } + $allowedValues = $this->getPresetAllowableValues(); + if (!is_null($this->container['preset']) && !in_array($this->container['preset'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'preset', must be one of '%s'", + $this->container['preset'], + implode("', '", $allowedValues) + ); + } + + if (!is_null($this->container['duration']) && ($this->container['duration'] > 30)) { + $invalidProperties[] = "invalid value for 'duration', must be smaller than or equal to 30."; + } + + if (!is_null($this->container['duration']) && ($this->container['duration'] < 0.1)) { + $invalidProperties[] = "invalid value for 'duration', must be bigger than or equal to 0.1."; + } + + $allowedValues = $this->getStyleAllowableValues(); + if (!is_null($this->container['style']) && !in_array($this->container['style'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'style', must be one of '%s'", + $this->container['style'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getDirectionAllowableValues(); + if (!is_null($this->container['direction']) && !in_array($this->container['direction'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'direction', must be one of '%s'", + $this->container['direction'], + 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 preset + * + * @return string + */ + public function getPreset() + { + return $this->container['preset']; + } + + /** + * Sets preset + * + * @param string $preset The animation preset to apply. Available presets:
  • `fadeIn` - fadeIn in animation
  • `slideIn` - slide in from a direction
  • `typewriter` - typewriter effect
  • `ascend` - ascend from a direction
  • `shift` - shift in from a direction
  • `movingLetters` - letters move in from a direction
+ * + * @return self + */ + public function setPreset($preset) + { + if (is_null($preset)) { + throw new \InvalidArgumentException('non-nullable preset cannot be null'); + } + $allowedValues = $this->getPresetAllowableValues(); + if (!in_array($preset, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'preset', must be one of '%s'", + $preset, + implode("', '", $allowedValues) + ) + ); + } + $this->container['preset'] = $preset; + + return $this; + } + + /** + * Gets duration + * + * @return float|null + */ + public function getDuration() + { + return $this->container['duration']; + } + + /** + * Sets duration + * + * @param float|null $duration Override animation duration in seconds. Must be between 0.1 and 30 seconds. + * + * @return self + */ + public function setDuration($duration) + { + if (is_null($duration)) { + throw new \InvalidArgumentException('non-nullable duration cannot be null'); + } + + if (($duration > 30)) { + throw new \InvalidArgumentException('invalid value for $duration when calling RichTextAnimation., must be smaller than or equal to 30.'); + } + if (($duration < 0.1)) { + throw new \InvalidArgumentException('invalid value for $duration when calling RichTextAnimation., must be bigger than or equal to 0.1.'); + } + + $this->container['duration'] = $duration; + + return $this; + } + + /** + * Gets style + * + * @return string|null + */ + public function getStyle() + { + return $this->container['style']; + } + + /** + * Sets style + * + * @param string|null $style Animation style - animate by character or by word. Only applicable for typewriter and shift animations. + * + * @return self + */ + public function setStyle($style) + { + if (is_null($style)) { + throw new \InvalidArgumentException('non-nullable style cannot be null'); + } + $allowedValues = $this->getStyleAllowableValues(); + if (!in_array($style, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'style', must be one of '%s'", + $style, + implode("', '", $allowedValues) + ) + ); + } + $this->container['style'] = $style; + + return $this; + } + + /** + * Gets direction + * + * @return string|null + */ + public function getDirection() + { + return $this->container['direction']; + } + + /** + * Sets direction + * + * @param string|null $direction Direction for directional animations. Required for slideIn, ascend, shift, and movingLetters presets.
  • `ascend` - supports: up, down
  • `shift` - supports: left, right, up, down
  • `slideIn` - supports: left, right, up, down
  • `movingLetters` - supports: left, right, up, down
+ * + * @return self + */ + public function setDirection($direction) + { + if (is_null($direction)) { + throw new \InvalidArgumentException('non-nullable direction cannot be null'); + } + $allowedValues = $this->getDirectionAllowableValues(); + if (!in_array($direction, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'direction', must be one of '%s'", + $direction, + implode("', '", $allowedValues) + ) + ); + } + $this->container['direction'] = $direction; + + 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() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/RichTextAsset.php b/src/Model/RichTextAsset.php new file mode 100644 index 0000000..70849ef --- /dev/null +++ b/src/Model/RichTextAsset.php @@ -0,0 +1,796 @@ + + */ +class RichTextAsset implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'RichTextAsset'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'type' => 'string', + 'text' => 'string', + 'font' => '\ShotstackClient\Model\RichTextFont', + 'style' => '\ShotstackClient\Model\RichTextStyle', + 'stroke' => '\ShotstackClient\Model\RichTextStroke', + 'shadow' => '\ShotstackClient\Model\RichTextShadow', + 'background' => '\ShotstackClient\Model\RichTextBackground', + 'border' => '\ShotstackClient\Model\RichTextAssetBorder', + 'padding' => '\ShotstackClient\Model\RichTextAssetPadding', + 'align' => '\ShotstackClient\Model\RichTextAlignment', + 'animation' => '\ShotstackClient\Model\RichTextAnimation' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'type' => null, + 'text' => null, + 'font' => null, + 'style' => null, + 'stroke' => null, + 'shadow' => null, + 'background' => null, + 'border' => null, + 'padding' => null, + 'align' => null, + 'animation' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'type' => false, + 'text' => false, + 'font' => false, + 'style' => false, + 'stroke' => false, + 'shadow' => false, + 'background' => false, + 'border' => false, + 'padding' => false, + 'align' => false, + 'animation' => 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; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $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 = [ + 'type' => 'type', + 'text' => 'text', + 'font' => 'font', + 'style' => 'style', + 'stroke' => 'stroke', + 'shadow' => 'shadow', + 'background' => 'background', + 'border' => 'border', + 'padding' => 'padding', + 'align' => 'align', + 'animation' => 'animation' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'type' => 'setType', + 'text' => 'setText', + 'font' => 'setFont', + 'style' => 'setStyle', + 'stroke' => 'setStroke', + 'shadow' => 'setShadow', + 'background' => 'setBackground', + 'border' => 'setBorder', + 'padding' => 'setPadding', + 'align' => 'setAlign', + 'animation' => 'setAnimation' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'type' => 'getType', + 'text' => 'getText', + 'font' => 'getFont', + 'style' => 'getStyle', + 'stroke' => 'getStroke', + 'shadow' => 'getShadow', + 'background' => 'getBackground', + 'border' => 'getBorder', + 'padding' => 'getPadding', + 'align' => 'getAlign', + 'animation' => 'getAnimation' + ]; + + /** + * 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 TYPE_RICH_TEXT = 'rich-text'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_RICH_TEXT, + ]; + } + + /** + * 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) + { + $this->setIfExists('type', $data ?? [], 'rich-text'); + $this->setIfExists('text', $data ?? [], null); + $this->setIfExists('font', $data ?? [], null); + $this->setIfExists('style', $data ?? [], null); + $this->setIfExists('stroke', $data ?? [], null); + $this->setIfExists('shadow', $data ?? [], null); + $this->setIfExists('background', $data ?? [], null); + $this->setIfExists('border', $data ?? [], null); + $this->setIfExists('padding', $data ?? [], null); + $this->setIfExists('align', $data ?? [], null); + $this->setIfExists('animation', $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 ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['text'] === null) { + $invalidProperties[] = "'text' can't be null"; + } + if ((mb_strlen($this->container['text']) > 5000)) { + $invalidProperties[] = "invalid value for 'text', the character length must be smaller than or equal to 5000."; + } + + 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 type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type The type of asset - set to `rich-text` for rich text. + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets text + * + * @return string + */ + public function getText() + { + return $this->container['text']; + } + + /** + * Sets text + * + * @param string $text The text string to display. Maximum 5000 characters. + * + * @return self + */ + public function setText($text) + { + if (is_null($text)) { + throw new \InvalidArgumentException('non-nullable text cannot be null'); + } + if ((mb_strlen($text) > 5000)) { + throw new \InvalidArgumentException('invalid length for $text when calling RichTextAsset., must be smaller than or equal to 5000.'); + } + + $this->container['text'] = $text; + + return $this; + } + + /** + * Gets font + * + * @return \ShotstackClient\Model\RichTextFont|null + */ + public function getFont() + { + return $this->container['font']; + } + + /** + * Sets font + * + * @param \ShotstackClient\Model\RichTextFont|null $font font + * + * @return self + */ + public function setFont($font) + { + if (is_null($font)) { + throw new \InvalidArgumentException('non-nullable font cannot be null'); + } + $this->container['font'] = $font; + + return $this; + } + + /** + * Gets style + * + * @return \ShotstackClient\Model\RichTextStyle|null + */ + public function getStyle() + { + return $this->container['style']; + } + + /** + * Sets style + * + * @param \ShotstackClient\Model\RichTextStyle|null $style style + * + * @return self + */ + public function setStyle($style) + { + if (is_null($style)) { + throw new \InvalidArgumentException('non-nullable style cannot be null'); + } + $this->container['style'] = $style; + + return $this; + } + + /** + * Gets stroke + * + * @return \ShotstackClient\Model\RichTextStroke|null + */ + public function getStroke() + { + return $this->container['stroke']; + } + + /** + * Sets stroke + * + * @param \ShotstackClient\Model\RichTextStroke|null $stroke stroke + * + * @return self + */ + public function setStroke($stroke) + { + if (is_null($stroke)) { + throw new \InvalidArgumentException('non-nullable stroke cannot be null'); + } + $this->container['stroke'] = $stroke; + + return $this; + } + + /** + * Gets shadow + * + * @return \ShotstackClient\Model\RichTextShadow|null + */ + public function getShadow() + { + return $this->container['shadow']; + } + + /** + * Sets shadow + * + * @param \ShotstackClient\Model\RichTextShadow|null $shadow shadow + * + * @return self + */ + public function setShadow($shadow) + { + if (is_null($shadow)) { + throw new \InvalidArgumentException('non-nullable shadow cannot be null'); + } + $this->container['shadow'] = $shadow; + + return $this; + } + + /** + * Gets background + * + * @return \ShotstackClient\Model\RichTextBackground|null + */ + public function getBackground() + { + return $this->container['background']; + } + + /** + * Sets background + * + * @param \ShotstackClient\Model\RichTextBackground|null $background background + * + * @return self + */ + public function setBackground($background) + { + if (is_null($background)) { + throw new \InvalidArgumentException('non-nullable background cannot be null'); + } + $this->container['background'] = $background; + + return $this; + } + + /** + * Gets border + * + * @return \ShotstackClient\Model\RichTextAssetBorder|null + */ + public function getBorder() + { + return $this->container['border']; + } + + /** + * Sets border + * + * @param \ShotstackClient\Model\RichTextAssetBorder|null $border border + * + * @return self + */ + public function setBorder($border) + { + if (is_null($border)) { + throw new \InvalidArgumentException('non-nullable border cannot be null'); + } + $this->container['border'] = $border; + + return $this; + } + + /** + * Gets padding + * + * @return \ShotstackClient\Model\RichTextAssetPadding|null + */ + public function getPadding() + { + return $this->container['padding']; + } + + /** + * Sets padding + * + * @param \ShotstackClient\Model\RichTextAssetPadding|null $padding padding + * + * @return self + */ + public function setPadding($padding) + { + if (is_null($padding)) { + throw new \InvalidArgumentException('non-nullable padding cannot be null'); + } + $this->container['padding'] = $padding; + + return $this; + } + + /** + * Gets align + * + * @return \ShotstackClient\Model\RichTextAlignment|null + */ + public function getAlign() + { + return $this->container['align']; + } + + /** + * Sets align + * + * @param \ShotstackClient\Model\RichTextAlignment|null $align align + * + * @return self + */ + public function setAlign($align) + { + if (is_null($align)) { + throw new \InvalidArgumentException('non-nullable align cannot be null'); + } + $this->container['align'] = $align; + + return $this; + } + + /** + * Gets animation + * + * @return \ShotstackClient\Model\RichTextAnimation|null + */ + public function getAnimation() + { + return $this->container['animation']; + } + + /** + * Sets animation + * + * @param \ShotstackClient\Model\RichTextAnimation|null $animation animation + * + * @return self + */ + public function setAnimation($animation) + { + if (is_null($animation)) { + throw new \InvalidArgumentException('non-nullable animation cannot be null'); + } + $this->container['animation'] = $animation; + + 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() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/RichTextAssetBorder.php b/src/Model/RichTextAssetBorder.php new file mode 100644 index 0000000..297be14 --- /dev/null +++ b/src/Model/RichTextAssetBorder.php @@ -0,0 +1,555 @@ + + */ +class RichTextAssetBorder implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'RichTextAsset_border'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'width' => 'float', + 'color' => 'string', + 'opacity' => 'float', + 'radius' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'width' => null, + 'color' => null, + 'opacity' => null, + 'radius' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'width' => false, + 'color' => false, + 'opacity' => false, + 'radius' => 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; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $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 = [ + 'width' => 'width', + 'color' => 'color', + 'opacity' => 'opacity', + 'radius' => 'radius' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'width' => 'setWidth', + 'color' => 'setColor', + 'opacity' => 'setOpacity', + 'radius' => 'setRadius' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'width' => 'getWidth', + 'color' => 'getColor', + 'opacity' => 'getOpacity', + 'radius' => 'getRadius' + ]; + + /** + * 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) + { + $this->setIfExists('width', $data ?? [], 0); + $this->setIfExists('color', $data ?? [], '#000000'); + $this->setIfExists('opacity', $data ?? [], 1); + $this->setIfExists('radius', $data ?? [], 0); + } + + /** + * 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['width']) && ($this->container['width'] < 0)) { + $invalidProperties[] = "invalid value for 'width', must be bigger than or equal to 0."; + } + + if (!is_null($this->container['color']) && !preg_match("/^#[A-Fa-f0-9]{6}$/", $this->container['color'])) { + $invalidProperties[] = "invalid value for 'color', must be conform to the pattern /^#[A-Fa-f0-9]{6}$/."; + } + + if (!is_null($this->container['opacity']) && ($this->container['opacity'] > 1)) { + $invalidProperties[] = "invalid value for 'opacity', must be smaller than or equal to 1."; + } + + if (!is_null($this->container['opacity']) && ($this->container['opacity'] < 0)) { + $invalidProperties[] = "invalid value for 'opacity', must be bigger than or equal to 0."; + } + + if (!is_null($this->container['radius']) && ($this->container['radius'] < 0)) { + $invalidProperties[] = "invalid value for 'radius', must be bigger than or equal to 0."; + } + + 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 width + * + * @return float|null + */ + public function getWidth() + { + return $this->container['width']; + } + + /** + * Sets width + * + * @param float|null $width The width of the border in pixels. Must be 0 or greater. + * + * @return self + */ + public function setWidth($width) + { + if (is_null($width)) { + throw new \InvalidArgumentException('non-nullable width cannot be null'); + } + + if (($width < 0)) { + throw new \InvalidArgumentException('invalid value for $width when calling RichTextAssetBorder., must be bigger than or equal to 0.'); + } + + $this->container['width'] = $width; + + return $this; + } + + /** + * Gets color + * + * @return string|null + */ + public function getColor() + { + return $this->container['color']; + } + + /** + * Sets color + * + * @param string|null $color The border color using hexadecimal color notation. + * + * @return self + */ + public function setColor($color) + { + if (is_null($color)) { + throw new \InvalidArgumentException('non-nullable color cannot be null'); + } + + if ((!preg_match("/^#[A-Fa-f0-9]{6}$/", ObjectSerializer::toString($color)))) { + throw new \InvalidArgumentException("invalid value for \$color when calling RichTextAssetBorder., must conform to the pattern /^#[A-Fa-f0-9]{6}$/."); + } + + $this->container['color'] = $color; + + return $this; + } + + /** + * Gets opacity + * + * @return float|null + */ + public function getOpacity() + { + return $this->container['opacity']; + } + + /** + * Sets opacity + * + * @param float|null $opacity The opacity of the border where 1 is opaque and 0 is transparent. + * + * @return self + */ + public function setOpacity($opacity) + { + if (is_null($opacity)) { + throw new \InvalidArgumentException('non-nullable opacity cannot be null'); + } + + if (($opacity > 1)) { + throw new \InvalidArgumentException('invalid value for $opacity when calling RichTextAssetBorder., must be smaller than or equal to 1.'); + } + if (($opacity < 0)) { + throw new \InvalidArgumentException('invalid value for $opacity when calling RichTextAssetBorder., must be bigger than or equal to 0.'); + } + + $this->container['opacity'] = $opacity; + + return $this; + } + + /** + * Gets radius + * + * @return float|null + */ + public function getRadius() + { + return $this->container['radius']; + } + + /** + * Sets radius + * + * @param float|null $radius The border radius in pixels for rounded corners. Must be 0 or greater. + * + * @return self + */ + public function setRadius($radius) + { + if (is_null($radius)) { + throw new \InvalidArgumentException('non-nullable radius cannot be null'); + } + + if (($radius < 0)) { + throw new \InvalidArgumentException('invalid value for $radius when calling RichTextAssetBorder., must be bigger than or equal to 0.'); + } + + $this->container['radius'] = $radius; + + 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() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/RichTextAssetPadding.php b/src/Model/RichTextAssetPadding.php new file mode 100644 index 0000000..7eb458f --- /dev/null +++ b/src/Model/RichTextAssetPadding.php @@ -0,0 +1,548 @@ + + */ +class RichTextAssetPadding implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'RichTextAsset_padding'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'top' => 'float', + 'right' => 'float', + 'bottom' => 'float', + 'left' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'top' => null, + 'right' => null, + 'bottom' => null, + 'left' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'top' => false, + 'right' => false, + 'bottom' => false, + 'left' => 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; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $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 = [ + 'top' => 'top', + 'right' => 'right', + 'bottom' => 'bottom', + 'left' => 'left' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'top' => 'setTop', + 'right' => 'setRight', + 'bottom' => 'setBottom', + 'left' => 'setLeft' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'top' => 'getTop', + 'right' => 'getRight', + 'bottom' => 'getBottom', + 'left' => 'getLeft' + ]; + + /** + * 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) + { + $this->setIfExists('top', $data ?? [], 0); + $this->setIfExists('right', $data ?? [], 0); + $this->setIfExists('bottom', $data ?? [], 0); + $this->setIfExists('left', $data ?? [], 0); + } + + /** + * 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['top']) && ($this->container['top'] < 0)) { + $invalidProperties[] = "invalid value for 'top', must be bigger than or equal to 0."; + } + + if (!is_null($this->container['right']) && ($this->container['right'] < 0)) { + $invalidProperties[] = "invalid value for 'right', must be bigger than or equal to 0."; + } + + if (!is_null($this->container['bottom']) && ($this->container['bottom'] < 0)) { + $invalidProperties[] = "invalid value for 'bottom', must be bigger than or equal to 0."; + } + + if (!is_null($this->container['left']) && ($this->container['left'] < 0)) { + $invalidProperties[] = "invalid value for 'left', must be bigger than or equal to 0."; + } + + 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 top + * + * @return float|null + */ + public function getTop() + { + return $this->container['top']; + } + + /** + * Sets top + * + * @param float|null $top Top padding in pixels. + * + * @return self + */ + public function setTop($top) + { + if (is_null($top)) { + throw new \InvalidArgumentException('non-nullable top cannot be null'); + } + + if (($top < 0)) { + throw new \InvalidArgumentException('invalid value for $top when calling RichTextAssetPadding., must be bigger than or equal to 0.'); + } + + $this->container['top'] = $top; + + return $this; + } + + /** + * Gets right + * + * @return float|null + */ + public function getRight() + { + return $this->container['right']; + } + + /** + * Sets right + * + * @param float|null $right Right padding in pixels. + * + * @return self + */ + public function setRight($right) + { + if (is_null($right)) { + throw new \InvalidArgumentException('non-nullable right cannot be null'); + } + + if (($right < 0)) { + throw new \InvalidArgumentException('invalid value for $right when calling RichTextAssetPadding., must be bigger than or equal to 0.'); + } + + $this->container['right'] = $right; + + return $this; + } + + /** + * Gets bottom + * + * @return float|null + */ + public function getBottom() + { + return $this->container['bottom']; + } + + /** + * Sets bottom + * + * @param float|null $bottom Bottom padding in pixels. + * + * @return self + */ + public function setBottom($bottom) + { + if (is_null($bottom)) { + throw new \InvalidArgumentException('non-nullable bottom cannot be null'); + } + + if (($bottom < 0)) { + throw new \InvalidArgumentException('invalid value for $bottom when calling RichTextAssetPadding., must be bigger than or equal to 0.'); + } + + $this->container['bottom'] = $bottom; + + return $this; + } + + /** + * Gets left + * + * @return float|null + */ + public function getLeft() + { + return $this->container['left']; + } + + /** + * Sets left + * + * @param float|null $left Left padding in pixels. + * + * @return self + */ + public function setLeft($left) + { + if (is_null($left)) { + throw new \InvalidArgumentException('non-nullable left cannot be null'); + } + + if (($left < 0)) { + throw new \InvalidArgumentException('invalid value for $left when calling RichTextAssetPadding., must be bigger than or equal to 0.'); + } + + $this->container['left'] = $left; + + 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() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/RichTextAssetPaddingOneOf.php b/src/Model/RichTextAssetPaddingOneOf.php new file mode 100644 index 0000000..77ec099 --- /dev/null +++ b/src/Model/RichTextAssetPaddingOneOf.php @@ -0,0 +1,548 @@ + + */ +class RichTextAssetPaddingOneOf implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'RichTextAsset_padding_oneOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'top' => 'float', + 'right' => 'float', + 'bottom' => 'float', + 'left' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'top' => null, + 'right' => null, + 'bottom' => null, + 'left' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'top' => false, + 'right' => false, + 'bottom' => false, + 'left' => 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; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $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 = [ + 'top' => 'top', + 'right' => 'right', + 'bottom' => 'bottom', + 'left' => 'left' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'top' => 'setTop', + 'right' => 'setRight', + 'bottom' => 'setBottom', + 'left' => 'setLeft' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'top' => 'getTop', + 'right' => 'getRight', + 'bottom' => 'getBottom', + 'left' => 'getLeft' + ]; + + /** + * 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) + { + $this->setIfExists('top', $data ?? [], 0); + $this->setIfExists('right', $data ?? [], 0); + $this->setIfExists('bottom', $data ?? [], 0); + $this->setIfExists('left', $data ?? [], 0); + } + + /** + * 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['top']) && ($this->container['top'] < 0)) { + $invalidProperties[] = "invalid value for 'top', must be bigger than or equal to 0."; + } + + if (!is_null($this->container['right']) && ($this->container['right'] < 0)) { + $invalidProperties[] = "invalid value for 'right', must be bigger than or equal to 0."; + } + + if (!is_null($this->container['bottom']) && ($this->container['bottom'] < 0)) { + $invalidProperties[] = "invalid value for 'bottom', must be bigger than or equal to 0."; + } + + if (!is_null($this->container['left']) && ($this->container['left'] < 0)) { + $invalidProperties[] = "invalid value for 'left', must be bigger than or equal to 0."; + } + + 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 top + * + * @return float|null + */ + public function getTop() + { + return $this->container['top']; + } + + /** + * Sets top + * + * @param float|null $top Top padding in pixels. + * + * @return self + */ + public function setTop($top) + { + if (is_null($top)) { + throw new \InvalidArgumentException('non-nullable top cannot be null'); + } + + if (($top < 0)) { + throw new \InvalidArgumentException('invalid value for $top when calling RichTextAssetPaddingOneOf., must be bigger than or equal to 0.'); + } + + $this->container['top'] = $top; + + return $this; + } + + /** + * Gets right + * + * @return float|null + */ + public function getRight() + { + return $this->container['right']; + } + + /** + * Sets right + * + * @param float|null $right Right padding in pixels. + * + * @return self + */ + public function setRight($right) + { + if (is_null($right)) { + throw new \InvalidArgumentException('non-nullable right cannot be null'); + } + + if (($right < 0)) { + throw new \InvalidArgumentException('invalid value for $right when calling RichTextAssetPaddingOneOf., must be bigger than or equal to 0.'); + } + + $this->container['right'] = $right; + + return $this; + } + + /** + * Gets bottom + * + * @return float|null + */ + public function getBottom() + { + return $this->container['bottom']; + } + + /** + * Sets bottom + * + * @param float|null $bottom Bottom padding in pixels. + * + * @return self + */ + public function setBottom($bottom) + { + if (is_null($bottom)) { + throw new \InvalidArgumentException('non-nullable bottom cannot be null'); + } + + if (($bottom < 0)) { + throw new \InvalidArgumentException('invalid value for $bottom when calling RichTextAssetPaddingOneOf., must be bigger than or equal to 0.'); + } + + $this->container['bottom'] = $bottom; + + return $this; + } + + /** + * Gets left + * + * @return float|null + */ + public function getLeft() + { + return $this->container['left']; + } + + /** + * Sets left + * + * @param float|null $left Left padding in pixels. + * + * @return self + */ + public function setLeft($left) + { + if (is_null($left)) { + throw new \InvalidArgumentException('non-nullable left cannot be null'); + } + + if (($left < 0)) { + throw new \InvalidArgumentException('invalid value for $left when calling RichTextAssetPaddingOneOf., must be bigger than or equal to 0.'); + } + + $this->container['left'] = $left; + + 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() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/RichTextBackground.php b/src/Model/RichTextBackground.php new file mode 100644 index 0000000..0e23aae --- /dev/null +++ b/src/Model/RichTextBackground.php @@ -0,0 +1,512 @@ + + */ +class RichTextBackground implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'RichTextBackground'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'color' => 'string', + 'opacity' => 'float', + 'border_radius' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'color' => null, + 'opacity' => null, + 'border_radius' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'color' => false, + 'opacity' => false, + 'border_radius' => 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; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $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 = [ + 'color' => 'color', + 'opacity' => 'opacity', + 'border_radius' => 'borderRadius' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'color' => 'setColor', + 'opacity' => 'setOpacity', + 'border_radius' => 'setBorderRadius' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'color' => 'getColor', + 'opacity' => 'getOpacity', + 'border_radius' => 'getBorderRadius' + ]; + + /** + * 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) + { + $this->setIfExists('color', $data ?? [], null); + $this->setIfExists('opacity', $data ?? [], 1); + $this->setIfExists('border_radius', $data ?? [], 0); + } + + /** + * 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['color']) && !preg_match("/^#[A-Fa-f0-9]{6}$/", $this->container['color'])) { + $invalidProperties[] = "invalid value for 'color', must be conform to the pattern /^#[A-Fa-f0-9]{6}$/."; + } + + if (!is_null($this->container['opacity']) && ($this->container['opacity'] > 1)) { + $invalidProperties[] = "invalid value for 'opacity', must be smaller than or equal to 1."; + } + + if (!is_null($this->container['opacity']) && ($this->container['opacity'] < 0)) { + $invalidProperties[] = "invalid value for 'opacity', must be bigger than or equal to 0."; + } + + if (!is_null($this->container['border_radius']) && ($this->container['border_radius'] < 0)) { + $invalidProperties[] = "invalid value for 'border_radius', must be bigger than or equal to 0."; + } + + 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 color + * + * @return string|null + */ + public function getColor() + { + return $this->container['color']; + } + + /** + * Sets color + * + * @param string|null $color The background color using hexadecimal color notation. + * + * @return self + */ + public function setColor($color) + { + if (is_null($color)) { + throw new \InvalidArgumentException('non-nullable color cannot be null'); + } + + if ((!preg_match("/^#[A-Fa-f0-9]{6}$/", ObjectSerializer::toString($color)))) { + throw new \InvalidArgumentException("invalid value for \$color when calling RichTextBackground., must conform to the pattern /^#[A-Fa-f0-9]{6}$/."); + } + + $this->container['color'] = $color; + + return $this; + } + + /** + * Gets opacity + * + * @return float|null + */ + public function getOpacity() + { + return $this->container['opacity']; + } + + /** + * Sets opacity + * + * @param float|null $opacity The opacity of the background where 1 is opaque and 0 is transparent. + * + * @return self + */ + public function setOpacity($opacity) + { + if (is_null($opacity)) { + throw new \InvalidArgumentException('non-nullable opacity cannot be null'); + } + + if (($opacity > 1)) { + throw new \InvalidArgumentException('invalid value for $opacity when calling RichTextBackground., must be smaller than or equal to 1.'); + } + if (($opacity < 0)) { + throw new \InvalidArgumentException('invalid value for $opacity when calling RichTextBackground., must be bigger than or equal to 0.'); + } + + $this->container['opacity'] = $opacity; + + return $this; + } + + /** + * Gets border_radius + * + * @return float|null + */ + public function getBorderRadius() + { + return $this->container['border_radius']; + } + + /** + * Sets border_radius + * + * @param float|null $border_radius The border radius of the background box in pixels. Must be 0 or greater. + * + * @return self + */ + public function setBorderRadius($border_radius) + { + if (is_null($border_radius)) { + throw new \InvalidArgumentException('non-nullable border_radius cannot be null'); + } + + if (($border_radius < 0)) { + throw new \InvalidArgumentException('invalid value for $border_radius when calling RichTextBackground., must be bigger than or equal to 0.'); + } + + $this->container['border_radius'] = $border_radius; + + 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() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/RichTextFont.php b/src/Model/RichTextFont.php new file mode 100644 index 0000000..6629431 --- /dev/null +++ b/src/Model/RichTextFont.php @@ -0,0 +1,671 @@ + + */ +class RichTextFont implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'RichTextFont'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'family' => 'string', + 'size' => 'int', + 'weight' => 'mixed', + 'color' => 'string', + 'opacity' => 'float', + 'background' => 'string', + 'stroke' => '\ShotstackClient\Model\RichTextStroke' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'family' => null, + 'size' => null, + 'weight' => null, + 'color' => null, + 'opacity' => null, + 'background' => null, + 'stroke' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'family' => false, + 'size' => false, + 'weight' => true, + 'color' => false, + 'opacity' => false, + 'background' => false, + 'stroke' => 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; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $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 = [ + 'family' => 'family', + 'size' => 'size', + 'weight' => 'weight', + 'color' => 'color', + 'opacity' => 'opacity', + 'background' => 'background', + 'stroke' => 'stroke' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'family' => 'setFamily', + 'size' => 'setSize', + 'weight' => 'setWeight', + 'color' => 'setColor', + 'opacity' => 'setOpacity', + 'background' => 'setBackground', + 'stroke' => 'setStroke' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'family' => 'getFamily', + 'size' => 'getSize', + 'weight' => 'getWeight', + 'color' => 'getColor', + 'opacity' => 'getOpacity', + 'background' => 'getBackground', + 'stroke' => 'getStroke' + ]; + + /** + * 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) + { + $this->setIfExists('family', $data ?? [], 'Open Sans'); + $this->setIfExists('size', $data ?? [], 24); + $this->setIfExists('weight', $data ?? [], null); + $this->setIfExists('color', $data ?? [], '#000000'); + $this->setIfExists('opacity', $data ?? [], 1); + $this->setIfExists('background', $data ?? [], null); + $this->setIfExists('stroke', $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['size']) && ($this->container['size'] > 500)) { + $invalidProperties[] = "invalid value for 'size', must be smaller than or equal to 500."; + } + + if (!is_null($this->container['size']) && ($this->container['size'] < 1)) { + $invalidProperties[] = "invalid value for 'size', must be bigger than or equal to 1."; + } + + if (!is_null($this->container['color']) && !preg_match("/^#[A-Fa-f0-9]{6}$/", $this->container['color'])) { + $invalidProperties[] = "invalid value for 'color', must be conform to the pattern /^#[A-Fa-f0-9]{6}$/."; + } + + if (!is_null($this->container['opacity']) && ($this->container['opacity'] > 1)) { + $invalidProperties[] = "invalid value for 'opacity', must be smaller than or equal to 1."; + } + + if (!is_null($this->container['opacity']) && ($this->container['opacity'] < 0)) { + $invalidProperties[] = "invalid value for 'opacity', must be bigger than or equal to 0."; + } + + if (!is_null($this->container['background']) && !preg_match("/^#[A-Fa-f0-9]{6}$/", $this->container['background'])) { + $invalidProperties[] = "invalid value for 'background', must be conform to the pattern /^#[A-Fa-f0-9]{6}$/."; + } + + 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 family + * + * @return string|null + */ + public function getFamily() + { + return $this->container['family']; + } + + /** + * Sets family + * + * @param string|null $family The font family name. This must be the Family name embedded in the font, i.e. \"Open Sans\". + * + * @return self + */ + public function setFamily($family) + { + if (is_null($family)) { + throw new \InvalidArgumentException('non-nullable family cannot be null'); + } + $this->container['family'] = $family; + + return $this; + } + + /** + * Gets size + * + * @return int|null + */ + public function getSize() + { + return $this->container['size']; + } + + /** + * Sets size + * + * @param int|null $size The size of the font in pixels (px). Must be between 1 and 500. + * + * @return self + */ + public function setSize($size) + { + if (is_null($size)) { + throw new \InvalidArgumentException('non-nullable size cannot be null'); + } + + if (($size > 500)) { + throw new \InvalidArgumentException('invalid value for $size when calling RichTextFont., must be smaller than or equal to 500.'); + } + if (($size < 1)) { + throw new \InvalidArgumentException('invalid value for $size when calling RichTextFont., must be bigger than or equal to 1.'); + } + + $this->container['size'] = $size; + + return $this; + } + + /** + * Gets weight + * + * @return mixed|null + */ + public function getWeight() + { + return $this->container['weight']; + } + + /** + * Sets weight + * + * @param mixed|null $weight The weight of the font. Can be a number (100-900) or a string ('normal', 'bold', etc.). 100 is lightest, 900 is heaviest (boldest). + * + * @return self + */ + public function setWeight($weight) + { + if (is_null($weight)) { + array_push($this->openAPINullablesSetToNull, 'weight'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('weight', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['weight'] = $weight; + + return $this; + } + + /** + * Gets color + * + * @return string|null + */ + public function getColor() + { + return $this->container['color']; + } + + /** + * Sets color + * + * @param string|null $color The text color using hexadecimal color notation. + * + * @return self + */ + public function setColor($color) + { + if (is_null($color)) { + throw new \InvalidArgumentException('non-nullable color cannot be null'); + } + + if ((!preg_match("/^#[A-Fa-f0-9]{6}$/", ObjectSerializer::toString($color)))) { + throw new \InvalidArgumentException("invalid value for \$color when calling RichTextFont., must conform to the pattern /^#[A-Fa-f0-9]{6}$/."); + } + + $this->container['color'] = $color; + + return $this; + } + + /** + * Gets opacity + * + * @return float|null + */ + public function getOpacity() + { + return $this->container['opacity']; + } + + /** + * Sets opacity + * + * @param float|null $opacity The opacity of the text where 1 is opaque and 0 is transparent. + * + * @return self + */ + public function setOpacity($opacity) + { + if (is_null($opacity)) { + throw new \InvalidArgumentException('non-nullable opacity cannot be null'); + } + + if (($opacity > 1)) { + throw new \InvalidArgumentException('invalid value for $opacity when calling RichTextFont., must be smaller than or equal to 1.'); + } + if (($opacity < 0)) { + throw new \InvalidArgumentException('invalid value for $opacity when calling RichTextFont., must be bigger than or equal to 0.'); + } + + $this->container['opacity'] = $opacity; + + return $this; + } + + /** + * Gets background + * + * @return string|null + */ + public function getBackground() + { + return $this->container['background']; + } + + /** + * Sets background + * + * @param string|null $background The background color behind the text using hexadecimal color notation. + * + * @return self + */ + public function setBackground($background) + { + if (is_null($background)) { + throw new \InvalidArgumentException('non-nullable background cannot be null'); + } + + if ((!preg_match("/^#[A-Fa-f0-9]{6}$/", ObjectSerializer::toString($background)))) { + throw new \InvalidArgumentException("invalid value for \$background when calling RichTextFont., must conform to the pattern /^#[A-Fa-f0-9]{6}$/."); + } + + $this->container['background'] = $background; + + return $this; + } + + /** + * Gets stroke + * + * @return \ShotstackClient\Model\RichTextStroke|null + */ + public function getStroke() + { + return $this->container['stroke']; + } + + /** + * Sets stroke + * + * @param \ShotstackClient\Model\RichTextStroke|null $stroke stroke + * + * @return self + */ + public function setStroke($stroke) + { + if (is_null($stroke)) { + throw new \InvalidArgumentException('non-nullable stroke cannot be null'); + } + $this->container['stroke'] = $stroke; + + 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() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ShotstackImageToVideoOptions.php b/src/Model/RichTextGradient.php similarity index 73% rename from src/Model/ShotstackImageToVideoOptions.php rename to src/Model/RichTextGradient.php index 43b031d..f2eefd1 100644 --- a/src/Model/ShotstackImageToVideoOptions.php +++ b/src/Model/RichTextGradient.php @@ -1,11 +1,11 @@ */ -class ShotstackImageToVideoOptions implements ModelInterface, ArrayAccess, \JsonSerializable +class RichTextGradient implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; @@ -50,7 +50,7 @@ class ShotstackImageToVideoOptions implements ModelInterface, ArrayAccess, \Json * * @var string */ - protected static $openAPIModelName = 'ShotstackImageToVideoOptions'; + protected static $openAPIModelName = 'RichTextGradient'; /** * Array of property to type mappings. Used for (de)serialization @@ -59,9 +59,8 @@ class ShotstackImageToVideoOptions implements ModelInterface, ArrayAccess, \Json */ protected static $openAPITypes = [ 'type' => 'string', - 'image_url' => 'string', - 'guidance_scale' => 'float', - 'motion' => 'int' + 'angle' => 'float', + 'stops' => '\ShotstackClient\Model\RichTextGradientStopsInner[]' ]; /** @@ -73,9 +72,8 @@ class ShotstackImageToVideoOptions implements ModelInterface, ArrayAccess, \Json */ protected static $openAPIFormats = [ 'type' => null, - 'image_url' => null, - 'guidance_scale' => null, - 'motion' => null + 'angle' => null, + 'stops' => null ]; /** @@ -85,9 +83,8 @@ class ShotstackImageToVideoOptions implements ModelInterface, ArrayAccess, \Json */ protected static array $openAPINullables = [ 'type' => false, - 'image_url' => false, - 'guidance_scale' => false, - 'motion' => false + 'angle' => false, + 'stops' => false ]; /** @@ -177,9 +174,8 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'type' => 'type', - 'image_url' => 'imageUrl', - 'guidance_scale' => 'guidanceScale', - 'motion' => 'motion' + 'angle' => 'angle', + 'stops' => 'stops' ]; /** @@ -189,9 +185,8 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'type' => 'setType', - 'image_url' => 'setImageUrl', - 'guidance_scale' => 'setGuidanceScale', - 'motion' => 'setMotion' + 'angle' => 'setAngle', + 'stops' => 'setStops' ]; /** @@ -201,9 +196,8 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'type' => 'getType', - 'image_url' => 'getImageUrl', - 'guidance_scale' => 'getGuidanceScale', - 'motion' => 'getMotion' + 'angle' => 'getAngle', + 'stops' => 'getStops' ]; /** @@ -247,7 +241,8 @@ public function getModelName() return self::$openAPIModelName; } - public const TYPE_IMAGE_TO_VIDEO = 'image-to-video'; + public const TYPE_LINEAR = 'linear'; + public const TYPE_RADIAL = 'radial'; /** * Gets allowable values of the enum @@ -257,7 +252,8 @@ public function getModelName() public function getTypeAllowableValues() { return [ - self::TYPE_IMAGE_TO_VIDEO, + self::TYPE_LINEAR, + self::TYPE_RADIAL, ]; } @@ -276,10 +272,9 @@ public function getTypeAllowableValues() */ public function __construct(array $data = null) { - $this->setIfExists('type', $data ?? [], 'image-to-video'); - $this->setIfExists('image_url', $data ?? [], null); - $this->setIfExists('guidance_scale', $data ?? [], 1.8); - $this->setIfExists('motion', $data ?? [], 127); + $this->setIfExists('type', $data ?? [], 'linear'); + $this->setIfExists('angle', $data ?? [], 0); + $this->setIfExists('stops', $data ?? [], null); } /** @@ -309,9 +304,6 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['type'] === null) { - $invalidProperties[] = "'type' can't be null"; - } $allowedValues = $this->getTypeAllowableValues(); if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { $invalidProperties[] = sprintf( @@ -321,9 +313,21 @@ public function listInvalidProperties() ); } - if ($this->container['image_url'] === null) { - $invalidProperties[] = "'image_url' can't be null"; + if (!is_null($this->container['angle']) && ($this->container['angle'] > 360)) { + $invalidProperties[] = "invalid value for 'angle', must be smaller than or equal to 360."; + } + + if (!is_null($this->container['angle']) && ($this->container['angle'] < 0)) { + $invalidProperties[] = "invalid value for 'angle', must be bigger than or equal to 0."; + } + + if ($this->container['stops'] === null) { + $invalidProperties[] = "'stops' can't be null"; + } + if ((count($this->container['stops']) < 2)) { + $invalidProperties[] = "invalid value for 'stops', number of items must be greater than or equal to 2."; } + return $invalidProperties; } @@ -342,7 +346,7 @@ public function valid() /** * Gets type * - * @return string + * @return string|null */ public function getType() { @@ -352,7 +356,7 @@ public function getType() /** * Sets type * - * @param string $type The type of asset to generate - set to `image-to-video` for image-to-video. + * @param string|null $type The type of gradient. * * @return self */ @@ -377,82 +381,68 @@ public function setType($type) } /** - * Gets image_url + * Gets angle * - * @return string + * @return float|null */ - public function getImageUrl() + public function getAngle() { - return $this->container['image_url']; + return $this->container['angle']; } /** - * Sets image_url + * Sets angle * - * @param string $image_url The URL of the image to convert to video. The URL must be publicly accessible or include credentials. The image dimensions must exactly match one of the following: 1024px x 576px, 576px x 1024px or 768px x 768px. + * @param float|null $angle The angle of the gradient in degrees (for linear gradients). Must be between 0 and 360. * * @return self */ - public function setImageUrl($image_url) + public function setAngle($angle) { - if (is_null($image_url)) { - throw new \InvalidArgumentException('non-nullable image_url cannot be null'); + if (is_null($angle)) { + throw new \InvalidArgumentException('non-nullable angle cannot be null'); } - $this->container['image_url'] = $image_url; + + if (($angle > 360)) { + throw new \InvalidArgumentException('invalid value for $angle when calling RichTextGradient., must be smaller than or equal to 360.'); + } + if (($angle < 0)) { + throw new \InvalidArgumentException('invalid value for $angle when calling RichTextGradient., must be bigger than or equal to 0.'); + } + + $this->container['angle'] = $angle; return $this; } /** - * Gets guidance_scale + * Gets stops * - * @return float|null + * @return \ShotstackClient\Model\RichTextGradientStopsInner[] */ - public function getGuidanceScale() + public function getStops() { - return $this->container['guidance_scale']; + return $this->container['stops']; } /** - * Sets guidance_scale + * Sets stops * - * @param float|null $guidance_scale The guidance scale determines how closely the generated video will match the image. Lower numbers allow for more creative freedom. A number between 0 and 10. + * @param \ShotstackClient\Model\RichTextGradientStopsInner[] $stops Gradient color stops. Must have at least 2 stops. * * @return self */ - public function setGuidanceScale($guidance_scale) + public function setStops($stops) { - if (is_null($guidance_scale)) { - throw new \InvalidArgumentException('non-nullable guidance_scale cannot be null'); + if (is_null($stops)) { + throw new \InvalidArgumentException('non-nullable stops cannot be null'); } - $this->container['guidance_scale'] = $guidance_scale; - return $this; - } - - /** - * Gets motion - * - * @return int|null - */ - public function getMotion() - { - return $this->container['motion']; - } - /** - * Sets motion - * - * @param int|null $motion The amount of motion in the video. A number between 1 and 255. - * - * @return self - */ - public function setMotion($motion) - { - if (is_null($motion)) { - throw new \InvalidArgumentException('non-nullable motion cannot be null'); + if ((count($stops) < 2)) { + throw new \InvalidArgumentException('invalid length for $stops when calling RichTextGradient., number of items must be greater than or equal to 2.'); } - $this->container['motion'] = $motion; + $this->container['stops'] = $stops; return $this; } diff --git a/src/Model/RichTextGradientStopsInner.php b/src/Model/RichTextGradientStopsInner.php new file mode 100644 index 0000000..306aec2 --- /dev/null +++ b/src/Model/RichTextGradientStopsInner.php @@ -0,0 +1,474 @@ + + */ +class RichTextGradientStopsInner implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'RichTextGradient_stops_inner'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'offset' => 'float', + 'color' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'offset' => null, + 'color' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'offset' => false, + 'color' => 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; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $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 = [ + 'offset' => 'offset', + 'color' => 'color' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'offset' => 'setOffset', + 'color' => 'setColor' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'offset' => 'getOffset', + 'color' => 'getColor' + ]; + + /** + * 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) + { + $this->setIfExists('offset', $data ?? [], null); + $this->setIfExists('color', $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 ($this->container['offset'] === null) { + $invalidProperties[] = "'offset' can't be null"; + } + if (($this->container['offset'] > 1)) { + $invalidProperties[] = "invalid value for 'offset', must be smaller than or equal to 1."; + } + + if (($this->container['offset'] < 0)) { + $invalidProperties[] = "invalid value for 'offset', must be bigger than or equal to 0."; + } + + if ($this->container['color'] === null) { + $invalidProperties[] = "'color' can't be null"; + } + if (!preg_match("/^#[A-Fa-f0-9]{6}$/", $this->container['color'])) { + $invalidProperties[] = "invalid value for 'color', must be conform to the pattern /^#[A-Fa-f0-9]{6}$/."; + } + + 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 offset + * + * @return float + */ + public function getOffset() + { + return $this->container['offset']; + } + + /** + * Sets offset + * + * @param float $offset Position of the color stop between 0 (start) and 1 (end). + * + * @return self + */ + public function setOffset($offset) + { + if (is_null($offset)) { + throw new \InvalidArgumentException('non-nullable offset cannot be null'); + } + + if (($offset > 1)) { + throw new \InvalidArgumentException('invalid value for $offset when calling RichTextGradientStopsInner., must be smaller than or equal to 1.'); + } + if (($offset < 0)) { + throw new \InvalidArgumentException('invalid value for $offset when calling RichTextGradientStopsInner., must be bigger than or equal to 0.'); + } + + $this->container['offset'] = $offset; + + return $this; + } + + /** + * Gets color + * + * @return string + */ + public function getColor() + { + return $this->container['color']; + } + + /** + * Sets color + * + * @param string $color Color at this stop using hexadecimal color notation. + * + * @return self + */ + public function setColor($color) + { + if (is_null($color)) { + throw new \InvalidArgumentException('non-nullable color cannot be null'); + } + + if ((!preg_match("/^#[A-Fa-f0-9]{6}$/", ObjectSerializer::toString($color)))) { + throw new \InvalidArgumentException("invalid value for \$color when calling RichTextGradientStopsInner., must conform to the pattern /^#[A-Fa-f0-9]{6}$/."); + } + + $this->container['color'] = $color; + + 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() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/RichTextShadow.php b/src/Model/RichTextShadow.php new file mode 100644 index 0000000..6ca228b --- /dev/null +++ b/src/Model/RichTextShadow.php @@ -0,0 +1,580 @@ + + */ +class RichTextShadow implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'RichTextShadow'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'offset_x' => 'float', + 'offset_y' => 'float', + 'blur' => 'float', + 'color' => 'string', + 'opacity' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'offset_x' => null, + 'offset_y' => null, + 'blur' => null, + 'color' => null, + 'opacity' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'offset_x' => false, + 'offset_y' => false, + 'blur' => false, + 'color' => false, + 'opacity' => 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; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $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 = [ + 'offset_x' => 'offsetX', + 'offset_y' => 'offsetY', + 'blur' => 'blur', + 'color' => 'color', + 'opacity' => 'opacity' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'offset_x' => 'setOffsetX', + 'offset_y' => 'setOffsetY', + 'blur' => 'setBlur', + 'color' => 'setColor', + 'opacity' => 'setOpacity' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'offset_x' => 'getOffsetX', + 'offset_y' => 'getOffsetY', + 'blur' => 'getBlur', + 'color' => 'getColor', + 'opacity' => 'getOpacity' + ]; + + /** + * 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) + { + $this->setIfExists('offset_x', $data ?? [], 0); + $this->setIfExists('offset_y', $data ?? [], 0); + $this->setIfExists('blur', $data ?? [], 0); + $this->setIfExists('color', $data ?? [], '#000000'); + $this->setIfExists('opacity', $data ?? [], 0.5); + } + + /** + * 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['blur']) && ($this->container['blur'] < 0)) { + $invalidProperties[] = "invalid value for 'blur', must be bigger than or equal to 0."; + } + + if (!is_null($this->container['color']) && !preg_match("/^#[A-Fa-f0-9]{6}$/", $this->container['color'])) { + $invalidProperties[] = "invalid value for 'color', must be conform to the pattern /^#[A-Fa-f0-9]{6}$/."; + } + + if (!is_null($this->container['opacity']) && ($this->container['opacity'] > 1)) { + $invalidProperties[] = "invalid value for 'opacity', must be smaller than or equal to 1."; + } + + if (!is_null($this->container['opacity']) && ($this->container['opacity'] < 0)) { + $invalidProperties[] = "invalid value for 'opacity', must be bigger than or equal to 0."; + } + + 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 offset_x + * + * @return float|null + */ + public function getOffsetX() + { + return $this->container['offset_x']; + } + + /** + * Sets offset_x + * + * @param float|null $offset_x Horizontal offset of the shadow in pixels. Positive values move right, negative left. + * + * @return self + */ + public function setOffsetX($offset_x) + { + if (is_null($offset_x)) { + throw new \InvalidArgumentException('non-nullable offset_x cannot be null'); + } + $this->container['offset_x'] = $offset_x; + + return $this; + } + + /** + * Gets offset_y + * + * @return float|null + */ + public function getOffsetY() + { + return $this->container['offset_y']; + } + + /** + * Sets offset_y + * + * @param float|null $offset_y Vertical offset of the shadow in pixels. Positive values move down, negative up. + * + * @return self + */ + public function setOffsetY($offset_y) + { + if (is_null($offset_y)) { + throw new \InvalidArgumentException('non-nullable offset_y cannot be null'); + } + $this->container['offset_y'] = $offset_y; + + return $this; + } + + /** + * Gets blur + * + * @return float|null + */ + public function getBlur() + { + return $this->container['blur']; + } + + /** + * Sets blur + * + * @param float|null $blur The blur radius of the shadow in pixels. Must be 0 or greater. + * + * @return self + */ + public function setBlur($blur) + { + if (is_null($blur)) { + throw new \InvalidArgumentException('non-nullable blur cannot be null'); + } + + if (($blur < 0)) { + throw new \InvalidArgumentException('invalid value for $blur when calling RichTextShadow., must be bigger than or equal to 0.'); + } + + $this->container['blur'] = $blur; + + return $this; + } + + /** + * Gets color + * + * @return string|null + */ + public function getColor() + { + return $this->container['color']; + } + + /** + * Sets color + * + * @param string|null $color The shadow color using hexadecimal color notation. + * + * @return self + */ + public function setColor($color) + { + if (is_null($color)) { + throw new \InvalidArgumentException('non-nullable color cannot be null'); + } + + if ((!preg_match("/^#[A-Fa-f0-9]{6}$/", ObjectSerializer::toString($color)))) { + throw new \InvalidArgumentException("invalid value for \$color when calling RichTextShadow., must conform to the pattern /^#[A-Fa-f0-9]{6}$/."); + } + + $this->container['color'] = $color; + + return $this; + } + + /** + * Gets opacity + * + * @return float|null + */ + public function getOpacity() + { + return $this->container['opacity']; + } + + /** + * Sets opacity + * + * @param float|null $opacity The opacity of the shadow where 1 is opaque and 0 is transparent. + * + * @return self + */ + public function setOpacity($opacity) + { + if (is_null($opacity)) { + throw new \InvalidArgumentException('non-nullable opacity cannot be null'); + } + + if (($opacity > 1)) { + throw new \InvalidArgumentException('invalid value for $opacity when calling RichTextShadow., must be smaller than or equal to 1.'); + } + if (($opacity < 0)) { + throw new \InvalidArgumentException('invalid value for $opacity when calling RichTextShadow., must be bigger than or equal to 0.'); + } + + $this->container['opacity'] = $opacity; + + 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() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/RichTextStroke.php b/src/Model/RichTextStroke.php new file mode 100644 index 0000000..90a03e6 --- /dev/null +++ b/src/Model/RichTextStroke.php @@ -0,0 +1,512 @@ + + */ +class RichTextStroke implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'RichTextStroke'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'width' => 'float', + 'color' => 'string', + 'opacity' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'width' => null, + 'color' => null, + 'opacity' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'width' => false, + 'color' => false, + 'opacity' => 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; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $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 = [ + 'width' => 'width', + 'color' => 'color', + 'opacity' => 'opacity' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'width' => 'setWidth', + 'color' => 'setColor', + 'opacity' => 'setOpacity' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'width' => 'getWidth', + 'color' => 'getColor', + 'opacity' => 'getOpacity' + ]; + + /** + * 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) + { + $this->setIfExists('width', $data ?? [], 0); + $this->setIfExists('color', $data ?? [], '#000000'); + $this->setIfExists('opacity', $data ?? [], 1); + } + + /** + * 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['width']) && ($this->container['width'] < 0)) { + $invalidProperties[] = "invalid value for 'width', must be bigger than or equal to 0."; + } + + if (!is_null($this->container['color']) && !preg_match("/^#[A-Fa-f0-9]{6}$/", $this->container['color'])) { + $invalidProperties[] = "invalid value for 'color', must be conform to the pattern /^#[A-Fa-f0-9]{6}$/."; + } + + if (!is_null($this->container['opacity']) && ($this->container['opacity'] > 1)) { + $invalidProperties[] = "invalid value for 'opacity', must be smaller than or equal to 1."; + } + + if (!is_null($this->container['opacity']) && ($this->container['opacity'] < 0)) { + $invalidProperties[] = "invalid value for 'opacity', must be bigger than or equal to 0."; + } + + 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 width + * + * @return float|null + */ + public function getWidth() + { + return $this->container['width']; + } + + /** + * Sets width + * + * @param float|null $width The width of the stroke in pixels. Must be 0 or greater. + * + * @return self + */ + public function setWidth($width) + { + if (is_null($width)) { + throw new \InvalidArgumentException('non-nullable width cannot be null'); + } + + if (($width < 0)) { + throw new \InvalidArgumentException('invalid value for $width when calling RichTextStroke., must be bigger than or equal to 0.'); + } + + $this->container['width'] = $width; + + return $this; + } + + /** + * Gets color + * + * @return string|null + */ + public function getColor() + { + return $this->container['color']; + } + + /** + * Sets color + * + * @param string|null $color The stroke color using hexadecimal color notation. + * + * @return self + */ + public function setColor($color) + { + if (is_null($color)) { + throw new \InvalidArgumentException('non-nullable color cannot be null'); + } + + if ((!preg_match("/^#[A-Fa-f0-9]{6}$/", ObjectSerializer::toString($color)))) { + throw new \InvalidArgumentException("invalid value for \$color when calling RichTextStroke., must conform to the pattern /^#[A-Fa-f0-9]{6}$/."); + } + + $this->container['color'] = $color; + + return $this; + } + + /** + * Gets opacity + * + * @return float|null + */ + public function getOpacity() + { + return $this->container['opacity']; + } + + /** + * Sets opacity + * + * @param float|null $opacity The opacity of the stroke where 1 is opaque and 0 is transparent. + * + * @return self + */ + public function setOpacity($opacity) + { + if (is_null($opacity)) { + throw new \InvalidArgumentException('non-nullable opacity cannot be null'); + } + + if (($opacity > 1)) { + throw new \InvalidArgumentException('invalid value for $opacity when calling RichTextStroke., must be smaller than or equal to 1.'); + } + if (($opacity < 0)) { + throw new \InvalidArgumentException('invalid value for $opacity when calling RichTextStroke., must be bigger than or equal to 0.'); + } + + $this->container['opacity'] = $opacity; + + 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() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/RichTextStyle.php b/src/Model/RichTextStyle.php new file mode 100644 index 0000000..07013b8 --- /dev/null +++ b/src/Model/RichTextStyle.php @@ -0,0 +1,679 @@ + + */ +class RichTextStyle implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'RichTextStyle'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'letter_spacing' => 'float', + 'word_spacing' => 'float', + 'line_height' => 'float', + 'text_transform' => 'string', + 'text_decoration' => 'string', + 'gradient' => '\ShotstackClient\Model\RichTextGradient' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'letter_spacing' => null, + 'word_spacing' => null, + 'line_height' => null, + 'text_transform' => null, + 'text_decoration' => null, + 'gradient' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'letter_spacing' => false, + 'word_spacing' => false, + 'line_height' => false, + 'text_transform' => false, + 'text_decoration' => false, + 'gradient' => 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; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $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 = [ + 'letter_spacing' => 'letterSpacing', + 'word_spacing' => 'wordSpacing', + 'line_height' => 'lineHeight', + 'text_transform' => 'textTransform', + 'text_decoration' => 'textDecoration', + 'gradient' => 'gradient' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'letter_spacing' => 'setLetterSpacing', + 'word_spacing' => 'setWordSpacing', + 'line_height' => 'setLineHeight', + 'text_transform' => 'setTextTransform', + 'text_decoration' => 'setTextDecoration', + 'gradient' => 'setGradient' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'letter_spacing' => 'getLetterSpacing', + 'word_spacing' => 'getWordSpacing', + 'line_height' => 'getLineHeight', + 'text_transform' => 'getTextTransform', + 'text_decoration' => 'getTextDecoration', + 'gradient' => 'getGradient' + ]; + + /** + * 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 TEXT_TRANSFORM_NONE = 'none'; + public const TEXT_TRANSFORM_UPPERCASE = 'uppercase'; + public const TEXT_TRANSFORM_LOWERCASE = 'lowercase'; + public const TEXT_TRANSFORM_CAPITALIZE = 'capitalize'; + public const TEXT_DECORATION_NONE = 'none'; + public const TEXT_DECORATION_UNDERLINE = 'underline'; + public const TEXT_DECORATION_LINE_THROUGH = 'line-through'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTextTransformAllowableValues() + { + return [ + self::TEXT_TRANSFORM_NONE, + self::TEXT_TRANSFORM_UPPERCASE, + self::TEXT_TRANSFORM_LOWERCASE, + self::TEXT_TRANSFORM_CAPITALIZE, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTextDecorationAllowableValues() + { + return [ + self::TEXT_DECORATION_NONE, + self::TEXT_DECORATION_UNDERLINE, + self::TEXT_DECORATION_LINE_THROUGH, + ]; + } + + /** + * 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) + { + $this->setIfExists('letter_spacing', $data ?? [], 0); + $this->setIfExists('word_spacing', $data ?? [], 0); + $this->setIfExists('line_height', $data ?? [], 1.2); + $this->setIfExists('text_transform', $data ?? [], 'none'); + $this->setIfExists('text_decoration', $data ?? [], 'none'); + $this->setIfExists('gradient', $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['word_spacing']) && ($this->container['word_spacing'] < 0)) { + $invalidProperties[] = "invalid value for 'word_spacing', must be bigger than or equal to 0."; + } + + if (!is_null($this->container['line_height']) && ($this->container['line_height'] > 10)) { + $invalidProperties[] = "invalid value for 'line_height', must be smaller than or equal to 10."; + } + + if (!is_null($this->container['line_height']) && ($this->container['line_height'] < 0)) { + $invalidProperties[] = "invalid value for 'line_height', must be bigger than or equal to 0."; + } + + $allowedValues = $this->getTextTransformAllowableValues(); + if (!is_null($this->container['text_transform']) && !in_array($this->container['text_transform'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'text_transform', must be one of '%s'", + $this->container['text_transform'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getTextDecorationAllowableValues(); + if (!is_null($this->container['text_decoration']) && !in_array($this->container['text_decoration'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'text_decoration', must be one of '%s'", + $this->container['text_decoration'], + 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 letter_spacing + * + * @return float|null + */ + public function getLetterSpacing() + { + return $this->container['letter_spacing']; + } + + /** + * Sets letter_spacing + * + * @param float|null $letter_spacing Additional spacing between letters in pixels. Can be negative for tighter spacing. + * + * @return self + */ + public function setLetterSpacing($letter_spacing) + { + if (is_null($letter_spacing)) { + throw new \InvalidArgumentException('non-nullable letter_spacing cannot be null'); + } + $this->container['letter_spacing'] = $letter_spacing; + + return $this; + } + + /** + * Gets word_spacing + * + * @return float|null + */ + public function getWordSpacing() + { + return $this->container['word_spacing']; + } + + /** + * Sets word_spacing + * + * @param float|null $word_spacing Additional spacing between words in pixels. A value of 0 uses the font's natural space width. + * + * @return self + */ + public function setWordSpacing($word_spacing) + { + if (is_null($word_spacing)) { + throw new \InvalidArgumentException('non-nullable word_spacing cannot be null'); + } + + if (($word_spacing < 0)) { + throw new \InvalidArgumentException('invalid value for $word_spacing when calling RichTextStyle., must be bigger than or equal to 0.'); + } + + $this->container['word_spacing'] = $word_spacing; + + return $this; + } + + /** + * Gets line_height + * + * @return float|null + */ + public function getLineHeight() + { + return $this->container['line_height']; + } + + /** + * Sets line_height + * + * @param float|null $line_height The line height as a multiplier of the font size. Must be between 0 and 10. + * + * @return self + */ + public function setLineHeight($line_height) + { + if (is_null($line_height)) { + throw new \InvalidArgumentException('non-nullable line_height cannot be null'); + } + + if (($line_height > 10)) { + throw new \InvalidArgumentException('invalid value for $line_height when calling RichTextStyle., must be smaller than or equal to 10.'); + } + if (($line_height < 0)) { + throw new \InvalidArgumentException('invalid value for $line_height when calling RichTextStyle., must be bigger than or equal to 0.'); + } + + $this->container['line_height'] = $line_height; + + return $this; + } + + /** + * Gets text_transform + * + * @return string|null + */ + public function getTextTransform() + { + return $this->container['text_transform']; + } + + /** + * Sets text_transform + * + * @param string|null $text_transform Text transformation to apply. + * + * @return self + */ + public function setTextTransform($text_transform) + { + if (is_null($text_transform)) { + throw new \InvalidArgumentException('non-nullable text_transform cannot be null'); + } + $allowedValues = $this->getTextTransformAllowableValues(); + if (!in_array($text_transform, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'text_transform', must be one of '%s'", + $text_transform, + implode("', '", $allowedValues) + ) + ); + } + $this->container['text_transform'] = $text_transform; + + return $this; + } + + /** + * Gets text_decoration + * + * @return string|null + */ + public function getTextDecoration() + { + return $this->container['text_decoration']; + } + + /** + * Sets text_decoration + * + * @param string|null $text_decoration Text decoration to apply. + * + * @return self + */ + public function setTextDecoration($text_decoration) + { + if (is_null($text_decoration)) { + throw new \InvalidArgumentException('non-nullable text_decoration cannot be null'); + } + $allowedValues = $this->getTextDecorationAllowableValues(); + if (!in_array($text_decoration, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'text_decoration', must be one of '%s'", + $text_decoration, + implode("', '", $allowedValues) + ) + ); + } + $this->container['text_decoration'] = $text_decoration; + + return $this; + } + + /** + * Gets gradient + * + * @return \ShotstackClient\Model\RichTextGradient|null + */ + public function getGradient() + { + return $this->container['gradient']; + } + + /** + * Sets gradient + * + * @param \ShotstackClient\Model\RichTextGradient|null $gradient gradient + * + * @return self + */ + public function setGradient($gradient) + { + if (is_null($gradient)) { + throw new \InvalidArgumentException('non-nullable gradient cannot be null'); + } + $this->container['gradient'] = $gradient; + + 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() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/RotateTransformation.php b/src/Model/RotateTransformation.php index 62d3c91..38a55a4 100644 --- a/src/Model/RotateTransformation.php +++ b/src/Model/RotateTransformation.php @@ -5,7 +5,7 @@ * PHP version 7.4 * * @category Class - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech */ @@ -26,17 +26,17 @@ * Do not edit the class manually. */ -namespace Shotstack\Client\Model; +namespace ShotstackClient\Model; use \ArrayAccess; -use \Shotstack\Client\ObjectSerializer; +use \ShotstackClient\ObjectSerializer; /** * RotateTransformation Class Doc Comment * * @category Class * @description Rotate a clip by the specified angle in degrees. Rotation origin is set based on the clips `position`. - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech * @implements \ArrayAccess @@ -58,7 +58,7 @@ class RotateTransformation implements ModelInterface, ArrayAccess, \JsonSerializ * @var string[] */ protected static $openAPITypes = [ - 'angle' => 'int' + 'angle' => '\ShotstackClient\Model\RotateTransformationAngle' ]; /** @@ -293,7 +293,7 @@ public function valid() /** * Gets angle * - * @return int|null + * @return \ShotstackClient\Model\RotateTransformationAngle|null */ public function getAngle() { @@ -303,7 +303,7 @@ public function getAngle() /** * Sets angle * - * @param int|null $angle The angle to rotate the clip. Can be 0 to 360, or 0 to -360. Using a positive number rotates the clip clockwise, negative numbers counter-clockwise. + * @param \ShotstackClient\Model\RotateTransformationAngle|null $angle angle * * @return self */ diff --git a/src/Model/RotateTransformationAngle.php b/src/Model/RotateTransformationAngle.php new file mode 100644 index 0000000..ef8b3cf --- /dev/null +++ b/src/Model/RotateTransformationAngle.php @@ -0,0 +1,382 @@ + + */ +class RotateTransformationAngle implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'RotateTransformation_angle'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + + ]; + + /** + * 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; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $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 = [ + + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + + ]; + + /** + * 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) + { + } + + /** + * 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 = []; + + 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; + } + + /** + * 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() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/S3Destination.php b/src/Model/S3Destination.php index 057b73a..6264721 100644 --- a/src/Model/S3Destination.php +++ b/src/Model/S3Destination.php @@ -5,7 +5,7 @@ * PHP version 7.4 * * @category Class - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech */ @@ -26,17 +26,17 @@ * Do not edit the class manually. */ -namespace Shotstack\Client\Model; +namespace ShotstackClient\Model; use \ArrayAccess; -use \Shotstack\Client\ObjectSerializer; +use \ShotstackClient\ObjectSerializer; /** * S3Destination Class Doc Comment * * @category Class * @description Send videos and assets to an [Amazon S3](https://shotstack.io/docs/guide/serving-assets/destinations/s3/) bucket. Send files to any region with your own prefix and filename. AWS credentials are required and added via the [dashboard](https://dashboard.shotstack.io/integrations/s3), not in the request. - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech * @implements \ArrayAccess @@ -59,7 +59,7 @@ class S3Destination implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPITypes = [ 'provider' => 'string', - 'options' => '\Shotstack\Client\Model\S3DestinationOptions' + 'options' => '\ShotstackClient\Model\S3DestinationOptions' ]; /** @@ -330,7 +330,7 @@ public function setProvider($provider) /** * Gets options * - * @return \Shotstack\Client\Model\S3DestinationOptions|null + * @return \ShotstackClient\Model\S3DestinationOptions|null */ public function getOptions() { @@ -340,7 +340,7 @@ public function getOptions() /** * Sets options * - * @param \Shotstack\Client\Model\S3DestinationOptions|null $options options + * @param \ShotstackClient\Model\S3DestinationOptions|null $options options * * @return self */ diff --git a/src/Model/S3DestinationOptions.php b/src/Model/S3DestinationOptions.php index 141314f..a3f68c4 100644 --- a/src/Model/S3DestinationOptions.php +++ b/src/Model/S3DestinationOptions.php @@ -5,7 +5,7 @@ * PHP version 7.4 * * @category Class - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech */ @@ -26,17 +26,17 @@ * Do not edit the class manually. */ -namespace Shotstack\Client\Model; +namespace ShotstackClient\Model; use \ArrayAccess; -use \Shotstack\Client\ObjectSerializer; +use \ShotstackClient\ObjectSerializer; /** * S3DestinationOptions Class Doc Comment * * @category Class * @description Pass additional options to control how files are stored in S3. - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech * @implements \ArrayAccess diff --git a/src/Model/GeneratedAssetResponseAttributes.php b/src/Model/ShapeAsset.php similarity index 58% rename from src/Model/GeneratedAssetResponseAttributes.php rename to src/Model/ShapeAsset.php index 0322b5b..1477692 100644 --- a/src/Model/GeneratedAssetResponseAttributes.php +++ b/src/Model/ShapeAsset.php @@ -1,11 +1,11 @@ */ -class GeneratedAssetResponseAttributes implements ModelInterface, ArrayAccess, \JsonSerializable +class ShapeAsset implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; @@ -50,7 +50,7 @@ class GeneratedAssetResponseAttributes implements ModelInterface, ArrayAccess, \ * * @var string */ - protected static $openAPIModelName = 'GeneratedAssetResponseAttributes'; + protected static $openAPIModelName = 'ShapeAsset'; /** * Array of property to type mappings. Used for (de)serialization @@ -58,13 +58,15 @@ class GeneratedAssetResponseAttributes implements ModelInterface, ArrayAccess, \ * @var string[] */ protected static $openAPITypes = [ - 'owner' => 'string', - 'provider' => 'string', 'type' => 'string', - 'url' => 'string', - 'status' => 'string', - 'created' => 'string', - 'updated' => 'string' + 'shape' => 'string', + 'width' => 'int', + 'height' => 'int', + 'fill' => '\ShotstackClient\Model\ShapeAssetFill', + 'stroke' => '\ShotstackClient\Model\ShapeAssetStroke', + 'rectangle' => '\ShotstackClient\Model\ShapeAssetRectangle', + 'circle' => '\ShotstackClient\Model\ShapeAssetCircle', + 'line' => '\ShotstackClient\Model\ShapeAssetLine' ]; /** @@ -75,13 +77,15 @@ class GeneratedAssetResponseAttributes implements ModelInterface, ArrayAccess, \ * @psalm-var array */ protected static $openAPIFormats = [ - 'owner' => null, - 'provider' => null, 'type' => null, - 'url' => null, - 'status' => null, - 'created' => null, - 'updated' => null + 'shape' => null, + 'width' => null, + 'height' => null, + 'fill' => null, + 'stroke' => null, + 'rectangle' => null, + 'circle' => null, + 'line' => null ]; /** @@ -90,13 +94,15 @@ class GeneratedAssetResponseAttributes implements ModelInterface, ArrayAccess, \ * @var boolean[] */ protected static array $openAPINullables = [ - 'owner' => false, - 'provider' => false, 'type' => false, - 'url' => false, - 'status' => false, - 'created' => false, - 'updated' => false + 'shape' => false, + 'width' => false, + 'height' => false, + 'fill' => false, + 'stroke' => false, + 'rectangle' => false, + 'circle' => false, + 'line' => false ]; /** @@ -185,13 +191,15 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'owner' => 'owner', - 'provider' => 'provider', 'type' => 'type', - 'url' => 'url', - 'status' => 'status', - 'created' => 'created', - 'updated' => 'updated' + 'shape' => 'shape', + 'width' => 'width', + 'height' => 'height', + 'fill' => 'fill', + 'stroke' => 'stroke', + 'rectangle' => 'rectangle', + 'circle' => 'circle', + 'line' => 'line' ]; /** @@ -200,13 +208,15 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'owner' => 'setOwner', - 'provider' => 'setProvider', 'type' => 'setType', - 'url' => 'setUrl', - 'status' => 'setStatus', - 'created' => 'setCreated', - 'updated' => 'setUpdated' + 'shape' => 'setShape', + 'width' => 'setWidth', + 'height' => 'setHeight', + 'fill' => 'setFill', + 'stroke' => 'setStroke', + 'rectangle' => 'setRectangle', + 'circle' => 'setCircle', + 'line' => 'setLine' ]; /** @@ -215,13 +225,15 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'owner' => 'getOwner', - 'provider' => 'getProvider', 'type' => 'getType', - 'url' => 'getUrl', - 'status' => 'getStatus', - 'created' => 'getCreated', - 'updated' => 'getUpdated' + 'shape' => 'getShape', + 'width' => 'getWidth', + 'height' => 'getHeight', + 'fill' => 'getFill', + 'stroke' => 'getStroke', + 'rectangle' => 'getRectangle', + 'circle' => 'getCircle', + 'line' => 'getLine' ]; /** @@ -265,32 +277,10 @@ public function getModelName() return self::$openAPIModelName; } - public const PROVIDER_SHOTSTACK = 'shotstack'; - public const PROVIDER_ELEVENLABS = 'elevenlabs'; - public const PROVIDER_HEYGEN = 'heygen'; - public const PROVIDER_D_ID = 'd-id'; - public const TYPE_SPEECH = 'text-to-speech'; - public const TYPE_AVATAR = 'text-to-avatar'; - public const STATUS_QUEUED = 'queued'; - public const STATUS_PROCESSING = 'processing'; - public const STATUS_SAVING = 'saving'; - public const STATUS_DONE = 'done'; - public const STATUS_FAILED = 'failed'; - - /** - * Gets allowable values of the enum - * - * @return string[] - */ - public function getProviderAllowableValues() - { - return [ - self::PROVIDER_SHOTSTACK, - self::PROVIDER_ELEVENLABS, - self::PROVIDER_HEYGEN, - self::PROVIDER_D_ID, - ]; - } + public const TYPE_SHAPE = 'shape'; + public const SHAPE_RECTANGLE = 'rectangle'; + public const SHAPE_CIRCLE = 'circle'; + public const SHAPE_LINE = 'line'; /** * Gets allowable values of the enum @@ -300,8 +290,7 @@ public function getProviderAllowableValues() public function getTypeAllowableValues() { return [ - self::TYPE_SPEECH, - self::TYPE_AVATAR, + self::TYPE_SHAPE, ]; } @@ -310,14 +299,12 @@ public function getTypeAllowableValues() * * @return string[] */ - public function getStatusAllowableValues() + public function getShapeAllowableValues() { return [ - self::STATUS_QUEUED, - self::STATUS_PROCESSING, - self::STATUS_SAVING, - self::STATUS_DONE, - self::STATUS_FAILED, + self::SHAPE_RECTANGLE, + self::SHAPE_CIRCLE, + self::SHAPE_LINE, ]; } @@ -336,13 +323,15 @@ public function getStatusAllowableValues() */ public function __construct(array $data = null) { - $this->setIfExists('owner', $data ?? [], null); - $this->setIfExists('provider', $data ?? [], null); - $this->setIfExists('type', $data ?? [], null); - $this->setIfExists('url', $data ?? [], null); - $this->setIfExists('status', $data ?? [], null); - $this->setIfExists('created', $data ?? [], null); - $this->setIfExists('updated', $data ?? [], null); + $this->setIfExists('type', $data ?? [], 'shape'); + $this->setIfExists('shape', $data ?? [], null); + $this->setIfExists('width', $data ?? [], null); + $this->setIfExists('height', $data ?? [], null); + $this->setIfExists('fill', $data ?? [], null); + $this->setIfExists('stroke', $data ?? [], null); + $this->setIfExists('rectangle', $data ?? [], null); + $this->setIfExists('circle', $data ?? [], null); + $this->setIfExists('line', $data ?? [], null); } /** @@ -372,21 +361,6 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['owner'] === null) { - $invalidProperties[] = "'owner' can't be null"; - } - if ($this->container['provider'] === null) { - $invalidProperties[] = "'provider' can't be null"; - } - $allowedValues = $this->getProviderAllowableValues(); - if (!is_null($this->container['provider']) && !in_array($this->container['provider'], $allowedValues, true)) { - $invalidProperties[] = sprintf( - "invalid value '%s' for 'provider', must be one of '%s'", - $this->container['provider'], - implode("', '", $allowedValues) - ); - } - if ($this->container['type'] === null) { $invalidProperties[] = "'type' can't be null"; } @@ -399,24 +373,18 @@ public function listInvalidProperties() ); } - if ($this->container['status'] === null) { - $invalidProperties[] = "'status' can't be null"; + if ($this->container['shape'] === null) { + $invalidProperties[] = "'shape' can't be null"; } - $allowedValues = $this->getStatusAllowableValues(); - if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) { + $allowedValues = $this->getShapeAllowableValues(); + if (!is_null($this->container['shape']) && !in_array($this->container['shape'], $allowedValues, true)) { $invalidProperties[] = sprintf( - "invalid value '%s' for 'status', must be one of '%s'", - $this->container['status'], + "invalid value '%s' for 'shape', must be one of '%s'", + $this->container['shape'], implode("', '", $allowedValues) ); } - if ($this->container['created'] === null) { - $invalidProperties[] = "'created' can't be null"; - } - if ($this->container['updated'] === null) { - $invalidProperties[] = "'updated' can't be null"; - } return $invalidProperties; } @@ -433,220 +401,264 @@ public function valid() /** - * Gets owner + * Gets type * * @return string */ - public function getOwner() + public function getType() { - return $this->container['owner']; + return $this->container['type']; } /** - * Sets owner + * Sets type * - * @param string $owner The owner id of the asset. + * @param string $type The type of asset - set to `shape` for shape. * * @return self */ - public function setOwner($owner) + public function setType($type) { - if (is_null($owner)) { - throw new \InvalidArgumentException('non-nullable owner cannot be null'); + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); } - $this->container['owner'] = $owner; + $this->container['type'] = $type; return $this; } /** - * Gets provider + * Gets shape * * @return string */ - public function getProvider() + public function getShape() { - return $this->container['provider']; + return $this->container['shape']; } /** - * Sets provider + * Sets shape * - * @param string $provider The native or third party provider that generated the asset, `shotstack`, `elevenlabs`, `heygen` or `d-id`. + * @param string $shape The shape to display. * * @return self */ - public function setProvider($provider) + public function setShape($shape) { - if (is_null($provider)) { - throw new \InvalidArgumentException('non-nullable provider cannot be null'); + if (is_null($shape)) { + throw new \InvalidArgumentException('non-nullable shape cannot be null'); } - $allowedValues = $this->getProviderAllowableValues(); - if (!in_array($provider, $allowedValues, true)) { + $allowedValues = $this->getShapeAllowableValues(); + if (!in_array($shape, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( - "Invalid value '%s' for 'provider', must be one of '%s'", - $provider, + "Invalid value '%s' for 'shape', must be one of '%s'", + $shape, implode("', '", $allowedValues) ) ); } - $this->container['provider'] = $provider; + $this->container['shape'] = $shape; return $this; } /** - * Gets type + * Gets width * - * @return string + * @return int|null */ - public function getType() + public function getWidth() { - return $this->container['type']; + return $this->container['width']; } /** - * Sets type + * Sets width * - * @param string $type The type of service used to generate the asset, `text-to-speech` or `text-to-avatar`. + * @param int|null $width Sets the width of the bounding box in pixels. This value should be larger than the shape's width. If omitted, the entire viewport width and height will be used. * * @return self */ - public function setType($type) + public function setWidth($width) { - if (is_null($type)) { - throw new \InvalidArgumentException('non-nullable type cannot be null'); + if (is_null($width)) { + throw new \InvalidArgumentException('non-nullable width cannot be null'); } - $allowedValues = $this->getTypeAllowableValues(); - if (!in_array($type, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value '%s' for 'type', must be one of '%s'", - $type, - implode("', '", $allowedValues) - ) - ); + $this->container['width'] = $width; + + return $this; + } + + /** + * Gets height + * + * @return int|null + */ + public function getHeight() + { + return $this->container['height']; + } + + /** + * Sets height + * + * @param int|null $height Sets the height of the bounding box in pixels. This value should be larger than the shape's height. If omitted, the entire viewport width and height will be used. + * + * @return self + */ + public function setHeight($height) + { + if (is_null($height)) { + throw new \InvalidArgumentException('non-nullable height cannot be null'); } - $this->container['type'] = $type; + $this->container['height'] = $height; return $this; } /** - * Gets url + * Gets fill * - * @return string|null + * @return \ShotstackClient\Model\ShapeAssetFill|null */ - public function getUrl() + public function getFill() { - return $this->container['url']; + return $this->container['fill']; } /** - * Sets url + * Sets fill * - * @param string|null $url The URL of the asset file hosted by Shotstack. The file at the URL can be used by the Edit API. Generated asset file URL's consist of a base URL (AWS bucket), owner id, asset id and extension. The extension varies depending on the type of file generated. + * @param \ShotstackClient\Model\ShapeAssetFill|null $fill fill * * @return self */ - public function setUrl($url) + public function setFill($fill) { - if (is_null($url)) { - throw new \InvalidArgumentException('non-nullable url cannot be null'); + if (is_null($fill)) { + throw new \InvalidArgumentException('non-nullable fill cannot be null'); } - $this->container['url'] = $url; + $this->container['fill'] = $fill; return $this; } /** - * Gets status + * Gets stroke * - * @return string + * @return \ShotstackClient\Model\ShapeAssetStroke|null */ - public function getStatus() + public function getStroke() { - return $this->container['status']; + return $this->container['stroke']; } /** - * Sets status + * Sets stroke * - * @param string $status The status of the asset file generation task.
  • `queued` - generation task is queued waiting to be processed
  • `processing` - the asset is being generated by the provider
  • `saving` - the asset is being saved to Shotstack
  • `done` - the asset has been generated and stored
  • `failed` - there was an error generating the asset
+ * @param \ShotstackClient\Model\ShapeAssetStroke|null $stroke stroke * * @return self */ - public function setStatus($status) + public function setStroke($stroke) { - if (is_null($status)) { - throw new \InvalidArgumentException('non-nullable status cannot be null'); + if (is_null($stroke)) { + throw new \InvalidArgumentException('non-nullable stroke cannot be null'); } - $allowedValues = $this->getStatusAllowableValues(); - if (!in_array($status, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value '%s' for 'status', must be one of '%s'", - $status, - implode("', '", $allowedValues) - ) - ); + $this->container['stroke'] = $stroke; + + return $this; + } + + /** + * Gets rectangle + * + * @return \ShotstackClient\Model\ShapeAssetRectangle|null + */ + public function getRectangle() + { + return $this->container['rectangle']; + } + + /** + * Sets rectangle + * + * @param \ShotstackClient\Model\ShapeAssetRectangle|null $rectangle rectangle + * + * @return self + */ + public function setRectangle($rectangle) + { + if (is_null($rectangle)) { + throw new \InvalidArgumentException('non-nullable rectangle cannot be null'); } - $this->container['status'] = $status; + $this->container['rectangle'] = $rectangle; return $this; } /** - * Gets created + * Gets circle * - * @return string + * @return \ShotstackClient\Model\ShapeAssetCircle|null */ - public function getCreated() + public function getCircle() { - return $this->container['created']; + return $this->container['circle']; } /** - * Sets created + * Sets circle * - * @param string $created The time the generate asset task was initially queued. + * @param \ShotstackClient\Model\ShapeAssetCircle|null $circle circle * * @return self */ - public function setCreated($created) + public function setCircle($circle) { - if (is_null($created)) { - throw new \InvalidArgumentException('non-nullable created cannot be null'); + if (is_null($circle)) { + throw new \InvalidArgumentException('non-nullable circle cannot be null'); } - $this->container['created'] = $created; + $this->container['circle'] = $circle; return $this; } /** - * Gets updated + * Gets line * - * @return string + * @return \ShotstackClient\Model\ShapeAssetLine|null */ - public function getUpdated() + public function getLine() { - return $this->container['updated']; + return $this->container['line']; } /** - * Sets updated + * Sets line * - * @param string $updated The time the asset status was last updated. + * @param \ShotstackClient\Model\ShapeAssetLine|null $line line * * @return self */ - public function setUpdated($updated) + public function setLine($line) { - if (is_null($updated)) { - throw new \InvalidArgumentException('non-nullable updated cannot be null'); + if (is_null($line)) { + throw new \InvalidArgumentException('non-nullable line cannot be null'); } - $this->container['updated'] = $updated; + $this->container['line'] = $line; return $this; } diff --git a/src/Model/GeneratedAssetErrorResponse.php b/src/Model/ShapeAssetCircle.php similarity index 86% rename from src/Model/GeneratedAssetErrorResponse.php rename to src/Model/ShapeAssetCircle.php index 63d01d5..7b8fd7d 100644 --- a/src/Model/GeneratedAssetErrorResponse.php +++ b/src/Model/ShapeAssetCircle.php @@ -1,11 +1,11 @@ */ -class GeneratedAssetErrorResponse implements ModelInterface, ArrayAccess, \JsonSerializable +class ShapeAssetCircle implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; @@ -50,7 +50,7 @@ class GeneratedAssetErrorResponse implements ModelInterface, ArrayAccess, \JsonS * * @var string */ - protected static $openAPIModelName = 'GeneratedAssetErrorResponse'; + protected static $openAPIModelName = 'ShapeAsset_circle'; /** * Array of property to type mappings. Used for (de)serialization @@ -58,7 +58,7 @@ class GeneratedAssetErrorResponse implements ModelInterface, ArrayAccess, \JsonS * @var string[] */ protected static $openAPITypes = [ - 'errors' => '\Shotstack\Client\Model\GeneratedAssetErrorResponseData[]' + 'radius' => 'int' ]; /** @@ -69,7 +69,7 @@ class GeneratedAssetErrorResponse implements ModelInterface, ArrayAccess, \JsonS * @psalm-var array */ protected static $openAPIFormats = [ - 'errors' => null + 'radius' => null ]; /** @@ -78,7 +78,7 @@ class GeneratedAssetErrorResponse implements ModelInterface, ArrayAccess, \JsonS * @var boolean[] */ protected static array $openAPINullables = [ - 'errors' => false + 'radius' => false ]; /** @@ -167,7 +167,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'errors' => 'errors' + 'radius' => 'radius' ]; /** @@ -176,7 +176,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'errors' => 'setErrors' + 'radius' => 'setRadius' ]; /** @@ -185,7 +185,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'errors' => 'getErrors' + 'radius' => 'getRadius' ]; /** @@ -245,7 +245,7 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->setIfExists('errors', $data ?? [], null); + $this->setIfExists('radius', $data ?? [], null); } /** @@ -275,8 +275,8 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['errors'] === null) { - $invalidProperties[] = "'errors' can't be null"; + if ($this->container['radius'] === null) { + $invalidProperties[] = "'radius' can't be null"; } return $invalidProperties; } @@ -294,28 +294,28 @@ public function valid() /** - * Gets errors + * Gets radius * - * @return \Shotstack\Client\Model\GeneratedAssetErrorResponseData[] + * @return int */ - public function getErrors() + public function getRadius() { - return $this->container['errors']; + return $this->container['radius']; } /** - * Sets errors + * Sets radius * - * @param \Shotstack\Client\Model\GeneratedAssetErrorResponseData[] $errors An array of errors. + * @param int $radius Set the radius of the circle shape in pixels. * * @return self */ - public function setErrors($errors) + public function setRadius($radius) { - if (is_null($errors)) { - throw new \InvalidArgumentException('non-nullable errors cannot be null'); + if (is_null($radius)) { + throw new \InvalidArgumentException('non-nullable radius cannot be null'); } - $this->container['errors'] = $errors; + $this->container['radius'] = $radius; return $this; } diff --git a/src/Model/ShapeAssetFill.php b/src/Model/ShapeAssetFill.php new file mode 100644 index 0000000..6440c91 --- /dev/null +++ b/src/Model/ShapeAssetFill.php @@ -0,0 +1,444 @@ + + */ +class ShapeAssetFill implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ShapeAsset_fill'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'color' => 'string', + 'opacity' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'color' => null, + 'opacity' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'color' => false, + 'opacity' => 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; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $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 = [ + 'color' => 'color', + 'opacity' => 'opacity' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'color' => 'setColor', + 'opacity' => 'setOpacity' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'color' => 'getColor', + 'opacity' => 'getOpacity' + ]; + + /** + * 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) + { + $this->setIfExists('color', $data ?? [], null); + $this->setIfExists('opacity', $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 = []; + + 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 color + * + * @return string|null + */ + public function getColor() + { + return $this->container['color']; + } + + /** + * Sets color + * + * @param string|null $color The color of the fill using hexadecimal color notation. + * + * @return self + */ + public function setColor($color) + { + if (is_null($color)) { + throw new \InvalidArgumentException('non-nullable color cannot be null'); + } + $this->container['color'] = $color; + + return $this; + } + + /** + * Gets opacity + * + * @return float|null + */ + public function getOpacity() + { + return $this->container['opacity']; + } + + /** + * Sets opacity + * + * @param float|null $opacity The opacity of the fill where 1 is opaque and 0 is transparent. + * + * @return self + */ + public function setOpacity($opacity) + { + if (is_null($opacity)) { + throw new \InvalidArgumentException('non-nullable opacity cannot be null'); + } + $this->container['opacity'] = $opacity; + + 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() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ShapeAssetLine.php b/src/Model/ShapeAssetLine.php new file mode 100644 index 0000000..2382509 --- /dev/null +++ b/src/Model/ShapeAssetLine.php @@ -0,0 +1,450 @@ + + */ +class ShapeAssetLine implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ShapeAsset_line'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'length' => 'int', + 'thickness' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'length' => null, + 'thickness' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'length' => false, + 'thickness' => 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; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $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 = [ + 'length' => 'length', + 'thickness' => 'thickness' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'length' => 'setLength', + 'thickness' => 'setThickness' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'length' => 'getLength', + 'thickness' => 'getThickness' + ]; + + /** + * 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) + { + $this->setIfExists('length', $data ?? [], null); + $this->setIfExists('thickness', $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 ($this->container['length'] === null) { + $invalidProperties[] = "'length' can't be null"; + } + if ($this->container['thickness'] === null) { + $invalidProperties[] = "'thickness' can't be null"; + } + 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 length + * + * @return int + */ + public function getLength() + { + return $this->container['length']; + } + + /** + * Sets length + * + * @param int $length Set the length of the line shape in pixels. + * + * @return self + */ + public function setLength($length) + { + if (is_null($length)) { + throw new \InvalidArgumentException('non-nullable length cannot be null'); + } + $this->container['length'] = $length; + + return $this; + } + + /** + * Gets thickness + * + * @return int + */ + public function getThickness() + { + return $this->container['thickness']; + } + + /** + * Sets thickness + * + * @param int $thickness Set the thickness of the line in pixels. + * + * @return self + */ + public function setThickness($thickness) + { + if (is_null($thickness)) { + throw new \InvalidArgumentException('non-nullable thickness cannot be null'); + } + $this->container['thickness'] = $thickness; + + 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() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/GeneratedAssetResponseData.php b/src/Model/ShapeAssetRectangle.php similarity index 75% rename from src/Model/GeneratedAssetResponseData.php rename to src/Model/ShapeAssetRectangle.php index 5e8ff87..0a55e13 100644 --- a/src/Model/GeneratedAssetResponseData.php +++ b/src/Model/ShapeAssetRectangle.php @@ -1,11 +1,11 @@ */ -class GeneratedAssetResponseData implements ModelInterface, ArrayAccess, \JsonSerializable +class ShapeAssetRectangle implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; @@ -50,7 +50,7 @@ class GeneratedAssetResponseData implements ModelInterface, ArrayAccess, \JsonSe * * @var string */ - protected static $openAPIModelName = 'GeneratedAssetResponseData'; + protected static $openAPIModelName = 'ShapeAsset_rectangle'; /** * Array of property to type mappings. Used for (de)serialization @@ -58,9 +58,9 @@ class GeneratedAssetResponseData implements ModelInterface, ArrayAccess, \JsonSe * @var string[] */ protected static $openAPITypes = [ - 'type' => 'string', - 'id' => 'string', - 'attributes' => '\Shotstack\Client\Model\GeneratedAssetResponseAttributes' + 'width' => 'int', + 'height' => 'int', + 'corner_radius' => 'int' ]; /** @@ -71,9 +71,9 @@ class GeneratedAssetResponseData implements ModelInterface, ArrayAccess, \JsonSe * @psalm-var array */ protected static $openAPIFormats = [ - 'type' => null, - 'id' => null, - 'attributes' => null + 'width' => null, + 'height' => null, + 'corner_radius' => null ]; /** @@ -82,9 +82,9 @@ class GeneratedAssetResponseData implements ModelInterface, ArrayAccess, \JsonSe * @var boolean[] */ protected static array $openAPINullables = [ - 'type' => false, - 'id' => false, - 'attributes' => false + 'width' => false, + 'height' => false, + 'corner_radius' => false ]; /** @@ -173,9 +173,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'type' => 'type', - 'id' => 'id', - 'attributes' => 'attributes' + 'width' => 'width', + 'height' => 'height', + 'corner_radius' => 'cornerRadius' ]; /** @@ -184,9 +184,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'type' => 'setType', - 'id' => 'setId', - 'attributes' => 'setAttributes' + 'width' => 'setWidth', + 'height' => 'setHeight', + 'corner_radius' => 'setCornerRadius' ]; /** @@ -195,9 +195,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'type' => 'getType', - 'id' => 'getId', - 'attributes' => 'getAttributes' + 'width' => 'getWidth', + 'height' => 'getHeight', + 'corner_radius' => 'getCornerRadius' ]; /** @@ -257,9 +257,9 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->setIfExists('type', $data ?? [], null); - $this->setIfExists('id', $data ?? [], null); - $this->setIfExists('attributes', $data ?? [], null); + $this->setIfExists('width', $data ?? [], null); + $this->setIfExists('height', $data ?? [], null); + $this->setIfExists('corner_radius', $data ?? [], null); } /** @@ -289,14 +289,11 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['type'] === null) { - $invalidProperties[] = "'type' can't be null"; + if ($this->container['width'] === null) { + $invalidProperties[] = "'width' can't be null"; } - if ($this->container['id'] === null) { - $invalidProperties[] = "'id' can't be null"; - } - if ($this->container['attributes'] === null) { - $invalidProperties[] = "'attributes' can't be null"; + if ($this->container['height'] === null) { + $invalidProperties[] = "'height' can't be null"; } return $invalidProperties; } @@ -314,82 +311,82 @@ public function valid() /** - * Gets type + * Gets width * - * @return string + * @return int */ - public function getType() + public function getWidth() { - return $this->container['type']; + return $this->container['width']; } /** - * Sets type + * Sets width * - * @param string $type The type of resource, in this case it is an asset. + * @param int $width Set the width of the rectangle shape in pixels. * * @return self */ - public function setType($type) + public function setWidth($width) { - if (is_null($type)) { - throw new \InvalidArgumentException('non-nullable type cannot be null'); + if (is_null($width)) { + throw new \InvalidArgumentException('non-nullable width cannot be null'); } - $this->container['type'] = $type; + $this->container['width'] = $width; return $this; } /** - * Gets id + * Gets height * - * @return string + * @return int */ - public function getId() + public function getHeight() { - return $this->container['id']; + return $this->container['height']; } /** - * Sets id + * Sets height * - * @param string $id The generated asset id. + * @param int $height Set the height of the rectangle shape in pixels. * * @return self */ - public function setId($id) + public function setHeight($height) { - if (is_null($id)) { - throw new \InvalidArgumentException('non-nullable id cannot be null'); + if (is_null($height)) { + throw new \InvalidArgumentException('non-nullable height cannot be null'); } - $this->container['id'] = $id; + $this->container['height'] = $height; return $this; } /** - * Gets attributes + * Gets corner_radius * - * @return \Shotstack\Client\Model\GeneratedAssetResponseAttributes + * @return int|null */ - public function getAttributes() + public function getCornerRadius() { - return $this->container['attributes']; + return $this->container['corner_radius']; } /** - * Sets attributes + * Sets corner_radius * - * @param \Shotstack\Client\Model\GeneratedAssetResponseAttributes $attributes attributes + * @param int|null $corner_radius Set the corner radius of the rectangle shape. * * @return self */ - public function setAttributes($attributes) + public function setCornerRadius($corner_radius) { - if (is_null($attributes)) { - throw new \InvalidArgumentException('non-nullable attributes cannot be null'); + if (is_null($corner_radius)) { + throw new \InvalidArgumentException('non-nullable corner_radius cannot be null'); } - $this->container['attributes'] = $attributes; + $this->container['corner_radius'] = $corner_radius; return $this; } diff --git a/src/Model/ShapeAssetStroke.php b/src/Model/ShapeAssetStroke.php new file mode 100644 index 0000000..c3c375e --- /dev/null +++ b/src/Model/ShapeAssetStroke.php @@ -0,0 +1,444 @@ + + */ +class ShapeAssetStroke implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ShapeAsset_stroke'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'color' => 'string', + 'width' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'color' => null, + 'width' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'color' => false, + 'width' => 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; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $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 = [ + 'color' => 'color', + 'width' => 'width' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'color' => 'setColor', + 'width' => 'setWidth' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'color' => 'getColor', + 'width' => 'getWidth' + ]; + + /** + * 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) + { + $this->setIfExists('color', $data ?? [], null); + $this->setIfExists('width', $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 = []; + + 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 color + * + * @return string|null + */ + public function getColor() + { + return $this->container['color']; + } + + /** + * Sets color + * + * @param string|null $color The stroke color of the font using hexadecimal color notation. + * + * @return self + */ + public function setColor($color) + { + if (is_null($color)) { + throw new \InvalidArgumentException('non-nullable color cannot be null'); + } + $this->container['color'] = $color; + + return $this; + } + + /** + * Gets width + * + * @return float|null + */ + public function getWidth() + { + return $this->container['width']; + } + + /** + * Sets width + * + * @param float|null $width The width of the stroke 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; + } + /** + * 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() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ShotstackDestination.php b/src/Model/ShotstackDestination.php index 5100b85..fd909b4 100644 --- a/src/Model/ShotstackDestination.php +++ b/src/Model/ShotstackDestination.php @@ -5,7 +5,7 @@ * PHP version 7.4 * * @category Class - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech */ @@ -26,17 +26,17 @@ * Do not edit the class manually. */ -namespace Shotstack\Client\Model; +namespace ShotstackClient\Model; use \ArrayAccess; -use \Shotstack\Client\ObjectSerializer; +use \ShotstackClient\ObjectSerializer; /** * ShotstackDestination Class Doc Comment * * @category Class * @description Send videos and assets to the [Shotstack hosting and CDN](https://shotstack.io/docs/guide/serving-assets/destinations/shotstack/) service. This destination is enabled by default. - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech * @implements \ArrayAccess diff --git a/src/Model/ShotstackGeneratedAssetOptions.php b/src/Model/ShotstackGeneratedAssetOptions.php deleted file mode 100644 index 9ed97a6..0000000 --- a/src/Model/ShotstackGeneratedAssetOptions.php +++ /dev/null @@ -1,1044 +0,0 @@ - - */ -class ShotstackGeneratedAssetOptions implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = 'type'; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'ShotstackGeneratedAssetOptions'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'type' => 'string', - 'text' => 'string', - 'voice' => 'string', - 'language' => 'string', - 'newscaster' => 'bool', - 'prompt' => 'string', - 'width' => 'int', - 'height' => 'int', - 'image_url' => 'string', - 'guidance_scale' => 'float', - 'motion' => 'int' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'type' => null, - 'text' => null, - 'voice' => null, - 'language' => null, - 'newscaster' => null, - 'prompt' => null, - 'width' => null, - 'height' => null, - 'image_url' => null, - 'guidance_scale' => null, - 'motion' => null - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static array $openAPINullables = [ - 'type' => false, - 'text' => false, - 'voice' => false, - 'language' => false, - 'newscaster' => false, - 'prompt' => false, - 'width' => false, - 'height' => false, - 'image_url' => false, - 'guidance_scale' => false, - 'motion' => 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; - } - - /** - * Setter - Array of nullable field names deliberately set to null - * - * @param boolean[] $openAPINullablesSetToNull - */ - private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void - { - $this->openAPINullablesSetToNull = $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 = [ - 'type' => 'type', - 'text' => 'text', - 'voice' => 'voice', - 'language' => 'language', - 'newscaster' => 'newscaster', - 'prompt' => 'prompt', - 'width' => 'width', - 'height' => 'height', - 'image_url' => 'imageUrl', - 'guidance_scale' => 'guidanceScale', - 'motion' => 'motion' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'type' => 'setType', - 'text' => 'setText', - 'voice' => 'setVoice', - 'language' => 'setLanguage', - 'newscaster' => 'setNewscaster', - 'prompt' => 'setPrompt', - 'width' => 'setWidth', - 'height' => 'setHeight', - 'image_url' => 'setImageUrl', - 'guidance_scale' => 'setGuidanceScale', - 'motion' => 'setMotion' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'type' => 'getType', - 'text' => 'getText', - 'voice' => 'getVoice', - 'language' => 'getLanguage', - 'newscaster' => 'getNewscaster', - 'prompt' => 'getPrompt', - 'width' => 'getWidth', - 'height' => 'getHeight', - 'image_url' => 'getImageUrl', - 'guidance_scale' => 'getGuidanceScale', - 'motion' => 'getMotion' - ]; - - /** - * 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 TYPE_TEXT_TO_SPEECH = 'text-to-speech'; - public const TYPE_TEXT_TO_IMAGE = 'text-to-image'; - public const TYPE_TEXT_GENERATOR = 'text-generator'; - public const TYPE_IMAGE_TO_VIDEO = 'image-to-video'; - public const VOICE_HALA = 'Hala'; - public const VOICE_LISA = 'Lisa'; - public const VOICE_ARLET = 'Arlet'; - public const VOICE_HIUJIN = 'Hiujin'; - public const VOICE_ZHIYU = 'Zhiyu'; - public const VOICE_SOFIE = 'Sofie'; - public const VOICE_LAURA = 'Laura'; - public const VOICE_OLIVIA = 'Olivia'; - public const VOICE_AMY = 'Amy'; - public const VOICE_EMMA = 'Emma'; - public const VOICE_BRIAN = 'Brian'; - public const VOICE_ARTHUR = 'Arthur'; - public const VOICE_KAJAL = 'Kajal'; - public const VOICE_NIAMH = 'Niamh'; - public const VOICE_ARIA = 'Aria'; - public const VOICE_AYANDA = 'Ayanda'; - public const VOICE_IVY = 'Ivy'; - public const VOICE_JOANNA = 'Joanna'; - public const VOICE_KENDRA = 'Kendra'; - public const VOICE_KIMBERLY = 'Kimberly'; - public const VOICE_SALLI = 'Salli'; - public const VOICE_JOEY = 'Joey'; - public const VOICE_JUSTIN = 'Justin'; - public const VOICE_KEVIN = 'Kevin'; - public const VOICE_MATTHEW = 'Matthew'; - public const VOICE_RUTH = 'Ruth'; - public const VOICE_STEPHEN = 'Stephen'; - public const VOICE_SUVI = 'Suvi'; - public const VOICE_LA = 'Léa'; - public const VOICE_RMI = 'Rémi'; - public const VOICE_GABRIELLE = 'Gabrielle'; - public const VOICE_LIAM = 'Liam'; - public const VOICE_VICKI = 'Vicki'; - public const VOICE_DANIEL = 'Daniel'; - public const VOICE_HANNAH = 'Hannah'; - public const VOICE_KAJAL2 = 'Kajal'; - public const VOICE_BIANCA = 'Bianca'; - public const VOICE_ADRIANO = 'Adriano'; - public const VOICE_TAKUMI = 'Takumi'; - public const VOICE_KAZUHA = 'Kazuha'; - public const VOICE_TOMOKO = 'Tomoko'; - public const VOICE_SEOYEON = 'Seoyeon'; - public const VOICE_IDA = 'Ida'; - public const VOICE_OLA = 'Ola'; - public const VOICE_CAMILA = 'Camila'; - public const VOICE_VITRIA = 'Vitória'; - public const VOICE_VITORIA = 'Vitoria'; - public const VOICE_THIAGO = 'Thiago'; - public const VOICE_INS = 'Inês'; - public const VOICE_INES = 'Ines'; - public const VOICE_LUCIA = 'Lucia'; - public const VOICE_SERGIO = 'Sergio'; - public const VOICE_MIA = 'Mia'; - public const VOICE_ANDRS = 'Andrés'; - public const VOICE_LUPE = 'Lupe'; - public const VOICE_PEDRO = 'Pedro'; - public const VOICE_ELIN = 'Elin'; - public const LANGUAGE_CMN_CN = 'cmn-CN'; - public const LANGUAGE_DA_DK = 'da-DK'; - public const LANGUAGE_DE_DE = 'de-DE'; - public const LANGUAGE_EN_AU = 'en-AU'; - public const LANGUAGE_EN_GB = 'en-GB'; - public const LANGUAGE_EN_IN = 'en-IN'; - public const LANGUAGE_EN_US = 'en-US'; - public const LANGUAGE_ES_ES = 'es-ES'; - public const LANGUAGE_ES_MX = 'es-MX'; - public const LANGUAGE_ES_US = 'es-US'; - public const LANGUAGE_FR_CA = 'fr-CA'; - public const LANGUAGE_FR_FR = 'fr-FR'; - public const LANGUAGE_IT_IT = 'it-IT'; - public const LANGUAGE_JA_JP = 'ja-JP'; - public const LANGUAGE_HI_IN = 'hi-IN'; - public const LANGUAGE_KO_KR = 'ko-KR'; - public const LANGUAGE_NB_NO = 'nb-NO'; - public const LANGUAGE_NL_NL = 'nl-NL'; - public const LANGUAGE_PL_PL = 'pl-PL'; - public const LANGUAGE_PT_BR = 'pt-BR'; - public const LANGUAGE_PT_PT = 'pt-PT'; - public const LANGUAGE_SV_SE = 'sv-SE'; - public const LANGUAGE_EN_NZ = 'en-NZ'; - public const LANGUAGE_EN_ZA = 'en-ZA'; - public const LANGUAGE_CA_ES = 'ca-ES'; - public const LANGUAGE_DE_AT = 'de-AT'; - public const LANGUAGE_YUE_CN = 'yue-CN'; - public const LANGUAGE_AR_AE = 'ar-AE'; - public const LANGUAGE_FI_FI = 'fi-FI'; - - /** - * Gets allowable values of the enum - * - * @return string[] - */ - public function getTypeAllowableValues() - { - return [ - self::TYPE_TEXT_TO_SPEECH, - self::TYPE_TEXT_TO_IMAGE, - self::TYPE_TEXT_GENERATOR, - self::TYPE_IMAGE_TO_VIDEO, - ]; - } - - /** - * Gets allowable values of the enum - * - * @return string[] - */ - public function getVoiceAllowableValues() - { - return [ - self::VOICE_HALA, - self::VOICE_LISA, - self::VOICE_ARLET, - self::VOICE_HIUJIN, - self::VOICE_ZHIYU, - self::VOICE_SOFIE, - self::VOICE_LAURA, - self::VOICE_OLIVIA, - self::VOICE_AMY, - self::VOICE_EMMA, - self::VOICE_BRIAN, - self::VOICE_ARTHUR, - self::VOICE_KAJAL, - self::VOICE_NIAMH, - self::VOICE_ARIA, - self::VOICE_AYANDA, - self::VOICE_IVY, - self::VOICE_JOANNA, - self::VOICE_KENDRA, - self::VOICE_KIMBERLY, - self::VOICE_SALLI, - self::VOICE_JOEY, - self::VOICE_JUSTIN, - self::VOICE_KEVIN, - self::VOICE_MATTHEW, - self::VOICE_RUTH, - self::VOICE_STEPHEN, - self::VOICE_SUVI, - self::VOICE_LA, - self::VOICE_RMI, - self::VOICE_GABRIELLE, - self::VOICE_LIAM, - self::VOICE_VICKI, - self::VOICE_DANIEL, - self::VOICE_HANNAH, - self::VOICE_KAJAL2, - self::VOICE_BIANCA, - self::VOICE_ADRIANO, - self::VOICE_TAKUMI, - self::VOICE_KAZUHA, - self::VOICE_TOMOKO, - self::VOICE_SEOYEON, - self::VOICE_IDA, - self::VOICE_OLA, - self::VOICE_CAMILA, - self::VOICE_VITRIA, - self::VOICE_VITORIA, - self::VOICE_THIAGO, - self::VOICE_INS, - self::VOICE_INES, - self::VOICE_LUCIA, - self::VOICE_SERGIO, - self::VOICE_MIA, - self::VOICE_ANDRS, - self::VOICE_LUPE, - self::VOICE_PEDRO, - self::VOICE_ELIN, - ]; - } - - /** - * Gets allowable values of the enum - * - * @return string[] - */ - public function getLanguageAllowableValues() - { - return [ - self::LANGUAGE_CMN_CN, - self::LANGUAGE_DA_DK, - self::LANGUAGE_DE_DE, - self::LANGUAGE_EN_AU, - self::LANGUAGE_EN_GB, - self::LANGUAGE_EN_IN, - self::LANGUAGE_EN_US, - self::LANGUAGE_ES_ES, - self::LANGUAGE_ES_MX, - self::LANGUAGE_ES_US, - self::LANGUAGE_FR_CA, - self::LANGUAGE_FR_FR, - self::LANGUAGE_IT_IT, - self::LANGUAGE_JA_JP, - self::LANGUAGE_HI_IN, - self::LANGUAGE_KO_KR, - self::LANGUAGE_NB_NO, - self::LANGUAGE_NL_NL, - self::LANGUAGE_PL_PL, - self::LANGUAGE_PT_BR, - self::LANGUAGE_PT_PT, - self::LANGUAGE_SV_SE, - self::LANGUAGE_EN_NZ, - self::LANGUAGE_EN_ZA, - self::LANGUAGE_CA_ES, - self::LANGUAGE_DE_AT, - self::LANGUAGE_YUE_CN, - self::LANGUAGE_AR_AE, - self::LANGUAGE_FI_FI, - ]; - } - - /** - * 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) - { - $this->setIfExists('type', $data ?? [], 'text-to-speech'); - $this->setIfExists('text', $data ?? [], null); - $this->setIfExists('voice', $data ?? [], null); - $this->setIfExists('language', $data ?? [], 'en-US'); - $this->setIfExists('newscaster', $data ?? [], false); - $this->setIfExists('prompt', $data ?? [], null); - $this->setIfExists('width', $data ?? [], null); - $this->setIfExists('height', $data ?? [], null); - $this->setIfExists('image_url', $data ?? [], null); - $this->setIfExists('guidance_scale', $data ?? [], 1.8); - $this->setIfExists('motion', $data ?? [], 127); - - // Initialize discriminator property with the model name. - $this->container['type'] = static::$openAPIModelName; - } - - /** - * 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 ($this->container['type'] === null) { - $invalidProperties[] = "'type' can't be null"; - } - $allowedValues = $this->getTypeAllowableValues(); - if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { - $invalidProperties[] = sprintf( - "invalid value '%s' for 'type', must be one of '%s'", - $this->container['type'], - implode("', '", $allowedValues) - ); - } - - if ($this->container['text'] === null) { - $invalidProperties[] = "'text' can't be null"; - } - if ($this->container['voice'] === null) { - $invalidProperties[] = "'voice' can't be null"; - } - $allowedValues = $this->getVoiceAllowableValues(); - if (!is_null($this->container['voice']) && !in_array($this->container['voice'], $allowedValues, true)) { - $invalidProperties[] = sprintf( - "invalid value '%s' for 'voice', must be one of '%s'", - $this->container['voice'], - implode("', '", $allowedValues) - ); - } - - $allowedValues = $this->getLanguageAllowableValues(); - if (!is_null($this->container['language']) && !in_array($this->container['language'], $allowedValues, true)) { - $invalidProperties[] = sprintf( - "invalid value '%s' for 'language', must be one of '%s'", - $this->container['language'], - implode("', '", $allowedValues) - ); - } - - if ($this->container['prompt'] === null) { - $invalidProperties[] = "'prompt' can't be null"; - } - if ($this->container['width'] === null) { - $invalidProperties[] = "'width' can't be null"; - } - if ($this->container['height'] === null) { - $invalidProperties[] = "'height' can't be null"; - } - if ($this->container['image_url'] === null) { - $invalidProperties[] = "'image_url' can't be null"; - } - 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 type - * - * @return string - */ - public function getType() - { - return $this->container['type']; - } - - /** - * Sets type - * - * @param string $type The type of asset to generate - set to `text-to-speech` for text-to-speech. - * - * @return self - */ - public function setType($type) - { - if (is_null($type)) { - throw new \InvalidArgumentException('non-nullable type cannot be null'); - } - $allowedValues = $this->getTypeAllowableValues(); - if (!in_array($type, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value '%s' for 'type', must be one of '%s'", - $type, - implode("', '", $allowedValues) - ) - ); - } - $this->container['type'] = $type; - - return $this; - } - - /** - * Gets text - * - * @return string - */ - public function getText() - { - return $this->container['text']; - } - - /** - * Sets text - * - * @param string $text The text to convert to speech. - * - * @return self - */ - public function setText($text) - { - if (is_null($text)) { - throw new \InvalidArgumentException('non-nullable text cannot be null'); - } - $this->container['text'] = $text; - - return $this; - } - - /** - * Gets voice - * - * @return string - */ - public function getVoice() - { - return $this->container['voice']; - } - - /** - * Sets voice - * - * @param string $voice The voice to use for the text-to-speech conversion. You must pair the correct voice with the correct language. For each language there is a language code that must be set in the `language` property. The voice must be available for the language code or the conversion will fail. i.e. To use the voice `Zeina` for Arabic you must set the `language` to `arb`. Select a voice from the list of available voices, the language code is in brackets:
  • Arabic - Gulf (ar-AE)
    • `Hala`
  • Dutch - Belgian (nl-BE)
    • `Lisa`
  • Catalan (ca-ES)
    • `Arlet`
  • Chinese - Cantonese (yue-CN)
    • `Hiujin`
  • Chinese - Mandarin (cmn-CN)
    • `Zhiyu`
  • Danish (da-DK)
    • `Sofie`
  • Dutch (nl-NL)
    • `Laura`
  • English - Australian (en-AU)
    • `Olivia`
  • English - British (en-GB)
    • `Amy`
    • `Emma`
    • `Brian`
    • `Arthur`
  • English - Indian (en-IN)
    • `Kajal`
  • English - Ireland (en-IE)
    • `Niamh`
  • English - New Zealand (en-NZ)
    • `Aria`
  • English - South African (en-ZA)
    • `Ayanda`
  • English - US (en-US)
    • `Ivy`
    • `Joanna`
    • `Kendra`
    • `Kimberly`
    • `Salli`
    • `Joey`
    • `Justin`
    • `Kevin`
    • `Matthew`
    • `Ruth`
    • `Stephen`
  • Finnish (fi-FI)
    • `Suvi`
  • French (fr-FR)
    • `Léa`
    • `Rémi`
  • French - Canadian (fr-CA)
    • `Gabrielle`
    • `Liam`
  • German (de-DE)
    • `Vicki`
    • `Daniel`
  • German - Austrian (de-AT)
    • `Hannah`
  • Hindi (hi-IN)
    • `Kajal`
  • Italian (it-IT)
    • `Bianca`
    • `Adriano`
  • Japanese (ja-JP)
    • `Takumi`
    • `Kazuha`
    • `Tomoko`
  • Korean (ko-KR)
    • `Seoyeon`
  • Norwegian (nb-NO)
    • `Ida`
  • Polish (pl-PL)
    • `Ola`
  • Portuguese - Brazilian (pt-BR)
    • `Camila`
    • `Vitória` or `Vitoria`
    • `Thiago`
  • Portuguese - European (pt-PT)
    • `Inês` or `Ines`
  • Spanish (es-ES)
    • `Lucia`
    • `Sergio`
  • Spanish - Mexican (es-MX)
    • `Mia`
    • `Andrés`
  • Spanish - US (es-US)
    • `Lupe`
    • `Pedro`
  • Swedish (sv-SE)
    • `Elin`
- * - * @return self - */ - public function setVoice($voice) - { - if (is_null($voice)) { - throw new \InvalidArgumentException('non-nullable voice cannot be null'); - } - $allowedValues = $this->getVoiceAllowableValues(); - if (!in_array($voice, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value '%s' for 'voice', must be one of '%s'", - $voice, - implode("', '", $allowedValues) - ) - ); - } - $this->container['voice'] = $voice; - - return $this; - } - - /** - * Gets language - * - * @return string|null - */ - public function getLanguage() - { - return $this->container['language']; - } - - /** - * Sets language - * - * @param string|null $language The language code for the text-to-speech conversion. You must pair the correct language with the correct voice (see voice parameter above). Select a language from the list of available languages:
  • `cmn-CN`
  • `da-DK`
  • `de-DE`
  • `en-AU`
  • `en-GB`
  • `en-IN`
  • `en-US`
  • `es-ES`
  • `es-MX`
  • `es-US`
  • `fr-CA`
  • `fr-FR`
  • `it-IT`
  • `ja-JP`
  • `hi-IN`
  • `ko-KR`
  • `nb-NO`
  • `nl-NL`
  • `pl-PL`
  • `pt-BR`
  • `pt-PT`
  • `sv-SE`
  • `en-NZ`
  • `en-ZA`
  • `ca-ES`
  • `de-AT`
  • `yue-CN`
  • `ar-AE`
  • `fi-FI`
- * - * @return self - */ - public function setLanguage($language) - { - if (is_null($language)) { - throw new \InvalidArgumentException('non-nullable language cannot be null'); - } - $allowedValues = $this->getLanguageAllowableValues(); - if (!in_array($language, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value '%s' for 'language', must be one of '%s'", - $language, - implode("', '", $allowedValues) - ) - ); - } - $this->container['language'] = $language; - - return $this; - } - - /** - * Gets newscaster - * - * @return bool|null - */ - public function getNewscaster() - { - return $this->container['newscaster']; - } - - /** - * Sets newscaster - * - * @param bool|null $newscaster Set the voice to newscaster mode.

*Only Matthew and Joanna for US English (en-US), Lupe for US Spanish (es-US), and Amy for British English (en-GB) are available in the newscaster voice. - * - * @return self - */ - public function setNewscaster($newscaster) - { - if (is_null($newscaster)) { - throw new \InvalidArgumentException('non-nullable newscaster cannot be null'); - } - $this->container['newscaster'] = $newscaster; - - return $this; - } - - /** - * Gets prompt - * - * @return string - */ - public function getPrompt() - { - return $this->container['prompt']; - } - - /** - * Sets prompt - * - * @param string $prompt The text prompt to generate text from. - * - * @return self - */ - public function setPrompt($prompt) - { - if (is_null($prompt)) { - throw new \InvalidArgumentException('non-nullable prompt cannot be null'); - } - $this->container['prompt'] = $prompt; - - return $this; - } - - /** - * Gets width - * - * @return int - */ - public function getWidth() - { - return $this->container['width']; - } - - /** - * Sets width - * - * @param int $width The width of the image 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 height - * - * @return int - */ - public function getHeight() - { - return $this->container['height']; - } - - /** - * Sets height - * - * @param int $height The height of the image 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 image_url - * - * @return string - */ - public function getImageUrl() - { - return $this->container['image_url']; - } - - /** - * Sets image_url - * - * @param string $image_url The URL of the image to convert to video. The URL must be publicly accessible or include credentials. The image dimensions must exactly match one of the following: 1024px x 576px, 576px x 1024px or 768px x 768px. - * - * @return self - */ - public function setImageUrl($image_url) - { - if (is_null($image_url)) { - throw new \InvalidArgumentException('non-nullable image_url cannot be null'); - } - $this->container['image_url'] = $image_url; - - return $this; - } - - /** - * Gets guidance_scale - * - * @return float|null - */ - public function getGuidanceScale() - { - return $this->container['guidance_scale']; - } - - /** - * Sets guidance_scale - * - * @param float|null $guidance_scale The guidance scale determines how closely the generated video will match the image. Lower numbers allow for more creative freedom. A number between 0 and 10. - * - * @return self - */ - public function setGuidanceScale($guidance_scale) - { - if (is_null($guidance_scale)) { - throw new \InvalidArgumentException('non-nullable guidance_scale cannot be null'); - } - $this->container['guidance_scale'] = $guidance_scale; - - return $this; - } - - /** - * Gets motion - * - * @return int|null - */ - public function getMotion() - { - return $this->container['motion']; - } - - /** - * Sets motion - * - * @param int|null $motion The amount of motion in the video. A number between 1 and 255. - * - * @return self - */ - public function setMotion($motion) - { - if (is_null($motion)) { - throw new \InvalidArgumentException('non-nullable motion cannot be null'); - } - $this->container['motion'] = $motion; - - 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() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/src/Model/ShotstackTextToSpeechOptions.php b/src/Model/ShotstackTextToSpeechOptions.php deleted file mode 100644 index cbd05e7..0000000 --- a/src/Model/ShotstackTextToSpeechOptions.php +++ /dev/null @@ -1,819 +0,0 @@ - - */ -class ShotstackTextToSpeechOptions implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'ShotstackTextToSpeechOptions'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'type' => 'string', - 'text' => 'string', - 'voice' => 'string', - 'language' => 'string', - 'newscaster' => 'bool' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'type' => null, - 'text' => null, - 'voice' => null, - 'language' => null, - 'newscaster' => null - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static array $openAPINullables = [ - 'type' => false, - 'text' => false, - 'voice' => false, - 'language' => false, - 'newscaster' => 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; - } - - /** - * Setter - Array of nullable field names deliberately set to null - * - * @param boolean[] $openAPINullablesSetToNull - */ - private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void - { - $this->openAPINullablesSetToNull = $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 = [ - 'type' => 'type', - 'text' => 'text', - 'voice' => 'voice', - 'language' => 'language', - 'newscaster' => 'newscaster' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'type' => 'setType', - 'text' => 'setText', - 'voice' => 'setVoice', - 'language' => 'setLanguage', - 'newscaster' => 'setNewscaster' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'type' => 'getType', - 'text' => 'getText', - 'voice' => 'getVoice', - 'language' => 'getLanguage', - 'newscaster' => 'getNewscaster' - ]; - - /** - * 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 TYPE_TEXT_TO_SPEECH = 'text-to-speech'; - public const VOICE_HALA = 'Hala'; - public const VOICE_LISA = 'Lisa'; - public const VOICE_ARLET = 'Arlet'; - public const VOICE_HIUJIN = 'Hiujin'; - public const VOICE_ZHIYU = 'Zhiyu'; - public const VOICE_SOFIE = 'Sofie'; - public const VOICE_LAURA = 'Laura'; - public const VOICE_OLIVIA = 'Olivia'; - public const VOICE_AMY = 'Amy'; - public const VOICE_EMMA = 'Emma'; - public const VOICE_BRIAN = 'Brian'; - public const VOICE_ARTHUR = 'Arthur'; - public const VOICE_KAJAL = 'Kajal'; - public const VOICE_NIAMH = 'Niamh'; - public const VOICE_ARIA = 'Aria'; - public const VOICE_AYANDA = 'Ayanda'; - public const VOICE_IVY = 'Ivy'; - public const VOICE_JOANNA = 'Joanna'; - public const VOICE_KENDRA = 'Kendra'; - public const VOICE_KIMBERLY = 'Kimberly'; - public const VOICE_SALLI = 'Salli'; - public const VOICE_JOEY = 'Joey'; - public const VOICE_JUSTIN = 'Justin'; - public const VOICE_KEVIN = 'Kevin'; - public const VOICE_MATTHEW = 'Matthew'; - public const VOICE_RUTH = 'Ruth'; - public const VOICE_STEPHEN = 'Stephen'; - public const VOICE_SUVI = 'Suvi'; - public const VOICE_LA = 'Léa'; - public const VOICE_RMI = 'Rémi'; - public const VOICE_GABRIELLE = 'Gabrielle'; - public const VOICE_LIAM = 'Liam'; - public const VOICE_VICKI = 'Vicki'; - public const VOICE_DANIEL = 'Daniel'; - public const VOICE_HANNAH = 'Hannah'; - public const VOICE_KAJAL2 = 'Kajal'; - public const VOICE_BIANCA = 'Bianca'; - public const VOICE_ADRIANO = 'Adriano'; - public const VOICE_TAKUMI = 'Takumi'; - public const VOICE_KAZUHA = 'Kazuha'; - public const VOICE_TOMOKO = 'Tomoko'; - public const VOICE_SEOYEON = 'Seoyeon'; - public const VOICE_IDA = 'Ida'; - public const VOICE_OLA = 'Ola'; - public const VOICE_CAMILA = 'Camila'; - public const VOICE_VITRIA = 'Vitória'; - public const VOICE_VITORIA = 'Vitoria'; - public const VOICE_THIAGO = 'Thiago'; - public const VOICE_INS = 'Inês'; - public const VOICE_INES = 'Ines'; - public const VOICE_LUCIA = 'Lucia'; - public const VOICE_SERGIO = 'Sergio'; - public const VOICE_MIA = 'Mia'; - public const VOICE_ANDRS = 'Andrés'; - public const VOICE_LUPE = 'Lupe'; - public const VOICE_PEDRO = 'Pedro'; - public const VOICE_ELIN = 'Elin'; - public const LANGUAGE_CMN_CN = 'cmn-CN'; - public const LANGUAGE_DA_DK = 'da-DK'; - public const LANGUAGE_DE_DE = 'de-DE'; - public const LANGUAGE_EN_AU = 'en-AU'; - public const LANGUAGE_EN_GB = 'en-GB'; - public const LANGUAGE_EN_IN = 'en-IN'; - public const LANGUAGE_EN_US = 'en-US'; - public const LANGUAGE_ES_ES = 'es-ES'; - public const LANGUAGE_ES_MX = 'es-MX'; - public const LANGUAGE_ES_US = 'es-US'; - public const LANGUAGE_FR_CA = 'fr-CA'; - public const LANGUAGE_FR_FR = 'fr-FR'; - public const LANGUAGE_IT_IT = 'it-IT'; - public const LANGUAGE_JA_JP = 'ja-JP'; - public const LANGUAGE_HI_IN = 'hi-IN'; - public const LANGUAGE_KO_KR = 'ko-KR'; - public const LANGUAGE_NB_NO = 'nb-NO'; - public const LANGUAGE_NL_NL = 'nl-NL'; - public const LANGUAGE_PL_PL = 'pl-PL'; - public const LANGUAGE_PT_BR = 'pt-BR'; - public const LANGUAGE_PT_PT = 'pt-PT'; - public const LANGUAGE_SV_SE = 'sv-SE'; - public const LANGUAGE_EN_NZ = 'en-NZ'; - public const LANGUAGE_EN_ZA = 'en-ZA'; - public const LANGUAGE_CA_ES = 'ca-ES'; - public const LANGUAGE_DE_AT = 'de-AT'; - public const LANGUAGE_YUE_CN = 'yue-CN'; - public const LANGUAGE_AR_AE = 'ar-AE'; - public const LANGUAGE_FI_FI = 'fi-FI'; - - /** - * Gets allowable values of the enum - * - * @return string[] - */ - public function getTypeAllowableValues() - { - return [ - self::TYPE_TEXT_TO_SPEECH, - ]; - } - - /** - * Gets allowable values of the enum - * - * @return string[] - */ - public function getVoiceAllowableValues() - { - return [ - self::VOICE_HALA, - self::VOICE_LISA, - self::VOICE_ARLET, - self::VOICE_HIUJIN, - self::VOICE_ZHIYU, - self::VOICE_SOFIE, - self::VOICE_LAURA, - self::VOICE_OLIVIA, - self::VOICE_AMY, - self::VOICE_EMMA, - self::VOICE_BRIAN, - self::VOICE_ARTHUR, - self::VOICE_KAJAL, - self::VOICE_NIAMH, - self::VOICE_ARIA, - self::VOICE_AYANDA, - self::VOICE_IVY, - self::VOICE_JOANNA, - self::VOICE_KENDRA, - self::VOICE_KIMBERLY, - self::VOICE_SALLI, - self::VOICE_JOEY, - self::VOICE_JUSTIN, - self::VOICE_KEVIN, - self::VOICE_MATTHEW, - self::VOICE_RUTH, - self::VOICE_STEPHEN, - self::VOICE_SUVI, - self::VOICE_LA, - self::VOICE_RMI, - self::VOICE_GABRIELLE, - self::VOICE_LIAM, - self::VOICE_VICKI, - self::VOICE_DANIEL, - self::VOICE_HANNAH, - self::VOICE_KAJAL2, - self::VOICE_BIANCA, - self::VOICE_ADRIANO, - self::VOICE_TAKUMI, - self::VOICE_KAZUHA, - self::VOICE_TOMOKO, - self::VOICE_SEOYEON, - self::VOICE_IDA, - self::VOICE_OLA, - self::VOICE_CAMILA, - self::VOICE_VITRIA, - self::VOICE_VITORIA, - self::VOICE_THIAGO, - self::VOICE_INS, - self::VOICE_INES, - self::VOICE_LUCIA, - self::VOICE_SERGIO, - self::VOICE_MIA, - self::VOICE_ANDRS, - self::VOICE_LUPE, - self::VOICE_PEDRO, - self::VOICE_ELIN, - ]; - } - - /** - * Gets allowable values of the enum - * - * @return string[] - */ - public function getLanguageAllowableValues() - { - return [ - self::LANGUAGE_CMN_CN, - self::LANGUAGE_DA_DK, - self::LANGUAGE_DE_DE, - self::LANGUAGE_EN_AU, - self::LANGUAGE_EN_GB, - self::LANGUAGE_EN_IN, - self::LANGUAGE_EN_US, - self::LANGUAGE_ES_ES, - self::LANGUAGE_ES_MX, - self::LANGUAGE_ES_US, - self::LANGUAGE_FR_CA, - self::LANGUAGE_FR_FR, - self::LANGUAGE_IT_IT, - self::LANGUAGE_JA_JP, - self::LANGUAGE_HI_IN, - self::LANGUAGE_KO_KR, - self::LANGUAGE_NB_NO, - self::LANGUAGE_NL_NL, - self::LANGUAGE_PL_PL, - self::LANGUAGE_PT_BR, - self::LANGUAGE_PT_PT, - self::LANGUAGE_SV_SE, - self::LANGUAGE_EN_NZ, - self::LANGUAGE_EN_ZA, - self::LANGUAGE_CA_ES, - self::LANGUAGE_DE_AT, - self::LANGUAGE_YUE_CN, - self::LANGUAGE_AR_AE, - self::LANGUAGE_FI_FI, - ]; - } - - /** - * 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) - { - $this->setIfExists('type', $data ?? [], 'text-to-speech'); - $this->setIfExists('text', $data ?? [], null); - $this->setIfExists('voice', $data ?? [], null); - $this->setIfExists('language', $data ?? [], 'en-US'); - $this->setIfExists('newscaster', $data ?? [], false); - } - - /** - * 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 ($this->container['type'] === null) { - $invalidProperties[] = "'type' can't be null"; - } - $allowedValues = $this->getTypeAllowableValues(); - if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { - $invalidProperties[] = sprintf( - "invalid value '%s' for 'type', must be one of '%s'", - $this->container['type'], - implode("', '", $allowedValues) - ); - } - - if ($this->container['text'] === null) { - $invalidProperties[] = "'text' can't be null"; - } - if ($this->container['voice'] === null) { - $invalidProperties[] = "'voice' can't be null"; - } - $allowedValues = $this->getVoiceAllowableValues(); - if (!is_null($this->container['voice']) && !in_array($this->container['voice'], $allowedValues, true)) { - $invalidProperties[] = sprintf( - "invalid value '%s' for 'voice', must be one of '%s'", - $this->container['voice'], - implode("', '", $allowedValues) - ); - } - - $allowedValues = $this->getLanguageAllowableValues(); - if (!is_null($this->container['language']) && !in_array($this->container['language'], $allowedValues, true)) { - $invalidProperties[] = sprintf( - "invalid value '%s' for 'language', must be one of '%s'", - $this->container['language'], - 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 type - * - * @return string - */ - public function getType() - { - return $this->container['type']; - } - - /** - * Sets type - * - * @param string $type The type of asset to generate - set to `text-to-speech` for text-to-speech. - * - * @return self - */ - public function setType($type) - { - if (is_null($type)) { - throw new \InvalidArgumentException('non-nullable type cannot be null'); - } - $allowedValues = $this->getTypeAllowableValues(); - if (!in_array($type, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value '%s' for 'type', must be one of '%s'", - $type, - implode("', '", $allowedValues) - ) - ); - } - $this->container['type'] = $type; - - return $this; - } - - /** - * Gets text - * - * @return string - */ - public function getText() - { - return $this->container['text']; - } - - /** - * Sets text - * - * @param string $text The text to convert to speech. - * - * @return self - */ - public function setText($text) - { - if (is_null($text)) { - throw new \InvalidArgumentException('non-nullable text cannot be null'); - } - $this->container['text'] = $text; - - return $this; - } - - /** - * Gets voice - * - * @return string - */ - public function getVoice() - { - return $this->container['voice']; - } - - /** - * Sets voice - * - * @param string $voice The voice to use for the text-to-speech conversion. You must pair the correct voice with the correct language. For each language there is a language code that must be set in the `language` property. The voice must be available for the language code or the conversion will fail. i.e. To use the voice `Zeina` for Arabic you must set the `language` to `arb`. Select a voice from the list of available voices, the language code is in brackets:
  • Arabic - Gulf (ar-AE)
    • `Hala`
  • Dutch - Belgian (nl-BE)
    • `Lisa`
  • Catalan (ca-ES)
    • `Arlet`
  • Chinese - Cantonese (yue-CN)
    • `Hiujin`
  • Chinese - Mandarin (cmn-CN)
    • `Zhiyu`
  • Danish (da-DK)
    • `Sofie`
  • Dutch (nl-NL)
    • `Laura`
  • English - Australian (en-AU)
    • `Olivia`
  • English - British (en-GB)
    • `Amy`
    • `Emma`
    • `Brian`
    • `Arthur`
  • English - Indian (en-IN)
    • `Kajal`
  • English - Ireland (en-IE)
    • `Niamh`
  • English - New Zealand (en-NZ)
    • `Aria`
  • English - South African (en-ZA)
    • `Ayanda`
  • English - US (en-US)
    • `Ivy`
    • `Joanna`
    • `Kendra`
    • `Kimberly`
    • `Salli`
    • `Joey`
    • `Justin`
    • `Kevin`
    • `Matthew`
    • `Ruth`
    • `Stephen`
  • Finnish (fi-FI)
    • `Suvi`
  • French (fr-FR)
    • `Léa`
    • `Rémi`
  • French - Canadian (fr-CA)
    • `Gabrielle`
    • `Liam`
  • German (de-DE)
    • `Vicki`
    • `Daniel`
  • German - Austrian (de-AT)
    • `Hannah`
  • Hindi (hi-IN)
    • `Kajal`
  • Italian (it-IT)
    • `Bianca`
    • `Adriano`
  • Japanese (ja-JP)
    • `Takumi`
    • `Kazuha`
    • `Tomoko`
  • Korean (ko-KR)
    • `Seoyeon`
  • Norwegian (nb-NO)
    • `Ida`
  • Polish (pl-PL)
    • `Ola`
  • Portuguese - Brazilian (pt-BR)
    • `Camila`
    • `Vitória` or `Vitoria`
    • `Thiago`
  • Portuguese - European (pt-PT)
    • `Inês` or `Ines`
  • Spanish (es-ES)
    • `Lucia`
    • `Sergio`
  • Spanish - Mexican (es-MX)
    • `Mia`
    • `Andrés`
  • Spanish - US (es-US)
    • `Lupe`
    • `Pedro`
  • Swedish (sv-SE)
    • `Elin`
- * - * @return self - */ - public function setVoice($voice) - { - if (is_null($voice)) { - throw new \InvalidArgumentException('non-nullable voice cannot be null'); - } - $allowedValues = $this->getVoiceAllowableValues(); - if (!in_array($voice, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value '%s' for 'voice', must be one of '%s'", - $voice, - implode("', '", $allowedValues) - ) - ); - } - $this->container['voice'] = $voice; - - return $this; - } - - /** - * Gets language - * - * @return string|null - */ - public function getLanguage() - { - return $this->container['language']; - } - - /** - * Sets language - * - * @param string|null $language The language code for the text-to-speech conversion. You must pair the correct language with the correct voice (see voice parameter above). Select a language from the list of available languages:
  • `cmn-CN`
  • `da-DK`
  • `de-DE`
  • `en-AU`
  • `en-GB`
  • `en-IN`
  • `en-US`
  • `es-ES`
  • `es-MX`
  • `es-US`
  • `fr-CA`
  • `fr-FR`
  • `it-IT`
  • `ja-JP`
  • `hi-IN`
  • `ko-KR`
  • `nb-NO`
  • `nl-NL`
  • `pl-PL`
  • `pt-BR`
  • `pt-PT`
  • `sv-SE`
  • `en-NZ`
  • `en-ZA`
  • `ca-ES`
  • `de-AT`
  • `yue-CN`
  • `ar-AE`
  • `fi-FI`
- * - * @return self - */ - public function setLanguage($language) - { - if (is_null($language)) { - throw new \InvalidArgumentException('non-nullable language cannot be null'); - } - $allowedValues = $this->getLanguageAllowableValues(); - if (!in_array($language, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value '%s' for 'language', must be one of '%s'", - $language, - implode("', '", $allowedValues) - ) - ); - } - $this->container['language'] = $language; - - return $this; - } - - /** - * Gets newscaster - * - * @return bool|null - */ - public function getNewscaster() - { - return $this->container['newscaster']; - } - - /** - * Sets newscaster - * - * @param bool|null $newscaster Set the voice to newscaster mode.

*Only Matthew and Joanna for US English (en-US), Lupe for US Spanish (es-US), and Amy for British English (en-GB) are available in the newscaster voice. - * - * @return self - */ - public function setNewscaster($newscaster) - { - if (is_null($newscaster)) { - throw new \InvalidArgumentException('non-nullable newscaster cannot be null'); - } - $this->container['newscaster'] = $newscaster; - - 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() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/src/Model/Size.php b/src/Model/Size.php index 7dc2259..778bd05 100644 --- a/src/Model/Size.php +++ b/src/Model/Size.php @@ -5,7 +5,7 @@ * PHP version 7.4 * * @category Class - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech */ @@ -26,17 +26,17 @@ * Do not edit the class manually. */ -namespace Shotstack\Client\Model; +namespace ShotstackClient\Model; use \ArrayAccess; -use \Shotstack\Client\ObjectSerializer; +use \ShotstackClient\ObjectSerializer; /** * Size Class Doc Comment * * @category Class * @description Set a custom size for a video or image in pixels. When using a custom size omit the `resolution` and `aspectRatio`. Custom sizes must be divisible by 2 based on the encoder specifications. - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech * @implements \ArrayAccess diff --git a/src/Model/SkewTransformation.php b/src/Model/SkewTransformation.php index b4bd882..a69209c 100644 --- a/src/Model/SkewTransformation.php +++ b/src/Model/SkewTransformation.php @@ -5,7 +5,7 @@ * PHP version 7.4 * * @category Class - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech */ @@ -26,17 +26,17 @@ * Do not edit the class manually. */ -namespace Shotstack\Client\Model; +namespace ShotstackClient\Model; use \ArrayAccess; -use \Shotstack\Client\ObjectSerializer; +use \ShotstackClient\ObjectSerializer; /** * SkewTransformation Class Doc Comment * * @category Class - * @description Skew a clip so its edges are sheared at an angle. Use values between 0 and 3. Over 3 the clip will be skewed almost flat. - * @package Shotstack\Client + * @description Skew a clip so its edges are sheared at an angle. Use values between -100 and 100. Values over 3 or under -3 will skew the clip almost flat. + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech * @implements \ArrayAccess @@ -58,8 +58,8 @@ class SkewTransformation implements ModelInterface, ArrayAccess, \JsonSerializab * @var string[] */ protected static $openAPITypes = [ - 'x' => 'float', - 'y' => 'float' + 'x' => '\ShotstackClient\Model\SkewTransformationX', + 'y' => '\ShotstackClient\Model\SkewTransformationY' ]; /** @@ -70,8 +70,8 @@ class SkewTransformation implements ModelInterface, ArrayAccess, \JsonSerializab * @psalm-var array */ protected static $openAPIFormats = [ - 'x' => 'float', - 'y' => 'float' + 'x' => null, + 'y' => null ]; /** @@ -300,7 +300,7 @@ public function valid() /** * Gets x * - * @return float|null + * @return \ShotstackClient\Model\SkewTransformationX|null */ public function getX() { @@ -310,7 +310,7 @@ public function getX() /** * Sets x * - * @param float|null $x Skew the clip along it's x axis. + * @param \ShotstackClient\Model\SkewTransformationX|null $x x * * @return self */ @@ -327,7 +327,7 @@ public function setX($x) /** * Gets y * - * @return float|null + * @return \ShotstackClient\Model\SkewTransformationY|null */ public function getY() { @@ -337,7 +337,7 @@ public function getY() /** * Sets y * - * @param float|null $y Skew the clip along it's y axis. + * @param \ShotstackClient\Model\SkewTransformationY|null $y y * * @return self */ diff --git a/src/Model/GeneratedAssetResponse.php b/src/Model/SkewTransformationX.php similarity index 84% rename from src/Model/GeneratedAssetResponse.php rename to src/Model/SkewTransformationX.php index 9c01774..0d12560 100644 --- a/src/Model/GeneratedAssetResponse.php +++ b/src/Model/SkewTransformationX.php @@ -1,11 +1,11 @@ */ -class GeneratedAssetResponse implements ModelInterface, ArrayAccess, \JsonSerializable +class SkewTransformationX implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; @@ -50,7 +50,7 @@ class GeneratedAssetResponse implements ModelInterface, ArrayAccess, \JsonSerial * * @var string */ - protected static $openAPIModelName = 'GeneratedAssetResponse'; + protected static $openAPIModelName = 'SkewTransformation_x'; /** * Array of property to type mappings. Used for (de)serialization @@ -58,7 +58,7 @@ class GeneratedAssetResponse implements ModelInterface, ArrayAccess, \JsonSerial * @var string[] */ protected static $openAPITypes = [ - 'data' => '\Shotstack\Client\Model\GeneratedAssetResponseData' + ]; /** @@ -69,7 +69,7 @@ class GeneratedAssetResponse implements ModelInterface, ArrayAccess, \JsonSerial * @psalm-var array */ protected static $openAPIFormats = [ - 'data' => null + ]; /** @@ -78,7 +78,7 @@ class GeneratedAssetResponse implements ModelInterface, ArrayAccess, \JsonSerial * @var boolean[] */ protected static array $openAPINullables = [ - 'data' => false + ]; /** @@ -167,7 +167,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'data' => 'data' + ]; /** @@ -176,7 +176,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'data' => 'setData' + ]; /** @@ -185,7 +185,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'data' => 'getData' + ]; /** @@ -245,7 +245,6 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->setIfExists('data', $data ?? [], null); } /** @@ -275,9 +274,6 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['data'] === null) { - $invalidProperties[] = "'data' can't be null"; - } return $invalidProperties; } @@ -292,33 +288,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - - /** - * Gets data - * - * @return \Shotstack\Client\Model\GeneratedAssetResponseData - */ - public function getData() - { - return $this->container['data']; - } - - /** - * Sets data - * - * @param \Shotstack\Client\Model\GeneratedAssetResponseData $data data - * - * @return self - */ - public function setData($data) - { - if (is_null($data)) { - throw new \InvalidArgumentException('non-nullable data cannot be null'); - } - $this->container['data'] = $data; - - return $this; - } /** * Returns true if offset exists. False otherwise. * diff --git a/src/Model/SkewTransformationY.php b/src/Model/SkewTransformationY.php new file mode 100644 index 0000000..2a1533e --- /dev/null +++ b/src/Model/SkewTransformationY.php @@ -0,0 +1,382 @@ + + */ +class SkewTransformationY implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'SkewTransformation_y'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + + ]; + + /** + * 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; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $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 = [ + + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + + ]; + + /** + * 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) + { + } + + /** + * 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 = []; + + 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; + } + + /** + * 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() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/Soundtrack.php b/src/Model/Soundtrack.php index 1ce8b01..3605ce2 100644 --- a/src/Model/Soundtrack.php +++ b/src/Model/Soundtrack.php @@ -5,7 +5,7 @@ * PHP version 7.4 * * @category Class - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech */ @@ -26,17 +26,17 @@ * Do not edit the class manually. */ -namespace Shotstack\Client\Model; +namespace ShotstackClient\Model; use \ArrayAccess; -use \Shotstack\Client\ObjectSerializer; +use \ShotstackClient\ObjectSerializer; /** * Soundtrack Class Doc Comment * * @category Class * @description A music or audio file in mp3 format that plays for the duration of the rendered video or the length of the audio file, which ever is shortest. - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech * @implements \ArrayAccess @@ -309,6 +309,14 @@ public function listInvalidProperties() if ($this->container['src'] === null) { $invalidProperties[] = "'src' can't be null"; } + if ((mb_strlen($this->container['src']) < 1)) { + $invalidProperties[] = "invalid value for 'src', the character length must be bigger than or equal to 1."; + } + + if (!preg_match("/\\S/", $this->container['src'])) { + $invalidProperties[] = "invalid value for 'src', must be conform to the pattern /\\S/."; + } + $allowedValues = $this->getEffectAllowableValues(); if (!is_null($this->container['effect']) && !in_array($this->container['effect'], $allowedValues, true)) { $invalidProperties[] = sprintf( @@ -355,6 +363,14 @@ public function setSrc($src) if (is_null($src)) { throw new \InvalidArgumentException('non-nullable src cannot be null'); } + + if ((mb_strlen($src) < 1)) { + throw new \InvalidArgumentException('invalid length for $src when calling Soundtrack., must be bigger than or equal to 1.'); + } + if ((!preg_match("/\\S/", ObjectSerializer::toString($src)))) { + throw new \InvalidArgumentException("invalid value for \$src when calling Soundtrack., must conform to the pattern /\\S/."); + } + $this->container['src'] = $src; return $this; diff --git a/src/Model/Source.php b/src/Model/Source.php index b878a6f..d79a237 100644 --- a/src/Model/Source.php +++ b/src/Model/Source.php @@ -5,7 +5,7 @@ * PHP version 7.4 * * @category Class - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech */ @@ -26,17 +26,17 @@ * Do not edit the class manually. */ -namespace Shotstack\Client\Model; +namespace ShotstackClient\Model; use \ArrayAccess; -use \Shotstack\Client\ObjectSerializer; +use \ShotstackClient\ObjectSerializer; /** * Source Class Doc Comment * * @category Class * @description The details of the file to be ingested and any transformations to be applied. Once the source file has been ingested, new renditions can be created from it. The renditions are specified in the **outputs** property. A rendition is a new version, generated from the source. This can be used to create new sizes and aspect ratios tht serve different purposes within an application. - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech * @implements \ArrayAccess @@ -59,8 +59,8 @@ class Source implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPITypes = [ 'url' => 'string', - 'outputs' => '\Shotstack\Client\Model\Outputs', - 'destinations' => '\Shotstack\Client\Model\Destinations', + 'outputs' => '\ShotstackClient\Model\Outputs', + 'destinations' => '\ShotstackClient\Model\Destinations', 'callback' => 'string' ]; @@ -341,7 +341,7 @@ public function setUrl($url) /** * Gets outputs * - * @return \Shotstack\Client\Model\Outputs|null + * @return \ShotstackClient\Model\Outputs|null */ public function getOutputs() { @@ -351,7 +351,7 @@ public function getOutputs() /** * Sets outputs * - * @param \Shotstack\Client\Model\Outputs|null $outputs outputs + * @param \ShotstackClient\Model\Outputs|null $outputs outputs * * @return self */ @@ -368,7 +368,7 @@ public function setOutputs($outputs) /** * Gets destinations * - * @return \Shotstack\Client\Model\Destinations|null + * @return \ShotstackClient\Model\Destinations|null */ public function getDestinations() { @@ -378,7 +378,7 @@ public function getDestinations() /** * Sets destinations * - * @param \Shotstack\Client\Model\Destinations|null $destinations destinations + * @param \ShotstackClient\Model\Destinations|null $destinations destinations * * @return self */ diff --git a/src/Model/SourceListResponse.php b/src/Model/SourceListResponse.php index a8d20eb..7b68848 100644 --- a/src/Model/SourceListResponse.php +++ b/src/Model/SourceListResponse.php @@ -5,7 +5,7 @@ * PHP version 7.4 * * @category Class - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech */ @@ -26,17 +26,17 @@ * Do not edit the class manually. */ -namespace Shotstack\Client\Model; +namespace ShotstackClient\Model; use \ArrayAccess; -use \Shotstack\Client\ObjectSerializer; +use \ShotstackClient\ObjectSerializer; /** * SourceListResponse Class Doc Comment * * @category Class * @description A list of all ingested source files fetched or uploaded to a users account. - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech * @implements \ArrayAccess @@ -58,7 +58,7 @@ class SourceListResponse implements ModelInterface, ArrayAccess, \JsonSerializab * @var string[] */ protected static $openAPITypes = [ - 'data' => '\Shotstack\Client\Model\SourceResponseData[]' + 'data' => '\ShotstackClient\Model\SourceResponseData[]' ]; /** @@ -296,7 +296,7 @@ public function valid() /** * Gets data * - * @return \Shotstack\Client\Model\SourceResponseData[] + * @return \ShotstackClient\Model\SourceResponseData[] */ public function getData() { @@ -306,7 +306,7 @@ public function getData() /** * Sets data * - * @param \Shotstack\Client\Model\SourceResponseData[] $data An array of ingested source files. + * @param \ShotstackClient\Model\SourceResponseData[] $data An array of ingested source files. * * @return self */ diff --git a/src/Model/SourceResponse.php b/src/Model/SourceResponse.php index c452a81..4494d40 100644 --- a/src/Model/SourceResponse.php +++ b/src/Model/SourceResponse.php @@ -5,7 +5,7 @@ * PHP version 7.4 * * @category Class - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech */ @@ -26,17 +26,17 @@ * Do not edit the class manually. */ -namespace Shotstack\Client\Model; +namespace ShotstackClient\Model; use \ArrayAccess; -use \Shotstack\Client\ObjectSerializer; +use \ShotstackClient\ObjectSerializer; /** * SourceResponse Class Doc Comment * * @category Class * @description The response returned by the Ingest API [get source](#get-source) request. Includes details of the ingested source file. The response follows the [json:api](https://jsonapi.org/) specification. - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech * @implements \ArrayAccess @@ -58,7 +58,7 @@ class SourceResponse implements ModelInterface, ArrayAccess, \JsonSerializable * @var string[] */ protected static $openAPITypes = [ - 'data' => '\Shotstack\Client\Model\SourceResponseData' + 'data' => '\ShotstackClient\Model\SourceResponseData' ]; /** @@ -296,7 +296,7 @@ public function valid() /** * Gets data * - * @return \Shotstack\Client\Model\SourceResponseData + * @return \ShotstackClient\Model\SourceResponseData */ public function getData() { @@ -306,7 +306,7 @@ public function getData() /** * Sets data * - * @param \Shotstack\Client\Model\SourceResponseData $data data + * @param \ShotstackClient\Model\SourceResponseData $data data * * @return self */ diff --git a/src/Model/SourceResponseAttributes.php b/src/Model/SourceResponseAttributes.php index 45032d2..d722100 100644 --- a/src/Model/SourceResponseAttributes.php +++ b/src/Model/SourceResponseAttributes.php @@ -5,7 +5,7 @@ * PHP version 7.4 * * @category Class - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech */ @@ -26,17 +26,17 @@ * Do not edit the class manually. */ -namespace Shotstack\Client\Model; +namespace ShotstackClient\Model; use \ArrayAccess; -use \Shotstack\Client\ObjectSerializer; +use \ShotstackClient\ObjectSerializer; /** * SourceResponseAttributes Class Doc Comment * * @category Class * @description The id and attributes of the source file. - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech * @implements \ArrayAccess @@ -63,9 +63,9 @@ class SourceResponseAttributes implements ModelInterface, ArrayAccess, \JsonSeri 'input' => 'string', 'source' => 'string', 'status' => 'string', - 'outputs' => '\Shotstack\Client\Model\OutputsResponse', + 'outputs' => '\ShotstackClient\Model\OutputsResponse', 'width' => 'int', - 'height' => 'string', + 'height' => 'int', 'duration' => 'float', 'fps' => 'float', 'created' => 'string', @@ -553,7 +553,7 @@ public function setStatus($status) /** * Gets outputs * - * @return \Shotstack\Client\Model\OutputsResponse|null + * @return \ShotstackClient\Model\OutputsResponse|null */ public function getOutputs() { @@ -563,7 +563,7 @@ public function getOutputs() /** * Sets outputs * - * @param \Shotstack\Client\Model\OutputsResponse|null $outputs outputs + * @param \ShotstackClient\Model\OutputsResponse|null $outputs outputs * * @return self */ @@ -607,7 +607,7 @@ public function setWidth($width) /** * Gets height * - * @return string|null + * @return int|null */ public function getHeight() { @@ -617,7 +617,7 @@ public function getHeight() /** * Sets height * - * @param string|null $height The height in pixels of the ingested source file, if a video or image. + * @param int|null $height The height in pixels of the ingested source file, if a video or image. * * @return self */ diff --git a/src/Model/SourceResponseData.php b/src/Model/SourceResponseData.php index 5467217..766c472 100644 --- a/src/Model/SourceResponseData.php +++ b/src/Model/SourceResponseData.php @@ -5,7 +5,7 @@ * PHP version 7.4 * * @category Class - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech */ @@ -26,17 +26,17 @@ * Do not edit the class manually. */ -namespace Shotstack\Client\Model; +namespace ShotstackClient\Model; use \ArrayAccess; -use \Shotstack\Client\ObjectSerializer; +use \ShotstackClient\ObjectSerializer; /** * SourceResponseData Class Doc Comment * * @category Class * @description The type of resource (a source), it's id and attributes of the source file. - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech * @implements \ArrayAccess @@ -60,7 +60,7 @@ class SourceResponseData implements ModelInterface, ArrayAccess, \JsonSerializab protected static $openAPITypes = [ 'type' => 'string', 'id' => 'string', - 'attributes' => '\Shotstack\Client\Model\SourceResponseAttributes' + 'attributes' => '\ShotstackClient\Model\SourceResponseAttributes' ]; /** @@ -370,7 +370,7 @@ public function setId($id) /** * Gets attributes * - * @return \Shotstack\Client\Model\SourceResponseAttributes + * @return \ShotstackClient\Model\SourceResponseAttributes */ public function getAttributes() { @@ -380,7 +380,7 @@ public function getAttributes() /** * Sets attributes * - * @param \Shotstack\Client\Model\SourceResponseAttributes $attributes attributes + * @param \ShotstackClient\Model\SourceResponseAttributes $attributes attributes * * @return self */ diff --git a/src/Model/Speed.php b/src/Model/Speed.php index 4f8daa3..f932434 100644 --- a/src/Model/Speed.php +++ b/src/Model/Speed.php @@ -5,7 +5,7 @@ * PHP version 7.4 * * @category Class - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech */ @@ -26,17 +26,17 @@ * Do not edit the class manually. */ -namespace Shotstack\Client\Model; +namespace ShotstackClient\Model; use \ArrayAccess; -use \Shotstack\Client\ObjectSerializer; +use \ShotstackClient\ObjectSerializer; /** * Speed Class Doc Comment * * @category Class * @description Set the playback speed of a video or audio file. Allows you to preserve the pitch of the audio so that it is sped up without sounding too high pitched or too low. - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech * @implements \ArrayAccess diff --git a/src/Model/StabilityAiGeneratedAssetOptions.php b/src/Model/StabilityAiGeneratedAssetOptions.php deleted file mode 100644 index 31b3619..0000000 --- a/src/Model/StabilityAiGeneratedAssetOptions.php +++ /dev/null @@ -1,833 +0,0 @@ - - */ -class StabilityAiGeneratedAssetOptions implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = 'type'; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'StabilityAiGeneratedAssetOptions'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'type' => 'string', - 'prompt' => 'string', - 'engine' => 'string', - 'width' => 'int', - 'height' => 'int', - 'steps' => 'int', - 'seed' => 'int', - 'cfg_scale' => 'float', - 'style_preset' => 'string' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'type' => null, - 'prompt' => null, - 'engine' => null, - 'width' => null, - 'height' => null, - 'steps' => null, - 'seed' => null, - 'cfg_scale' => null, - 'style_preset' => null - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static array $openAPINullables = [ - 'type' => false, - 'prompt' => false, - 'engine' => false, - 'width' => false, - 'height' => false, - 'steps' => false, - 'seed' => false, - 'cfg_scale' => false, - 'style_preset' => 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; - } - - /** - * Setter - Array of nullable field names deliberately set to null - * - * @param boolean[] $openAPINullablesSetToNull - */ - private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void - { - $this->openAPINullablesSetToNull = $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 = [ - 'type' => 'type', - 'prompt' => 'prompt', - 'engine' => 'engine', - 'width' => 'width', - 'height' => 'height', - 'steps' => 'steps', - 'seed' => 'seed', - 'cfg_scale' => 'cfgScale', - 'style_preset' => 'stylePreset' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'type' => 'setType', - 'prompt' => 'setPrompt', - 'engine' => 'setEngine', - 'width' => 'setWidth', - 'height' => 'setHeight', - 'steps' => 'setSteps', - 'seed' => 'setSeed', - 'cfg_scale' => 'setCfgScale', - 'style_preset' => 'setStylePreset' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'type' => 'getType', - 'prompt' => 'getPrompt', - 'engine' => 'getEngine', - 'width' => 'getWidth', - 'height' => 'getHeight', - 'steps' => 'getSteps', - 'seed' => 'getSeed', - 'cfg_scale' => 'getCfgScale', - 'style_preset' => 'getStylePreset' - ]; - - /** - * 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 TYPE_TEXT_TO_IMAGE = 'text-to-image'; - public const ENGINE_XL_1024_V0_9 = 'stable-diffusion-xl-1024-v0-9'; - public const ENGINE_XL_1024_V1_0 = 'stable-diffusion-xl-1024-v1-0'; - public const ENGINE_V1_6 = 'stable-diffusion-v1-6'; - public const ENGINE__512_V2_1 = 'stable-diffusion-512-v2-1'; - public const ENGINE_XL_BETA_V2_2_2 = 'stable-diffusion-xl-beta-v2-2-2'; - public const STYLE_PRESET__3D_MODEL = '3d-model'; - public const STYLE_PRESET_ANALOG_FILM = 'analog-film'; - public const STYLE_PRESET_ANIME = 'anime'; - public const STYLE_PRESET_CINEMATIC = 'cinematic'; - public const STYLE_PRESET_COMIC_BOOK = 'comic-book'; - public const STYLE_PRESET_DIGITAL_ART = 'digital-art'; - public const STYLE_PRESET_ENHANCE = 'enhance'; - public const STYLE_PRESET_FANTASY_ART = 'fantasy-art'; - public const STYLE_PRESET_ISOMETRIC = 'isometric'; - public const STYLE_PRESET_LINE_ART = 'line-art'; - public const STYLE_PRESET_LOW_POLY = 'low-poly'; - public const STYLE_PRESET_MODELING_COMPOUND = 'modeling-compound'; - public const STYLE_PRESET_NEON_PUNK = 'neon-punk'; - public const STYLE_PRESET_ORIGAMI = 'origami'; - public const STYLE_PRESET_PHOTOGRAPHIC = 'photographic'; - public const STYLE_PRESET_PIXEL_ART = 'pixel-art'; - public const STYLE_PRESET_TILE_TEXTURE = 'tile-texture'; - - /** - * Gets allowable values of the enum - * - * @return string[] - */ - public function getTypeAllowableValues() - { - return [ - self::TYPE_TEXT_TO_IMAGE, - ]; - } - - /** - * Gets allowable values of the enum - * - * @return string[] - */ - public function getEngineAllowableValues() - { - return [ - self::ENGINE_XL_1024_V0_9, - self::ENGINE_XL_1024_V1_0, - self::ENGINE_V1_6, - self::ENGINE__512_V2_1, - self::ENGINE_XL_BETA_V2_2_2, - ]; - } - - /** - * Gets allowable values of the enum - * - * @return string[] - */ - public function getStylePresetAllowableValues() - { - return [ - self::STYLE_PRESET__3D_MODEL, - self::STYLE_PRESET_ANALOG_FILM, - self::STYLE_PRESET_ANIME, - self::STYLE_PRESET_CINEMATIC, - self::STYLE_PRESET_COMIC_BOOK, - self::STYLE_PRESET_DIGITAL_ART, - self::STYLE_PRESET_ENHANCE, - self::STYLE_PRESET_FANTASY_ART, - self::STYLE_PRESET_ISOMETRIC, - self::STYLE_PRESET_LINE_ART, - self::STYLE_PRESET_LOW_POLY, - self::STYLE_PRESET_MODELING_COMPOUND, - self::STYLE_PRESET_NEON_PUNK, - self::STYLE_PRESET_ORIGAMI, - self::STYLE_PRESET_PHOTOGRAPHIC, - self::STYLE_PRESET_PIXEL_ART, - self::STYLE_PRESET_TILE_TEXTURE, - ]; - } - - /** - * 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) - { - $this->setIfExists('type', $data ?? [], 'text-to-image'); - $this->setIfExists('prompt', $data ?? [], null); - $this->setIfExists('engine', $data ?? [], 'stable-diffusion-xl-1024-v1-0'); - $this->setIfExists('width', $data ?? [], null); - $this->setIfExists('height', $data ?? [], null); - $this->setIfExists('steps', $data ?? [], 30); - $this->setIfExists('seed', $data ?? [], 0); - $this->setIfExists('cfg_scale', $data ?? [], 7); - $this->setIfExists('style_preset', $data ?? [], null); - - // Initialize discriminator property with the model name. - $this->container['type'] = static::$openAPIModelName; - } - - /** - * 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 ($this->container['type'] === null) { - $invalidProperties[] = "'type' can't be null"; - } - $allowedValues = $this->getTypeAllowableValues(); - if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { - $invalidProperties[] = sprintf( - "invalid value '%s' for 'type', must be one of '%s'", - $this->container['type'], - implode("', '", $allowedValues) - ); - } - - if ($this->container['prompt'] === null) { - $invalidProperties[] = "'prompt' can't be null"; - } - $allowedValues = $this->getEngineAllowableValues(); - if (!is_null($this->container['engine']) && !in_array($this->container['engine'], $allowedValues, true)) { - $invalidProperties[] = sprintf( - "invalid value '%s' for 'engine', must be one of '%s'", - $this->container['engine'], - implode("', '", $allowedValues) - ); - } - - if ($this->container['width'] === null) { - $invalidProperties[] = "'width' can't be null"; - } - if ($this->container['height'] === null) { - $invalidProperties[] = "'height' can't be null"; - } - $allowedValues = $this->getStylePresetAllowableValues(); - if (!is_null($this->container['style_preset']) && !in_array($this->container['style_preset'], $allowedValues, true)) { - $invalidProperties[] = sprintf( - "invalid value '%s' for 'style_preset', must be one of '%s'", - $this->container['style_preset'], - 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 type - * - * @return string - */ - public function getType() - { - return $this->container['type']; - } - - /** - * Sets type - * - * @param string $type The type of asset to generate - set to `text-to-image` for text-to-image. - * - * @return self - */ - public function setType($type) - { - if (is_null($type)) { - throw new \InvalidArgumentException('non-nullable type cannot be null'); - } - $allowedValues = $this->getTypeAllowableValues(); - if (!in_array($type, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value '%s' for 'type', must be one of '%s'", - $type, - implode("', '", $allowedValues) - ) - ); - } - $this->container['type'] = $type; - - return $this; - } - - /** - * Gets prompt - * - * @return string - */ - public function getPrompt() - { - return $this->container['prompt']; - } - - /** - * Sets prompt - * - * @param string $prompt The text prompt to generate an image from. - * - * @return self - */ - public function setPrompt($prompt) - { - if (is_null($prompt)) { - throw new \InvalidArgumentException('non-nullable prompt cannot be null'); - } - $this->container['prompt'] = $prompt; - - return $this; - } - - /** - * Gets engine - * - * @return string|null - */ - public function getEngine() - { - return $this->container['engine']; - } - - /** - * Sets engine - * - * @param string|null $engine The engine (model) to use for generating the image. Select from the list of available engines:
  • `stable-diffusion-xl-1024-v0-9`
  • `stable-diffusion-xl-1024-v1-0`
  • `stable-diffusion-v1-6`
  • `stable-diffusion-512-v2-1`
  • `stable-diffusion-xl-beta-v2-2-2`
- * - * @return self - */ - public function setEngine($engine) - { - if (is_null($engine)) { - throw new \InvalidArgumentException('non-nullable engine cannot be null'); - } - $allowedValues = $this->getEngineAllowableValues(); - if (!in_array($engine, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value '%s' for 'engine', must be one of '%s'", - $engine, - implode("', '", $allowedValues) - ) - ); - } - $this->container['engine'] = $engine; - - return $this; - } - - /** - * Gets width - * - * @return int - */ - public function getWidth() - { - return $this->container['width']; - } - - /** - * Sets width - * - * @param int $width The width of the image in pixels. Must be divisible by 64. - * - * @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 height - * - * @return int - */ - public function getHeight() - { - return $this->container['height']; - } - - /** - * Sets height - * - * @param int $height The height of the image in pixels. Must be divisible by 64. - * - * @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 steps - * - * @return int|null - */ - public function getSteps() - { - return $this->container['steps']; - } - - /** - * Sets steps - * - * @param int|null $steps The number of iterative diffusion steps to run. A number between 10 and 50. - * - * @return self - */ - public function setSteps($steps) - { - if (is_null($steps)) { - throw new \InvalidArgumentException('non-nullable steps cannot be null'); - } - $this->container['steps'] = $steps; - - return $this; - } - - /** - * Gets seed - * - * @return int|null - */ - public function getSeed() - { - return $this->container['seed']; - } - - /** - * Sets seed - * - * @param int|null $seed Using the same seed can help you create images that look similar. Set to 0 for a random seed. A number between 0 and 4294967295. - * - * @return self - */ - public function setSeed($seed) - { - if (is_null($seed)) { - throw new \InvalidArgumentException('non-nullable seed cannot be null'); - } - $this->container['seed'] = $seed; - - return $this; - } - - /** - * Gets cfg_scale - * - * @return float|null - */ - public function getCfgScale() - { - return $this->container['cfg_scale']; - } - - /** - * Sets cfg_scale - * - * @param float|null $cfg_scale Determines how closely the generated image will match the prompt. Lower numbers allow for more creative freedom. A number between 0 and 35. - * - * @return self - */ - public function setCfgScale($cfg_scale) - { - if (is_null($cfg_scale)) { - throw new \InvalidArgumentException('non-nullable cfg_scale cannot be null'); - } - $this->container['cfg_scale'] = $cfg_scale; - - return $this; - } - - /** - * Gets style_preset - * - * @return string|null - */ - public function getStylePreset() - { - return $this->container['style_preset']; - } - - /** - * Sets style_preset - * - * @param string|null $style_preset Apply a preset to generate an image in a particular style. Select from the list of available presets:
  • `3d-model`
  • `analog-film`
  • `anime`
  • `cinematic`
  • `comic-book`
  • `digital-art`
  • `enhance`
  • `fantasy-art`
  • `isometric`
  • `line-art`
  • `low-poly`
  • `modeling-compound`
  • `neon-punk`
  • `origami`
  • `photographic`
  • `pixel-art`
  • `tile-texture`
- * - * @return self - */ - public function setStylePreset($style_preset) - { - if (is_null($style_preset)) { - throw new \InvalidArgumentException('non-nullable style_preset cannot be null'); - } - $allowedValues = $this->getStylePresetAllowableValues(); - if (!in_array($style_preset, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value '%s' for 'style_preset', must be one of '%s'", - $style_preset, - implode("', '", $allowedValues) - ) - ); - } - $this->container['style_preset'] = $style_preset; - - 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() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/src/Model/StabilityAiTextToImageOptions.php b/src/Model/StabilityAiTextToImageOptions.php deleted file mode 100644 index 6fac0a7..0000000 --- a/src/Model/StabilityAiTextToImageOptions.php +++ /dev/null @@ -1,830 +0,0 @@ - - */ -class StabilityAiTextToImageOptions implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'StabilityAiTextToImageOptions'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'type' => 'string', - 'prompt' => 'string', - 'engine' => 'string', - 'width' => 'int', - 'height' => 'int', - 'steps' => 'int', - 'seed' => 'int', - 'cfg_scale' => 'float', - 'style_preset' => 'string' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'type' => null, - 'prompt' => null, - 'engine' => null, - 'width' => null, - 'height' => null, - 'steps' => null, - 'seed' => null, - 'cfg_scale' => null, - 'style_preset' => null - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static array $openAPINullables = [ - 'type' => false, - 'prompt' => false, - 'engine' => false, - 'width' => false, - 'height' => false, - 'steps' => false, - 'seed' => false, - 'cfg_scale' => false, - 'style_preset' => 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; - } - - /** - * Setter - Array of nullable field names deliberately set to null - * - * @param boolean[] $openAPINullablesSetToNull - */ - private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void - { - $this->openAPINullablesSetToNull = $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 = [ - 'type' => 'type', - 'prompt' => 'prompt', - 'engine' => 'engine', - 'width' => 'width', - 'height' => 'height', - 'steps' => 'steps', - 'seed' => 'seed', - 'cfg_scale' => 'cfgScale', - 'style_preset' => 'stylePreset' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'type' => 'setType', - 'prompt' => 'setPrompt', - 'engine' => 'setEngine', - 'width' => 'setWidth', - 'height' => 'setHeight', - 'steps' => 'setSteps', - 'seed' => 'setSeed', - 'cfg_scale' => 'setCfgScale', - 'style_preset' => 'setStylePreset' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'type' => 'getType', - 'prompt' => 'getPrompt', - 'engine' => 'getEngine', - 'width' => 'getWidth', - 'height' => 'getHeight', - 'steps' => 'getSteps', - 'seed' => 'getSeed', - 'cfg_scale' => 'getCfgScale', - 'style_preset' => 'getStylePreset' - ]; - - /** - * 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 TYPE_TEXT_TO_IMAGE = 'text-to-image'; - public const ENGINE_XL_1024_V0_9 = 'stable-diffusion-xl-1024-v0-9'; - public const ENGINE_XL_1024_V1_0 = 'stable-diffusion-xl-1024-v1-0'; - public const ENGINE_V1_6 = 'stable-diffusion-v1-6'; - public const ENGINE__512_V2_1 = 'stable-diffusion-512-v2-1'; - public const ENGINE_XL_BETA_V2_2_2 = 'stable-diffusion-xl-beta-v2-2-2'; - public const STYLE_PRESET__3D_MODEL = '3d-model'; - public const STYLE_PRESET_ANALOG_FILM = 'analog-film'; - public const STYLE_PRESET_ANIME = 'anime'; - public const STYLE_PRESET_CINEMATIC = 'cinematic'; - public const STYLE_PRESET_COMIC_BOOK = 'comic-book'; - public const STYLE_PRESET_DIGITAL_ART = 'digital-art'; - public const STYLE_PRESET_ENHANCE = 'enhance'; - public const STYLE_PRESET_FANTASY_ART = 'fantasy-art'; - public const STYLE_PRESET_ISOMETRIC = 'isometric'; - public const STYLE_PRESET_LINE_ART = 'line-art'; - public const STYLE_PRESET_LOW_POLY = 'low-poly'; - public const STYLE_PRESET_MODELING_COMPOUND = 'modeling-compound'; - public const STYLE_PRESET_NEON_PUNK = 'neon-punk'; - public const STYLE_PRESET_ORIGAMI = 'origami'; - public const STYLE_PRESET_PHOTOGRAPHIC = 'photographic'; - public const STYLE_PRESET_PIXEL_ART = 'pixel-art'; - public const STYLE_PRESET_TILE_TEXTURE = 'tile-texture'; - - /** - * Gets allowable values of the enum - * - * @return string[] - */ - public function getTypeAllowableValues() - { - return [ - self::TYPE_TEXT_TO_IMAGE, - ]; - } - - /** - * Gets allowable values of the enum - * - * @return string[] - */ - public function getEngineAllowableValues() - { - return [ - self::ENGINE_XL_1024_V0_9, - self::ENGINE_XL_1024_V1_0, - self::ENGINE_V1_6, - self::ENGINE__512_V2_1, - self::ENGINE_XL_BETA_V2_2_2, - ]; - } - - /** - * Gets allowable values of the enum - * - * @return string[] - */ - public function getStylePresetAllowableValues() - { - return [ - self::STYLE_PRESET__3D_MODEL, - self::STYLE_PRESET_ANALOG_FILM, - self::STYLE_PRESET_ANIME, - self::STYLE_PRESET_CINEMATIC, - self::STYLE_PRESET_COMIC_BOOK, - self::STYLE_PRESET_DIGITAL_ART, - self::STYLE_PRESET_ENHANCE, - self::STYLE_PRESET_FANTASY_ART, - self::STYLE_PRESET_ISOMETRIC, - self::STYLE_PRESET_LINE_ART, - self::STYLE_PRESET_LOW_POLY, - self::STYLE_PRESET_MODELING_COMPOUND, - self::STYLE_PRESET_NEON_PUNK, - self::STYLE_PRESET_ORIGAMI, - self::STYLE_PRESET_PHOTOGRAPHIC, - self::STYLE_PRESET_PIXEL_ART, - self::STYLE_PRESET_TILE_TEXTURE, - ]; - } - - /** - * 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) - { - $this->setIfExists('type', $data ?? [], 'text-to-image'); - $this->setIfExists('prompt', $data ?? [], null); - $this->setIfExists('engine', $data ?? [], 'stable-diffusion-xl-1024-v1-0'); - $this->setIfExists('width', $data ?? [], null); - $this->setIfExists('height', $data ?? [], null); - $this->setIfExists('steps', $data ?? [], 30); - $this->setIfExists('seed', $data ?? [], 0); - $this->setIfExists('cfg_scale', $data ?? [], 7); - $this->setIfExists('style_preset', $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 ($this->container['type'] === null) { - $invalidProperties[] = "'type' can't be null"; - } - $allowedValues = $this->getTypeAllowableValues(); - if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { - $invalidProperties[] = sprintf( - "invalid value '%s' for 'type', must be one of '%s'", - $this->container['type'], - implode("', '", $allowedValues) - ); - } - - if ($this->container['prompt'] === null) { - $invalidProperties[] = "'prompt' can't be null"; - } - $allowedValues = $this->getEngineAllowableValues(); - if (!is_null($this->container['engine']) && !in_array($this->container['engine'], $allowedValues, true)) { - $invalidProperties[] = sprintf( - "invalid value '%s' for 'engine', must be one of '%s'", - $this->container['engine'], - implode("', '", $allowedValues) - ); - } - - if ($this->container['width'] === null) { - $invalidProperties[] = "'width' can't be null"; - } - if ($this->container['height'] === null) { - $invalidProperties[] = "'height' can't be null"; - } - $allowedValues = $this->getStylePresetAllowableValues(); - if (!is_null($this->container['style_preset']) && !in_array($this->container['style_preset'], $allowedValues, true)) { - $invalidProperties[] = sprintf( - "invalid value '%s' for 'style_preset', must be one of '%s'", - $this->container['style_preset'], - 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 type - * - * @return string - */ - public function getType() - { - return $this->container['type']; - } - - /** - * Sets type - * - * @param string $type The type of asset to generate - set to `text-to-image` for text-to-image. - * - * @return self - */ - public function setType($type) - { - if (is_null($type)) { - throw new \InvalidArgumentException('non-nullable type cannot be null'); - } - $allowedValues = $this->getTypeAllowableValues(); - if (!in_array($type, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value '%s' for 'type', must be one of '%s'", - $type, - implode("', '", $allowedValues) - ) - ); - } - $this->container['type'] = $type; - - return $this; - } - - /** - * Gets prompt - * - * @return string - */ - public function getPrompt() - { - return $this->container['prompt']; - } - - /** - * Sets prompt - * - * @param string $prompt The text prompt to generate an image from. - * - * @return self - */ - public function setPrompt($prompt) - { - if (is_null($prompt)) { - throw new \InvalidArgumentException('non-nullable prompt cannot be null'); - } - $this->container['prompt'] = $prompt; - - return $this; - } - - /** - * Gets engine - * - * @return string|null - */ - public function getEngine() - { - return $this->container['engine']; - } - - /** - * Sets engine - * - * @param string|null $engine The engine (model) to use for generating the image. Select from the list of available engines:
  • `stable-diffusion-xl-1024-v0-9`
  • `stable-diffusion-xl-1024-v1-0`
  • `stable-diffusion-v1-6`
  • `stable-diffusion-512-v2-1`
  • `stable-diffusion-xl-beta-v2-2-2`
- * - * @return self - */ - public function setEngine($engine) - { - if (is_null($engine)) { - throw new \InvalidArgumentException('non-nullable engine cannot be null'); - } - $allowedValues = $this->getEngineAllowableValues(); - if (!in_array($engine, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value '%s' for 'engine', must be one of '%s'", - $engine, - implode("', '", $allowedValues) - ) - ); - } - $this->container['engine'] = $engine; - - return $this; - } - - /** - * Gets width - * - * @return int - */ - public function getWidth() - { - return $this->container['width']; - } - - /** - * Sets width - * - * @param int $width The width of the image in pixels. Must be divisible by 64. - * - * @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 height - * - * @return int - */ - public function getHeight() - { - return $this->container['height']; - } - - /** - * Sets height - * - * @param int $height The height of the image in pixels. Must be divisible by 64. - * - * @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 steps - * - * @return int|null - */ - public function getSteps() - { - return $this->container['steps']; - } - - /** - * Sets steps - * - * @param int|null $steps The number of iterative diffusion steps to run. A number between 10 and 50. - * - * @return self - */ - public function setSteps($steps) - { - if (is_null($steps)) { - throw new \InvalidArgumentException('non-nullable steps cannot be null'); - } - $this->container['steps'] = $steps; - - return $this; - } - - /** - * Gets seed - * - * @return int|null - */ - public function getSeed() - { - return $this->container['seed']; - } - - /** - * Sets seed - * - * @param int|null $seed Using the same seed can help you create images that look similar. Set to 0 for a random seed. A number between 0 and 4294967295. - * - * @return self - */ - public function setSeed($seed) - { - if (is_null($seed)) { - throw new \InvalidArgumentException('non-nullable seed cannot be null'); - } - $this->container['seed'] = $seed; - - return $this; - } - - /** - * Gets cfg_scale - * - * @return float|null - */ - public function getCfgScale() - { - return $this->container['cfg_scale']; - } - - /** - * Sets cfg_scale - * - * @param float|null $cfg_scale Determines how closely the generated image will match the prompt. Lower numbers allow for more creative freedom. A number between 0 and 35. - * - * @return self - */ - public function setCfgScale($cfg_scale) - { - if (is_null($cfg_scale)) { - throw new \InvalidArgumentException('non-nullable cfg_scale cannot be null'); - } - $this->container['cfg_scale'] = $cfg_scale; - - return $this; - } - - /** - * Gets style_preset - * - * @return string|null - */ - public function getStylePreset() - { - return $this->container['style_preset']; - } - - /** - * Sets style_preset - * - * @param string|null $style_preset Apply a preset to generate an image in a particular style. Select from the list of available presets:
  • `3d-model`
  • `analog-film`
  • `anime`
  • `cinematic`
  • `comic-book`
  • `digital-art`
  • `enhance`
  • `fantasy-art`
  • `isometric`
  • `line-art`
  • `low-poly`
  • `modeling-compound`
  • `neon-punk`
  • `origami`
  • `photographic`
  • `pixel-art`
  • `tile-texture`
- * - * @return self - */ - public function setStylePreset($style_preset) - { - if (is_null($style_preset)) { - throw new \InvalidArgumentException('non-nullable style_preset cannot be null'); - } - $allowedValues = $this->getStylePresetAllowableValues(); - if (!in_array($style_preset, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value '%s' for 'style_preset', must be one of '%s'", - $style_preset, - implode("', '", $allowedValues) - ) - ); - } - $this->container['style_preset'] = $style_preset; - - 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() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/src/Model/ShotstackTextGeneratorOptions.php b/src/Model/SvgAsset.php similarity index 78% rename from src/Model/ShotstackTextGeneratorOptions.php rename to src/Model/SvgAsset.php index ba05593..3ae1551 100644 --- a/src/Model/ShotstackTextGeneratorOptions.php +++ b/src/Model/SvgAsset.php @@ -1,11 +1,11 @@ */ -class ShotstackTextGeneratorOptions implements ModelInterface, ArrayAccess, \JsonSerializable +class SvgAsset implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; @@ -50,7 +50,7 @@ class ShotstackTextGeneratorOptions implements ModelInterface, ArrayAccess, \Jso * * @var string */ - protected static $openAPIModelName = 'ShotstackTextGeneratorOptions'; + protected static $openAPIModelName = 'SvgAsset'; /** * Array of property to type mappings. Used for (de)serialization @@ -59,7 +59,7 @@ class ShotstackTextGeneratorOptions implements ModelInterface, ArrayAccess, \Jso */ protected static $openAPITypes = [ 'type' => 'string', - 'prompt' => 'string' + 'src' => 'string' ]; /** @@ -71,7 +71,7 @@ class ShotstackTextGeneratorOptions implements ModelInterface, ArrayAccess, \Jso */ protected static $openAPIFormats = [ 'type' => null, - 'prompt' => null + 'src' => null ]; /** @@ -81,7 +81,7 @@ class ShotstackTextGeneratorOptions implements ModelInterface, ArrayAccess, \Jso */ protected static array $openAPINullables = [ 'type' => false, - 'prompt' => false + 'src' => false ]; /** @@ -171,7 +171,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'type' => 'type', - 'prompt' => 'prompt' + 'src' => 'src' ]; /** @@ -181,7 +181,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'type' => 'setType', - 'prompt' => 'setPrompt' + 'src' => 'setSrc' ]; /** @@ -191,7 +191,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'type' => 'getType', - 'prompt' => 'getPrompt' + 'src' => 'getSrc' ]; /** @@ -235,7 +235,7 @@ public function getModelName() return self::$openAPIModelName; } - public const TYPE_TEXT_GENERATOR = 'text-generator'; + public const TYPE_SVG = 'svg'; /** * Gets allowable values of the enum @@ -245,7 +245,7 @@ public function getModelName() public function getTypeAllowableValues() { return [ - self::TYPE_TEXT_GENERATOR, + self::TYPE_SVG, ]; } @@ -264,8 +264,8 @@ public function getTypeAllowableValues() */ public function __construct(array $data = null) { - $this->setIfExists('type', $data ?? [], 'text-generator'); - $this->setIfExists('prompt', $data ?? [], null); + $this->setIfExists('type', $data ?? [], 'svg'); + $this->setIfExists('src', $data ?? [], null); } /** @@ -307,9 +307,17 @@ public function listInvalidProperties() ); } - if ($this->container['prompt'] === null) { - $invalidProperties[] = "'prompt' can't be null"; + if ($this->container['src'] === null) { + $invalidProperties[] = "'src' can't be null"; } + if ((mb_strlen($this->container['src']) > 500000)) { + $invalidProperties[] = "invalid value for 'src', the character length must be smaller than or equal to 500000."; + } + + if ((mb_strlen($this->container['src']) < 1)) { + $invalidProperties[] = "invalid value for 'src', the character length must be bigger than or equal to 1."; + } + return $invalidProperties; } @@ -338,7 +346,7 @@ public function getType() /** * Sets type * - * @param string $type The type of asset to generate - set to `text-generator` for text generation. + * @param string $type The asset type - set to `svg` for SVG assets. * * @return self */ @@ -363,28 +371,35 @@ public function setType($type) } /** - * Gets prompt + * Gets src * * @return string */ - public function getPrompt() + public function getSrc() { - return $this->container['prompt']; + return $this->container['src']; } /** - * Sets prompt + * Sets src * - * @param string $prompt The text prompt to generate text from. + * @param string $src Raw SVG markup string. The SVG must contain valid SVG elements. The shape, fill, stroke, dimensions and opacity are automatically extracted from the SVG content. * * @return self */ - public function setPrompt($prompt) + public function setSrc($src) { - if (is_null($prompt)) { - throw new \InvalidArgumentException('non-nullable prompt cannot be null'); + if (is_null($src)) { + throw new \InvalidArgumentException('non-nullable src cannot be null'); } - $this->container['prompt'] = $prompt; + if ((mb_strlen($src) > 500000)) { + throw new \InvalidArgumentException('invalid length for $src when calling SvgAsset., must be smaller than or equal to 500000.'); + } + if ((mb_strlen($src) < 1)) { + throw new \InvalidArgumentException('invalid length for $src when calling SvgAsset., must be bigger than or equal to 1.'); + } + + $this->container['src'] = $src; return $this; } diff --git a/src/Model/Template.php b/src/Model/Template.php index 69edcaa..b5b73c2 100644 --- a/src/Model/Template.php +++ b/src/Model/Template.php @@ -5,7 +5,7 @@ * PHP version 7.4 * * @category Class - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech */ @@ -26,17 +26,17 @@ * Do not edit the class manually. */ -namespace Shotstack\Client\Model; +namespace ShotstackClient\Model; use \ArrayAccess; -use \Shotstack\Client\ObjectSerializer; +use \ShotstackClient\ObjectSerializer; /** * Template Class Doc Comment * * @category Class * @description A template is a saved [Edit](#tocs_edit) than can be loaded and re-used. - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech * @implements \ArrayAccess @@ -59,7 +59,7 @@ class Template implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPITypes = [ 'name' => 'string', - 'template' => '\Shotstack\Client\Model\Edit' + 'template' => '\ShotstackClient\Model\Edit' ]; /** @@ -330,7 +330,7 @@ public function setName($name) /** * Gets template * - * @return \Shotstack\Client\Model\Edit|null + * @return \ShotstackClient\Model\Edit|null */ public function getTemplate() { @@ -340,7 +340,7 @@ public function getTemplate() /** * Sets template * - * @param \Shotstack\Client\Model\Edit|null $template template + * @param \ShotstackClient\Model\Edit|null $template template * * @return self */ diff --git a/src/Model/TemplateDataResponse.php b/src/Model/TemplateDataResponse.php index 094b69c..f36506c 100644 --- a/src/Model/TemplateDataResponse.php +++ b/src/Model/TemplateDataResponse.php @@ -5,7 +5,7 @@ * PHP version 7.4 * * @category Class - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech */ @@ -26,17 +26,17 @@ * Do not edit the class manually. */ -namespace Shotstack\Client\Model; +namespace ShotstackClient\Model; use \ArrayAccess; -use \Shotstack\Client\ObjectSerializer; +use \ShotstackClient\ObjectSerializer; /** * TemplateDataResponse Class Doc Comment * * @category Class * @description The template data including the template name and [Edit](#tocs_edit). - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech * @implements \ArrayAccess @@ -60,7 +60,7 @@ class TemplateDataResponse implements ModelInterface, ArrayAccess, \JsonSerializ protected static $openAPITypes = [ 'success' => 'bool', 'message' => 'string', - 'response' => '\Shotstack\Client\Model\TemplateDataResponseData' + 'response' => '\ShotstackClient\Model\TemplateDataResponseData' ]; /** @@ -370,7 +370,7 @@ public function setMessage($message) /** * Gets response * - * @return \Shotstack\Client\Model\TemplateDataResponseData + * @return \ShotstackClient\Model\TemplateDataResponseData */ public function getResponse() { @@ -380,7 +380,7 @@ public function getResponse() /** * Sets response * - * @param \Shotstack\Client\Model\TemplateDataResponseData $response response + * @param \ShotstackClient\Model\TemplateDataResponseData $response response * * @return self */ diff --git a/src/Model/TemplateDataResponseData.php b/src/Model/TemplateDataResponseData.php index b1aadaa..fd84da4 100644 --- a/src/Model/TemplateDataResponseData.php +++ b/src/Model/TemplateDataResponseData.php @@ -5,7 +5,7 @@ * PHP version 7.4 * * @category Class - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech */ @@ -26,17 +26,17 @@ * Do not edit the class manually. */ -namespace Shotstack\Client\Model; +namespace ShotstackClient\Model; use \ArrayAccess; -use \Shotstack\Client\ObjectSerializer; +use \ShotstackClient\ObjectSerializer; /** * TemplateDataResponseData Class Doc Comment * * @category Class * @description The response data returned with the [TemplateDataResponse](#tocs_templatedataresponse). - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech * @implements \ArrayAccess @@ -61,7 +61,7 @@ class TemplateDataResponseData implements ModelInterface, ArrayAccess, \JsonSeri 'id' => 'string', 'name' => 'string', 'owner' => 'string', - 'template' => '\Shotstack\Client\Model\Edit' + 'template' => '\ShotstackClient\Model\Edit' ]; /** @@ -407,7 +407,7 @@ public function setOwner($owner) /** * Gets template * - * @return \Shotstack\Client\Model\Edit + * @return \ShotstackClient\Model\Edit */ public function getTemplate() { @@ -417,7 +417,7 @@ public function getTemplate() /** * Sets template * - * @param \Shotstack\Client\Model\Edit $template template + * @param \ShotstackClient\Model\Edit $template template * * @return self */ diff --git a/src/Model/TemplateListResponse.php b/src/Model/TemplateListResponse.php index 32bea36..fc527f8 100644 --- a/src/Model/TemplateListResponse.php +++ b/src/Model/TemplateListResponse.php @@ -5,7 +5,7 @@ * PHP version 7.4 * * @category Class - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech */ @@ -26,17 +26,17 @@ * Do not edit the class manually. */ -namespace Shotstack\Client\Model; +namespace ShotstackClient\Model; use \ArrayAccess; -use \Shotstack\Client\ObjectSerializer; +use \ShotstackClient\ObjectSerializer; /** * TemplateListResponse Class Doc Comment * * @category Class * @description A list of previously saved templates. - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech * @implements \ArrayAccess @@ -60,7 +60,7 @@ class TemplateListResponse implements ModelInterface, ArrayAccess, \JsonSerializ protected static $openAPITypes = [ 'success' => 'bool', 'message' => 'string', - 'response' => '\Shotstack\Client\Model\TemplateListResponseData' + 'response' => '\ShotstackClient\Model\TemplateListResponseData' ]; /** @@ -370,7 +370,7 @@ public function setMessage($message) /** * Gets response * - * @return \Shotstack\Client\Model\TemplateListResponseData + * @return \ShotstackClient\Model\TemplateListResponseData */ public function getResponse() { @@ -380,7 +380,7 @@ public function getResponse() /** * Sets response * - * @param \Shotstack\Client\Model\TemplateListResponseData $response response + * @param \ShotstackClient\Model\TemplateListResponseData $response response * * @return self */ diff --git a/src/Model/TemplateListResponseData.php b/src/Model/TemplateListResponseData.php index ae74e80..04513c9 100644 --- a/src/Model/TemplateListResponseData.php +++ b/src/Model/TemplateListResponseData.php @@ -5,7 +5,7 @@ * PHP version 7.4 * * @category Class - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech */ @@ -26,17 +26,17 @@ * Do not edit the class manually. */ -namespace Shotstack\Client\Model; +namespace ShotstackClient\Model; use \ArrayAccess; -use \Shotstack\Client\ObjectSerializer; +use \ShotstackClient\ObjectSerializer; /** * TemplateListResponseData Class Doc Comment * * @category Class * @description The response data returned with the [TemplateListResponse](#tocs_templatelistresponse). - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech * @implements \ArrayAccess @@ -59,7 +59,7 @@ class TemplateListResponseData implements ModelInterface, ArrayAccess, \JsonSeri */ protected static $openAPITypes = [ 'owner' => 'string', - 'templates' => '\Shotstack\Client\Model\TemplateListResponseItem[]' + 'templates' => '\ShotstackClient\Model\TemplateListResponseItem[]' ]; /** @@ -333,7 +333,7 @@ public function setOwner($owner) /** * Gets templates * - * @return \Shotstack\Client\Model\TemplateListResponseItem[] + * @return \ShotstackClient\Model\TemplateListResponseItem[] */ public function getTemplates() { @@ -343,7 +343,7 @@ public function getTemplates() /** * Sets templates * - * @param \Shotstack\Client\Model\TemplateListResponseItem[] $templates The list of templates. + * @param \ShotstackClient\Model\TemplateListResponseItem[] $templates The list of templates. * * @return self */ diff --git a/src/Model/TemplateListResponseItem.php b/src/Model/TemplateListResponseItem.php index 6223968..15ac9db 100644 --- a/src/Model/TemplateListResponseItem.php +++ b/src/Model/TemplateListResponseItem.php @@ -5,7 +5,7 @@ * PHP version 7.4 * * @category Class - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech */ @@ -26,17 +26,17 @@ * Do not edit the class manually. */ -namespace Shotstack\Client\Model; +namespace ShotstackClient\Model; use \ArrayAccess; -use \Shotstack\Client\ObjectSerializer; +use \ShotstackClient\ObjectSerializer; /** * TemplateListResponseItem Class Doc Comment * * @category Class * @description The individual template item returned with the [TemplateListResponseData](#tocs_templatelistresponsedata) templates list. - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech * @implements \ArrayAccess diff --git a/src/Model/TemplateRender.php b/src/Model/TemplateRender.php index c615138..0920c37 100644 --- a/src/Model/TemplateRender.php +++ b/src/Model/TemplateRender.php @@ -5,7 +5,7 @@ * PHP version 7.4 * * @category Class - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech */ @@ -26,17 +26,17 @@ * Do not edit the class manually. */ -namespace Shotstack\Client\Model; +namespace ShotstackClient\Model; use \ArrayAccess; -use \Shotstack\Client\ObjectSerializer; +use \ShotstackClient\ObjectSerializer; /** * TemplateRender Class Doc Comment * * @category Class * @description Configure the id and optional merge fields to render a template by id. - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech * @implements \ArrayAccess @@ -59,7 +59,7 @@ class TemplateRender implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPITypes = [ 'id' => 'string', - 'merge' => '\Shotstack\Client\Model\MergeField[]' + 'merge' => '\ShotstackClient\Model\MergeField[]' ]; /** @@ -330,7 +330,7 @@ public function setId($id) /** * Gets merge * - * @return \Shotstack\Client\Model\MergeField[]|null + * @return \ShotstackClient\Model\MergeField[]|null */ public function getMerge() { @@ -340,7 +340,7 @@ public function getMerge() /** * Sets merge * - * @param \Shotstack\Client\Model\MergeField[]|null $merge An array of key/value pairs that provides an easy way to create templates with placeholders. The placeholders can be used to find and replace keys with values. For example you can search for the placeholder `{{NAME}}` and replace it with the value `Jane`. + * @param \ShotstackClient\Model\MergeField[]|null $merge An array of key/value pairs that provides an easy way to create templates with placeholders. The placeholders can be used to find and replace keys with values. For example you can search for the placeholder `{{NAME}}` and replace it with the value `Jane`. * * @return self */ diff --git a/src/Model/TemplateResponse.php b/src/Model/TemplateResponse.php index 6e2a599..cf97b95 100644 --- a/src/Model/TemplateResponse.php +++ b/src/Model/TemplateResponse.php @@ -5,7 +5,7 @@ * PHP version 7.4 * * @category Class - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech */ @@ -26,17 +26,17 @@ * Do not edit the class manually. */ -namespace Shotstack\Client\Model; +namespace ShotstackClient\Model; use \ArrayAccess; -use \Shotstack\Client\ObjectSerializer; +use \ShotstackClient\ObjectSerializer; /** * TemplateResponse Class Doc Comment * * @category Class * @description The response received after a [template](#create-template) is submitted. The template is saved and a unique template id is returned. - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech * @implements \ArrayAccess @@ -60,7 +60,7 @@ class TemplateResponse implements ModelInterface, ArrayAccess, \JsonSerializable protected static $openAPITypes = [ 'success' => 'bool', 'message' => 'string', - 'response' => '\Shotstack\Client\Model\TemplateResponseData' + 'response' => '\ShotstackClient\Model\TemplateResponseData' ]; /** @@ -370,7 +370,7 @@ public function setMessage($message) /** * Gets response * - * @return \Shotstack\Client\Model\TemplateResponseData + * @return \ShotstackClient\Model\TemplateResponseData */ public function getResponse() { @@ -380,7 +380,7 @@ public function getResponse() /** * Sets response * - * @param \Shotstack\Client\Model\TemplateResponseData $response response + * @param \ShotstackClient\Model\TemplateResponseData $response response * * @return self */ diff --git a/src/Model/TemplateResponseData.php b/src/Model/TemplateResponseData.php index 8a4e5b4..bfa2ff1 100644 --- a/src/Model/TemplateResponseData.php +++ b/src/Model/TemplateResponseData.php @@ -5,7 +5,7 @@ * PHP version 7.4 * * @category Class - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech */ @@ -26,17 +26,17 @@ * Do not edit the class manually. */ -namespace Shotstack\Client\Model; +namespace ShotstackClient\Model; use \ArrayAccess; -use \Shotstack\Client\ObjectSerializer; +use \ShotstackClient\ObjectSerializer; /** * TemplateResponseData Class Doc Comment * * @category Class * @description The response data returned with the [TemplateResponse](#tocs_templateresponse). - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech * @implements \ArrayAccess diff --git a/src/Model/TextAlignment.php b/src/Model/TextAlignment.php new file mode 100644 index 0000000..150cf62 --- /dev/null +++ b/src/Model/TextAlignment.php @@ -0,0 +1,516 @@ + + */ +class TextAlignment implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'TextAlignment'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'horizontal' => 'string', + 'vertical' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'horizontal' => null, + 'vertical' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'horizontal' => false, + 'vertical' => 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; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $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 = [ + 'horizontal' => 'horizontal', + 'vertical' => 'vertical' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'horizontal' => 'setHorizontal', + 'vertical' => 'setVertical' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'horizontal' => 'getHorizontal', + 'vertical' => 'getVertical' + ]; + + /** + * 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 HORIZONTAL_LEFT = 'left'; + public const HORIZONTAL_CENTER = 'center'; + public const HORIZONTAL_RIGHT = 'right'; + public const VERTICAL_TOP = 'top'; + public const VERTICAL_CENTER = 'center'; + public const VERTICAL_BOTTOM = 'bottom'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getHorizontalAllowableValues() + { + return [ + self::HORIZONTAL_LEFT, + self::HORIZONTAL_CENTER, + self::HORIZONTAL_RIGHT, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getVerticalAllowableValues() + { + return [ + self::VERTICAL_TOP, + self::VERTICAL_CENTER, + self::VERTICAL_BOTTOM, + ]; + } + + /** + * 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) + { + $this->setIfExists('horizontal', $data ?? [], null); + $this->setIfExists('vertical', $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->getHorizontalAllowableValues(); + if (!is_null($this->container['horizontal']) && !in_array($this->container['horizontal'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'horizontal', must be one of '%s'", + $this->container['horizontal'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getVerticalAllowableValues(); + if (!is_null($this->container['vertical']) && !in_array($this->container['vertical'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'vertical', must be one of '%s'", + $this->container['vertical'], + 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 horizontal + * + * @return string|null + */ + public function getHorizontal() + { + return $this->container['horizontal']; + } + + /** + * Sets horizontal + * + * @param string|null $horizontal The horizontal alignment of the text. Value must be one of:
  • `left`
  • `center`
  • `right`
+ * + * @return self + */ + public function setHorizontal($horizontal) + { + if (is_null($horizontal)) { + throw new \InvalidArgumentException('non-nullable horizontal cannot be null'); + } + $allowedValues = $this->getHorizontalAllowableValues(); + if (!in_array($horizontal, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'horizontal', must be one of '%s'", + $horizontal, + implode("', '", $allowedValues) + ) + ); + } + $this->container['horizontal'] = $horizontal; + + return $this; + } + + /** + * Gets vertical + * + * @return string|null + */ + public function getVertical() + { + return $this->container['vertical']; + } + + /** + * Sets vertical + * + * @param string|null $vertical The vertical alignment of the text. Value must be one of:
  • `top`
  • `center`
  • `bottom`
+ * + * @return self + */ + public function setVertical($vertical) + { + if (is_null($vertical)) { + throw new \InvalidArgumentException('non-nullable vertical cannot be null'); + } + $allowedValues = $this->getVerticalAllowableValues(); + if (!in_array($vertical, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'vertical', must be one of '%s'", + $vertical, + implode("', '", $allowedValues) + ) + ); + } + $this->container['vertical'] = $vertical; + + 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() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/DIDTextToAvatarOptions.php b/src/Model/TextAsset.php similarity index 62% rename from src/Model/DIDTextToAvatarOptions.php rename to src/Model/TextAsset.php index 10a31c9..e7e955a 100644 --- a/src/Model/DIDTextToAvatarOptions.php +++ b/src/Model/TextAsset.php @@ -1,11 +1,11 @@ */ -class DIDTextToAvatarOptions implements ModelInterface, ArrayAccess, \JsonSerializable +class TextAsset implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; @@ -50,7 +50,7 @@ class DIDTextToAvatarOptions implements ModelInterface, ArrayAccess, \JsonSerial * * @var string */ - protected static $openAPIModelName = 'DIDTextToAvatarOptions'; + protected static $openAPIModelName = 'TextAsset'; /** * Array of property to type mappings. Used for (de)serialization @@ -60,8 +60,14 @@ class DIDTextToAvatarOptions implements ModelInterface, ArrayAccess, \JsonSerial protected static $openAPITypes = [ 'type' => 'string', 'text' => 'string', - 'avatar' => 'string', - 'background' => 'string' + 'width' => 'int', + 'height' => 'int', + 'font' => '\ShotstackClient\Model\TextFont', + 'background' => '\ShotstackClient\Model\TextBackground', + 'alignment' => '\ShotstackClient\Model\TextAlignment', + 'stroke' => '\ShotstackClient\Model\TextAssetStroke', + 'animation' => '\ShotstackClient\Model\TextAssetAnimation', + 'ellipsis' => 'string' ]; /** @@ -74,8 +80,14 @@ class DIDTextToAvatarOptions implements ModelInterface, ArrayAccess, \JsonSerial protected static $openAPIFormats = [ 'type' => null, 'text' => null, - 'avatar' => null, - 'background' => null + 'width' => null, + 'height' => null, + 'font' => null, + 'background' => null, + 'alignment' => null, + 'stroke' => null, + 'animation' => null, + 'ellipsis' => null ]; /** @@ -86,8 +98,14 @@ class DIDTextToAvatarOptions implements ModelInterface, ArrayAccess, \JsonSerial protected static array $openAPINullables = [ 'type' => false, 'text' => false, - 'avatar' => false, - 'background' => false + 'width' => false, + 'height' => false, + 'font' => false, + 'background' => false, + 'alignment' => false, + 'stroke' => false, + 'animation' => false, + 'ellipsis' => false ]; /** @@ -178,8 +196,14 @@ public function isNullableSetToNull(string $property): bool protected static $attributeMap = [ 'type' => 'type', 'text' => 'text', - 'avatar' => 'avatar', - 'background' => 'background' + 'width' => 'width', + 'height' => 'height', + 'font' => 'font', + 'background' => 'background', + 'alignment' => 'alignment', + 'stroke' => 'stroke', + 'animation' => 'animation', + 'ellipsis' => 'ellipsis' ]; /** @@ -190,8 +214,14 @@ public function isNullableSetToNull(string $property): bool protected static $setters = [ 'type' => 'setType', 'text' => 'setText', - 'avatar' => 'setAvatar', - 'background' => 'setBackground' + 'width' => 'setWidth', + 'height' => 'setHeight', + 'font' => 'setFont', + 'background' => 'setBackground', + 'alignment' => 'setAlignment', + 'stroke' => 'setStroke', + 'animation' => 'setAnimation', + 'ellipsis' => 'setEllipsis' ]; /** @@ -202,8 +232,14 @@ public function isNullableSetToNull(string $property): bool protected static $getters = [ 'type' => 'getType', 'text' => 'getText', - 'avatar' => 'getAvatar', - 'background' => 'getBackground' + 'width' => 'getWidth', + 'height' => 'getHeight', + 'font' => 'getFont', + 'background' => 'getBackground', + 'alignment' => 'getAlignment', + 'stroke' => 'getStroke', + 'animation' => 'getAnimation', + 'ellipsis' => 'getEllipsis' ]; /** @@ -247,12 +283,7 @@ public function getModelName() return self::$openAPIModelName; } - public const TYPE_TEXT_TO_AVATAR = 'text-to-avatar'; - public const AVATAR_JACK = 'jack'; - public const AVATAR_LANA = 'lana'; - public const AVATAR_LILY = 'lily'; - public const AVATAR_MATT = 'matt'; - public const AVATAR_RIAN = 'rian'; + public const TYPE_TEXT = 'text'; /** * Gets allowable values of the enum @@ -262,23 +293,7 @@ public function getModelName() public function getTypeAllowableValues() { return [ - self::TYPE_TEXT_TO_AVATAR, - ]; - } - - /** - * Gets allowable values of the enum - * - * @return string[] - */ - public function getAvatarAllowableValues() - { - return [ - self::AVATAR_JACK, - self::AVATAR_LANA, - self::AVATAR_LILY, - self::AVATAR_MATT, - self::AVATAR_RIAN, + self::TYPE_TEXT, ]; } @@ -297,10 +312,16 @@ public function getAvatarAllowableValues() */ public function __construct(array $data = null) { - $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('type', $data ?? [], 'text'); $this->setIfExists('text', $data ?? [], null); - $this->setIfExists('avatar', $data ?? [], null); + $this->setIfExists('width', $data ?? [], null); + $this->setIfExists('height', $data ?? [], null); + $this->setIfExists('font', $data ?? [], null); $this->setIfExists('background', $data ?? [], null); + $this->setIfExists('alignment', $data ?? [], null); + $this->setIfExists('stroke', $data ?? [], null); + $this->setIfExists('animation', $data ?? [], null); + $this->setIfExists('ellipsis', $data ?? [], null); } /** @@ -345,18 +366,6 @@ public function listInvalidProperties() if ($this->container['text'] === null) { $invalidProperties[] = "'text' can't be null"; } - if ($this->container['avatar'] === null) { - $invalidProperties[] = "'avatar' can't be null"; - } - $allowedValues = $this->getAvatarAllowableValues(); - if (!is_null($this->container['avatar']) && !in_array($this->container['avatar'], $allowedValues, true)) { - $invalidProperties[] = sprintf( - "invalid value '%s' for 'avatar', must be one of '%s'", - $this->container['avatar'], - implode("', '", $allowedValues) - ); - } - return $invalidProperties; } @@ -385,7 +394,7 @@ public function getType() /** * Sets type * - * @param string $type The type of asset to generate - set to `text-to-avatar` for text-to-avatar. + * @param string $type The type of asset - set to `text` for text. * * @return self */ @@ -422,7 +431,7 @@ public function getText() /** * Sets text * - * @param string $text The text or script that the avatar will narrate. + * @param string $text The text string to display. * * @return self */ @@ -437,38 +446,82 @@ public function setText($text) } /** - * Gets avatar + * Gets width * - * @return string + * @return int|null */ - public function getAvatar() + public function getWidth() { - return $this->container['avatar']; + return $this->container['width']; } /** - * Sets avatar + * Sets width * - * @param string $avatar The avatar character to generate. Select from the list of available avatars:
  • `jack`
  • `lana`
  • `lily`
  • `matt`
  • `rian`
+ * @param int|null $width Set the width of the HTML asset bounding box in pixels. Text will wrap to fill the bounding box. * * @return self */ - public function setAvatar($avatar) + public function setWidth($width) { - if (is_null($avatar)) { - throw new \InvalidArgumentException('non-nullable avatar cannot be null'); + if (is_null($width)) { + throw new \InvalidArgumentException('non-nullable width cannot be null'); } - $allowedValues = $this->getAvatarAllowableValues(); - if (!in_array($avatar, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value '%s' for 'avatar', must be one of '%s'", - $avatar, - implode("', '", $allowedValues) - ) - ); + $this->container['width'] = $width; + + return $this; + } + + /** + * Gets height + * + * @return int|null + */ + public function getHeight() + { + return $this->container['height']; + } + + /** + * Sets height + * + * @param int|null $height Set the width of the HTML asset bounding box in pixels. Text and elements will be masked if they exceed the height of the bounding box. + * + * @return self + */ + public function setHeight($height) + { + if (is_null($height)) { + throw new \InvalidArgumentException('non-nullable height cannot be null'); } - $this->container['avatar'] = $avatar; + $this->container['height'] = $height; + + return $this; + } + + /** + * Gets font + * + * @return \ShotstackClient\Model\TextFont|null + */ + public function getFont() + { + return $this->container['font']; + } + + /** + * Sets font + * + * @param \ShotstackClient\Model\TextFont|null $font font + * + * @return self + */ + public function setFont($font) + { + if (is_null($font)) { + throw new \InvalidArgumentException('non-nullable font cannot be null'); + } + $this->container['font'] = $font; return $this; } @@ -476,7 +529,7 @@ public function setAvatar($avatar) /** * Gets background * - * @return string|null + * @return \ShotstackClient\Model\TextBackground|null */ public function getBackground() { @@ -486,7 +539,7 @@ public function getBackground() /** * Sets background * - * @param string|null $background The background color of the video. + * @param \ShotstackClient\Model\TextBackground|null $background background * * @return self */ @@ -499,6 +552,114 @@ public function setBackground($background) return $this; } + + /** + * Gets alignment + * + * @return \ShotstackClient\Model\TextAlignment|null + */ + public function getAlignment() + { + return $this->container['alignment']; + } + + /** + * Sets alignment + * + * @param \ShotstackClient\Model\TextAlignment|null $alignment alignment + * + * @return self + */ + public function setAlignment($alignment) + { + if (is_null($alignment)) { + throw new \InvalidArgumentException('non-nullable alignment cannot be null'); + } + $this->container['alignment'] = $alignment; + + return $this; + } + + /** + * Gets stroke + * + * @return \ShotstackClient\Model\TextAssetStroke|null + */ + public function getStroke() + { + return $this->container['stroke']; + } + + /** + * Sets stroke + * + * @param \ShotstackClient\Model\TextAssetStroke|null $stroke stroke + * + * @return self + */ + public function setStroke($stroke) + { + if (is_null($stroke)) { + throw new \InvalidArgumentException('non-nullable stroke cannot be null'); + } + $this->container['stroke'] = $stroke; + + return $this; + } + + /** + * Gets animation + * + * @return \ShotstackClient\Model\TextAssetAnimation|null + */ + public function getAnimation() + { + return $this->container['animation']; + } + + /** + * Sets animation + * + * @param \ShotstackClient\Model\TextAssetAnimation|null $animation animation + * + * @return self + */ + public function setAnimation($animation) + { + if (is_null($animation)) { + throw new \InvalidArgumentException('non-nullable animation cannot be null'); + } + $this->container['animation'] = $animation; + + return $this; + } + + /** + * Gets ellipsis + * + * @return string|null + */ + public function getEllipsis() + { + return $this->container['ellipsis']; + } + + /** + * Sets ellipsis + * + * @param string|null $ellipsis The string to display when text overflows its bounding box. Set to an ellipsis character or custom string to indicate truncated text. + * + * @return self + */ + public function setEllipsis($ellipsis) + { + if (is_null($ellipsis)) { + throw new \InvalidArgumentException('non-nullable ellipsis cannot be null'); + } + $this->container['ellipsis'] = $ellipsis; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/src/Model/ElevenLabsGeneratedAsset.php b/src/Model/TextAssetAnimation.php similarity index 73% rename from src/Model/ElevenLabsGeneratedAsset.php rename to src/Model/TextAssetAnimation.php index c47b752..5129234 100644 --- a/src/Model/ElevenLabsGeneratedAsset.php +++ b/src/Model/TextAssetAnimation.php @@ -1,11 +1,11 @@ */ -class ElevenLabsGeneratedAsset implements ModelInterface, ArrayAccess, \JsonSerializable +class TextAssetAnimation implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; @@ -50,7 +50,7 @@ class ElevenLabsGeneratedAsset implements ModelInterface, ArrayAccess, \JsonSeri * * @var string */ - protected static $openAPIModelName = 'ElevenLabsGeneratedAsset'; + protected static $openAPIModelName = 'TextAsset_animation'; /** * Array of property to type mappings. Used for (de)serialization @@ -58,8 +58,8 @@ class ElevenLabsGeneratedAsset implements ModelInterface, ArrayAccess, \JsonSeri * @var string[] */ protected static $openAPITypes = [ - 'provider' => 'string', - 'options' => '\Shotstack\Client\Model\ElevenLabsGeneratedAssetOptions' + 'preset' => 'string', + 'duration' => 'float' ]; /** @@ -70,8 +70,8 @@ class ElevenLabsGeneratedAsset implements ModelInterface, ArrayAccess, \JsonSeri * @psalm-var array */ protected static $openAPIFormats = [ - 'provider' => null, - 'options' => null + 'preset' => null, + 'duration' => null ]; /** @@ -80,8 +80,8 @@ class ElevenLabsGeneratedAsset implements ModelInterface, ArrayAccess, \JsonSeri * @var boolean[] */ protected static array $openAPINullables = [ - 'provider' => false, - 'options' => false + 'preset' => false, + 'duration' => false ]; /** @@ -170,8 +170,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'provider' => 'provider', - 'options' => 'options' + 'preset' => 'preset', + 'duration' => 'duration' ]; /** @@ -180,8 +180,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'provider' => 'setProvider', - 'options' => 'setOptions' + 'preset' => 'setPreset', + 'duration' => 'setDuration' ]; /** @@ -190,8 +190,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'provider' => 'getProvider', - 'options' => 'getOptions' + 'preset' => 'getPreset', + 'duration' => 'getDuration' ]; /** @@ -235,17 +235,17 @@ public function getModelName() return self::$openAPIModelName; } - public const PROVIDER_ELEVENLABS = 'elevenlabs'; + public const PRESET_TYPEWRITER = 'typewriter'; /** * Gets allowable values of the enum * * @return string[] */ - public function getProviderAllowableValues() + public function getPresetAllowableValues() { return [ - self::PROVIDER_ELEVENLABS, + self::PRESET_TYPEWRITER, ]; } @@ -264,8 +264,8 @@ public function getProviderAllowableValues() */ public function __construct(array $data = null) { - $this->setIfExists('provider', $data ?? [], 'elevenlabs'); - $this->setIfExists('options', $data ?? [], null); + $this->setIfExists('preset', $data ?? [], null); + $this->setIfExists('duration', $data ?? [], null); } /** @@ -295,21 +295,26 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['provider'] === null) { - $invalidProperties[] = "'provider' can't be null"; + if ($this->container['preset'] === null) { + $invalidProperties[] = "'preset' can't be null"; } - $allowedValues = $this->getProviderAllowableValues(); - if (!is_null($this->container['provider']) && !in_array($this->container['provider'], $allowedValues, true)) { + $allowedValues = $this->getPresetAllowableValues(); + if (!is_null($this->container['preset']) && !in_array($this->container['preset'], $allowedValues, true)) { $invalidProperties[] = sprintf( - "invalid value '%s' for 'provider', must be one of '%s'", - $this->container['provider'], + "invalid value '%s' for 'preset', must be one of '%s'", + $this->container['preset'], implode("', '", $allowedValues) ); } - if ($this->container['options'] === null) { - $invalidProperties[] = "'options' can't be null"; + if (!is_null($this->container['duration']) && ($this->container['duration'] > 30)) { + $invalidProperties[] = "invalid value for 'duration', must be smaller than or equal to 30."; } + + if (!is_null($this->container['duration']) && ($this->container['duration'] < 0.1)) { + $invalidProperties[] = "invalid value for 'duration', must be bigger than or equal to 0.1."; + } + return $invalidProperties; } @@ -326,65 +331,73 @@ public function valid() /** - * Gets provider + * Gets preset * * @return string */ - public function getProvider() + public function getPreset() { - return $this->container['provider']; + return $this->container['preset']; } /** - * Sets provider + * Sets preset * - * @param string $provider The name of the provider - set to `elevenlabs` for ElevenLabs. + * @param string $preset The animation preset to apply.
  • `typewriter` - typewriter effect where characters appear one at a time
* * @return self */ - public function setProvider($provider) + public function setPreset($preset) { - if (is_null($provider)) { - throw new \InvalidArgumentException('non-nullable provider cannot be null'); + if (is_null($preset)) { + throw new \InvalidArgumentException('non-nullable preset cannot be null'); } - $allowedValues = $this->getProviderAllowableValues(); - if (!in_array($provider, $allowedValues, true)) { + $allowedValues = $this->getPresetAllowableValues(); + if (!in_array($preset, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( - "Invalid value '%s' for 'provider', must be one of '%s'", - $provider, + "Invalid value '%s' for 'preset', must be one of '%s'", + $preset, implode("', '", $allowedValues) ) ); } - $this->container['provider'] = $provider; + $this->container['preset'] = $preset; return $this; } /** - * Gets options + * Gets duration * - * @return \Shotstack\Client\Model\ElevenLabsGeneratedAssetOptions + * @return float|null */ - public function getOptions() + public function getDuration() { - return $this->container['options']; + return $this->container['duration']; } /** - * Sets options + * Sets duration * - * @param \Shotstack\Client\Model\ElevenLabsGeneratedAssetOptions $options options + * @param float|null $duration The duration of the animation in seconds. * * @return self */ - public function setOptions($options) + public function setDuration($duration) { - if (is_null($options)) { - throw new \InvalidArgumentException('non-nullable options cannot be null'); + if (is_null($duration)) { + throw new \InvalidArgumentException('non-nullable duration cannot be null'); } - $this->container['options'] = $options; + + if (($duration > 30)) { + throw new \InvalidArgumentException('invalid value for $duration when calling TextAssetAnimation., must be smaller than or equal to 30.'); + } + if (($duration < 0.1)) { + throw new \InvalidArgumentException('invalid value for $duration when calling TextAssetAnimation., must be bigger than or equal to 0.1.'); + } + + $this->container['duration'] = $duration; return $this; } diff --git a/src/Model/TextAssetStroke.php b/src/Model/TextAssetStroke.php new file mode 100644 index 0000000..92b0f22 --- /dev/null +++ b/src/Model/TextAssetStroke.php @@ -0,0 +1,469 @@ + + */ +class TextAssetStroke implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'TextAsset_stroke'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'width' => 'float', + 'color' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'width' => null, + 'color' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'width' => false, + 'color' => 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; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $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 = [ + 'width' => 'width', + 'color' => 'color' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'width' => 'setWidth', + 'color' => 'setColor' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'width' => 'getWidth', + 'color' => 'getColor' + ]; + + /** + * 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) + { + $this->setIfExists('width', $data ?? [], null); + $this->setIfExists('color', $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['width']) && ($this->container['width'] > 10)) { + $invalidProperties[] = "invalid value for 'width', must be smaller than or equal to 10."; + } + + if (!is_null($this->container['width']) && ($this->container['width'] < 0)) { + $invalidProperties[] = "invalid value for 'width', must be bigger than or equal to 0."; + } + + if (!is_null($this->container['color']) && !preg_match("/^#[A-Fa-f0-9]{6}$/", $this->container['color'])) { + $invalidProperties[] = "invalid value for 'color', must be conform to the pattern /^#[A-Fa-f0-9]{6}$/."; + } + + 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 width + * + * @return float|null + */ + public function getWidth() + { + return $this->container['width']; + } + + /** + * Sets width + * + * @param float|null $width The width of the stroke in pixels. + * + * @return self + */ + public function setWidth($width) + { + if (is_null($width)) { + throw new \InvalidArgumentException('non-nullable width cannot be null'); + } + + if (($width > 10)) { + throw new \InvalidArgumentException('invalid value for $width when calling TextAssetStroke., must be smaller than or equal to 10.'); + } + if (($width < 0)) { + throw new \InvalidArgumentException('invalid value for $width when calling TextAssetStroke., must be bigger than or equal to 0.'); + } + + $this->container['width'] = $width; + + return $this; + } + + /** + * Gets color + * + * @return string|null + */ + public function getColor() + { + return $this->container['color']; + } + + /** + * Sets color + * + * @param string|null $color The stroke color using hexadecimal color notation. + * + * @return self + */ + public function setColor($color) + { + if (is_null($color)) { + throw new \InvalidArgumentException('non-nullable color cannot be null'); + } + + if ((!preg_match("/^#[A-Fa-f0-9]{6}$/", ObjectSerializer::toString($color)))) { + throw new \InvalidArgumentException("invalid value for \$color when calling TextAssetStroke., must conform to the pattern /^#[A-Fa-f0-9]{6}$/."); + } + + $this->container['color'] = $color; + + 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() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ElevenLabsGeneratedAssetOptions.php b/src/Model/TextBackground.php similarity index 60% rename from src/Model/ElevenLabsGeneratedAssetOptions.php rename to src/Model/TextBackground.php index 8ad4c21..ea31b91 100644 --- a/src/Model/ElevenLabsGeneratedAssetOptions.php +++ b/src/Model/TextBackground.php @@ -1,11 +1,11 @@ */ -class ElevenLabsGeneratedAssetOptions implements ModelInterface, ArrayAccess, \JsonSerializable +class TextBackground implements ModelInterface, ArrayAccess, \JsonSerializable { - public const DISCRIMINATOR = 'type'; + public const DISCRIMINATOR = null; /** * The original name of the model. * * @var string */ - protected static $openAPIModelName = 'ElevenLabsGeneratedAssetOptions'; + protected static $openAPIModelName = 'TextBackground'; /** * Array of property to type mappings. Used for (de)serialization @@ -58,9 +58,10 @@ class ElevenLabsGeneratedAssetOptions implements ModelInterface, ArrayAccess, \J * @var string[] */ protected static $openAPITypes = [ - 'type' => 'string', - 'text' => 'string', - 'voice' => 'string' + 'color' => 'string', + 'opacity' => 'float', + 'padding' => 'float', + 'border_radius' => 'float' ]; /** @@ -71,9 +72,10 @@ class ElevenLabsGeneratedAssetOptions implements ModelInterface, ArrayAccess, \J * @psalm-var array */ protected static $openAPIFormats = [ - 'type' => null, - 'text' => null, - 'voice' => null + 'color' => null, + 'opacity' => null, + 'padding' => null, + 'border_radius' => null ]; /** @@ -82,9 +84,10 @@ class ElevenLabsGeneratedAssetOptions implements ModelInterface, ArrayAccess, \J * @var boolean[] */ protected static array $openAPINullables = [ - 'type' => false, - 'text' => false, - 'voice' => false + 'color' => false, + 'opacity' => false, + 'padding' => false, + 'border_radius' => false ]; /** @@ -173,9 +176,10 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'type' => 'type', - 'text' => 'text', - 'voice' => 'voice' + 'color' => 'color', + 'opacity' => 'opacity', + 'padding' => 'padding', + 'border_radius' => 'borderRadius' ]; /** @@ -184,9 +188,10 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'type' => 'setType', - 'text' => 'setText', - 'voice' => 'setVoice' + 'color' => 'setColor', + 'opacity' => 'setOpacity', + 'padding' => 'setPadding', + 'border_radius' => 'setBorderRadius' ]; /** @@ -195,9 +200,10 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'type' => 'getType', - 'text' => 'getText', - 'voice' => 'getVoice' + 'color' => 'getColor', + 'opacity' => 'getOpacity', + 'padding' => 'getPadding', + 'border_radius' => 'getBorderRadius' ]; /** @@ -241,48 +247,6 @@ public function getModelName() return self::$openAPIModelName; } - public const TYPE_TEXT_TO_SPEECH = 'text-to-speech'; - public const VOICE_ADAM = 'Adam'; - public const VOICE_ANTONI = 'Antoni'; - public const VOICE_ARNOLD = 'Arnold'; - public const VOICE_BELLA = 'Bella'; - public const VOICE_DOMI = 'Domi'; - public const VOICE_ELLI = 'Elli'; - public const VOICE_JOSH = 'Josh'; - public const VOICE_RACHEL = 'Rachel'; - public const VOICE_SAM = 'Sam'; - - /** - * Gets allowable values of the enum - * - * @return string[] - */ - public function getTypeAllowableValues() - { - return [ - self::TYPE_TEXT_TO_SPEECH, - ]; - } - - /** - * Gets allowable values of the enum - * - * @return string[] - */ - public function getVoiceAllowableValues() - { - return [ - self::VOICE_ADAM, - self::VOICE_ANTONI, - self::VOICE_ARNOLD, - self::VOICE_BELLA, - self::VOICE_DOMI, - self::VOICE_ELLI, - self::VOICE_JOSH, - self::VOICE_RACHEL, - self::VOICE_SAM, - ]; - } /** * Associative array for storing property values @@ -299,12 +263,10 @@ public function getVoiceAllowableValues() */ public function __construct(array $data = null) { - $this->setIfExists('type', $data ?? [], null); - $this->setIfExists('text', $data ?? [], null); - $this->setIfExists('voice', $data ?? [], null); - - // Initialize discriminator property with the model name. - $this->container['type'] = static::$openAPIModelName; + $this->setIfExists('color', $data ?? [], null); + $this->setIfExists('opacity', $data ?? [], null); + $this->setIfExists('padding', $data ?? [], null); + $this->setIfExists('border_radius', $data ?? [], null); } /** @@ -334,31 +296,28 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['type'] === null) { - $invalidProperties[] = "'type' can't be null"; + if (!is_null($this->container['color']) && !preg_match("/^#[A-Fa-f0-9]{6}$/", $this->container['color'])) { + $invalidProperties[] = "invalid value for 'color', must be conform to the pattern /^#[A-Fa-f0-9]{6}$/."; } - $allowedValues = $this->getTypeAllowableValues(); - if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { - $invalidProperties[] = sprintf( - "invalid value '%s' for 'type', must be one of '%s'", - $this->container['type'], - implode("', '", $allowedValues) - ); + + if (!is_null($this->container['opacity']) && ($this->container['opacity'] > 1)) { + $invalidProperties[] = "invalid value for 'opacity', must be smaller than or equal to 1."; + } + + if (!is_null($this->container['opacity']) && ($this->container['opacity'] < 0)) { + $invalidProperties[] = "invalid value for 'opacity', must be bigger than or equal to 0."; } - if ($this->container['text'] === null) { - $invalidProperties[] = "'text' can't be null"; + if (!is_null($this->container['padding']) && ($this->container['padding'] > 100)) { + $invalidProperties[] = "invalid value for 'padding', must be smaller than or equal to 100."; } - if ($this->container['voice'] === null) { - $invalidProperties[] = "'voice' can't be null"; + + if (!is_null($this->container['padding']) && ($this->container['padding'] < 0)) { + $invalidProperties[] = "invalid value for 'padding', must be bigger than or equal to 0."; } - $allowedValues = $this->getVoiceAllowableValues(); - if (!is_null($this->container['voice']) && !in_array($this->container['voice'], $allowedValues, true)) { - $invalidProperties[] = sprintf( - "invalid value '%s' for 'voice', must be one of '%s'", - $this->container['voice'], - implode("', '", $allowedValues) - ); + + if (!is_null($this->container['border_radius']) && ($this->container['border_radius'] < 0)) { + $invalidProperties[] = "invalid value for 'border_radius', must be bigger than or equal to 0."; } return $invalidProperties; @@ -377,102 +336,135 @@ public function valid() /** - * Gets type + * Gets color * - * @return string + * @return string|null */ - public function getType() + public function getColor() { - return $this->container['type']; + return $this->container['color']; } /** - * Sets type + * Sets color * - * @param string $type The type of asset to generate - set to `text-to-speech` for text-to-speech. + * @param string|null $color The background color using hexadecimal color notation. * * @return self */ - public function setType($type) + public function setColor($color) { - if (is_null($type)) { - throw new \InvalidArgumentException('non-nullable type cannot be null'); + if (is_null($color)) { + throw new \InvalidArgumentException('non-nullable color cannot be null'); } - $allowedValues = $this->getTypeAllowableValues(); - if (!in_array($type, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value '%s' for 'type', must be one of '%s'", - $type, - implode("', '", $allowedValues) - ) - ); + + if ((!preg_match("/^#[A-Fa-f0-9]{6}$/", ObjectSerializer::toString($color)))) { + throw new \InvalidArgumentException("invalid value for \$color when calling TextBackground., must conform to the pattern /^#[A-Fa-f0-9]{6}$/."); } - $this->container['type'] = $type; + + $this->container['color'] = $color; return $this; } /** - * Gets text + * Gets opacity * - * @return string + * @return float|null + */ + public function getOpacity() + { + return $this->container['opacity']; + } + + /** + * Sets opacity + * + * @param float|null $opacity The opacity of the background where 1 is opaque and 0 is transparent. + * + * @return self */ - public function getText() + public function setOpacity($opacity) { - return $this->container['text']; + if (is_null($opacity)) { + throw new \InvalidArgumentException('non-nullable opacity cannot be null'); + } + + if (($opacity > 1)) { + throw new \InvalidArgumentException('invalid value for $opacity when calling TextBackground., must be smaller than or equal to 1.'); + } + if (($opacity < 0)) { + throw new \InvalidArgumentException('invalid value for $opacity when calling TextBackground., must be bigger than or equal to 0.'); + } + + $this->container['opacity'] = $opacity; + + return $this; } /** - * Sets text + * Gets padding * - * @param string $text The text to convert to speech. + * @return float|null + */ + public function getPadding() + { + return $this->container['padding']; + } + + /** + * Sets padding + * + * @param float|null $padding Padding inside the background box in pixels. * * @return self */ - public function setText($text) + public function setPadding($padding) { - if (is_null($text)) { - throw new \InvalidArgumentException('non-nullable text cannot be null'); + if (is_null($padding)) { + throw new \InvalidArgumentException('non-nullable padding cannot be null'); + } + + if (($padding > 100)) { + throw new \InvalidArgumentException('invalid value for $padding when calling TextBackground., must be smaller than or equal to 100.'); + } + if (($padding < 0)) { + throw new \InvalidArgumentException('invalid value for $padding when calling TextBackground., must be bigger than or equal to 0.'); } - $this->container['text'] = $text; + + $this->container['padding'] = $padding; return $this; } /** - * Gets voice + * Gets border_radius * - * @return string + * @return float|null */ - public function getVoice() + public function getBorderRadius() { - return $this->container['voice']; + return $this->container['border_radius']; } /** - * Sets voice + * Sets border_radius * - * @param string $voice The voice to use for the text-to-speech conversion. Select a voice from the list of available voices:
  • `Adam`
  • `Antoni`
  • `Arnold`
  • `Bella`
  • `Domi`
  • `Elli`
  • `Josh`
  • `Rachel`
  • `Sam`
+ * @param float|null $border_radius The border radius of the background box in pixels for rounded corners. * * @return self */ - public function setVoice($voice) + public function setBorderRadius($border_radius) { - if (is_null($voice)) { - throw new \InvalidArgumentException('non-nullable voice cannot be null'); + if (is_null($border_radius)) { + throw new \InvalidArgumentException('non-nullable border_radius cannot be null'); } - $allowedValues = $this->getVoiceAllowableValues(); - if (!in_array($voice, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value '%s' for 'voice', must be one of '%s'", - $voice, - implode("', '", $allowedValues) - ) - ); + + if (($border_radius < 0)) { + throw new \InvalidArgumentException('invalid value for $border_radius when calling TextBackground., must be bigger than or equal to 0.'); } - $this->container['voice'] = $voice; + + $this->container['border_radius'] = $border_radius; return $this; } diff --git a/src/Model/TextFont.php b/src/Model/TextFont.php new file mode 100644 index 0000000..1e2590a --- /dev/null +++ b/src/Model/TextFont.php @@ -0,0 +1,580 @@ + + */ +class TextFont implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'TextFont'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'family' => 'string', + 'color' => 'string', + 'opacity' => 'float', + 'size' => 'int', + 'weight' => 'int', + 'line_height' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'family' => null, + 'color' => null, + 'opacity' => null, + 'size' => null, + 'weight' => null, + 'line_height' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'family' => false, + 'color' => false, + 'opacity' => false, + 'size' => false, + 'weight' => false, + 'line_height' => 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; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $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 = [ + 'family' => 'family', + 'color' => 'color', + 'opacity' => 'opacity', + 'size' => 'size', + 'weight' => 'weight', + 'line_height' => 'lineHeight' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'family' => 'setFamily', + 'color' => 'setColor', + 'opacity' => 'setOpacity', + 'size' => 'setSize', + 'weight' => 'setWeight', + 'line_height' => 'setLineHeight' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'family' => 'getFamily', + 'color' => 'getColor', + 'opacity' => 'getOpacity', + 'size' => 'getSize', + 'weight' => 'getWeight', + 'line_height' => 'getLineHeight' + ]; + + /** + * 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) + { + $this->setIfExists('family', $data ?? [], null); + $this->setIfExists('color', $data ?? [], null); + $this->setIfExists('opacity', $data ?? [], null); + $this->setIfExists('size', $data ?? [], null); + $this->setIfExists('weight', $data ?? [], null); + $this->setIfExists('line_height', $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 = []; + + 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 family + * + * @return string|null + */ + public function getFamily() + { + return $this->container['family']; + } + + /** + * Sets family + * + * @param string|null $family The font family name. This must be Family name embedded in the font, i.e. \"Open Sans\". + * + * @return self + */ + public function setFamily($family) + { + if (is_null($family)) { + throw new \InvalidArgumentException('non-nullable family cannot be null'); + } + $this->container['family'] = $family; + + return $this; + } + + /** + * Gets color + * + * @return string|null + */ + public function getColor() + { + return $this->container['color']; + } + + /** + * Sets color + * + * @param string|null $color The text color using hexadecimal color notation. + * + * @return self + */ + public function setColor($color) + { + if (is_null($color)) { + throw new \InvalidArgumentException('non-nullable color cannot be null'); + } + $this->container['color'] = $color; + + return $this; + } + + /** + * Gets opacity + * + * @return float|null + */ + public function getOpacity() + { + return $this->container['opacity']; + } + + /** + * Sets opacity + * + * @param float|null $opacity The opacity of the text where 1 is opaque and 0 is transparent. + * + * @return self + */ + public function setOpacity($opacity) + { + if (is_null($opacity)) { + throw new \InvalidArgumentException('non-nullable opacity cannot be null'); + } + $this->container['opacity'] = $opacity; + + return $this; + } + + /** + * Gets size + * + * @return int|null + */ + public function getSize() + { + return $this->container['size']; + } + + /** + * Sets size + * + * @param int|null $size The size of the font in pixels (px). + * + * @return self + */ + public function setSize($size) + { + if (is_null($size)) { + throw new \InvalidArgumentException('non-nullable size cannot be null'); + } + $this->container['size'] = $size; + + return $this; + } + + /** + * Gets weight + * + * @return int|null + */ + public function getWeight() + { + return $this->container['weight']; + } + + /** + * Sets weight + * + * @param int|null $weight The weight of the font. 100 is lightest, 900 is heaviest (boldest). + * + * @return self + */ + public function setWeight($weight) + { + if (is_null($weight)) { + throw new \InvalidArgumentException('non-nullable weight cannot be null'); + } + $this->container['weight'] = $weight; + + return $this; + } + + /** + * Gets line_height + * + * @return float|null + */ + public function getLineHeight() + { + return $this->container['line_height']; + } + + /** + * Sets line_height + * + * @param float|null $line_height The line height of the font as a ratio of the font size. + * + * @return self + */ + public function setLineHeight($line_height) + { + if (is_null($line_height)) { + throw new \InvalidArgumentException('non-nullable line_height cannot be null'); + } + $this->container['line_height'] = $line_height; + + 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() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ShotstackTextToImageOptions.php b/src/Model/TextToImageAsset.php similarity index 88% rename from src/Model/ShotstackTextToImageOptions.php rename to src/Model/TextToImageAsset.php index 075bfa9..7b25d44 100644 --- a/src/Model/ShotstackTextToImageOptions.php +++ b/src/Model/TextToImageAsset.php @@ -1,11 +1,11 @@ */ -class ShotstackTextToImageOptions implements ModelInterface, ArrayAccess, \JsonSerializable +class TextToImageAsset implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; @@ -50,7 +50,7 @@ class ShotstackTextToImageOptions implements ModelInterface, ArrayAccess, \JsonS * * @var string */ - protected static $openAPIModelName = 'ShotstackTextToImageOptions'; + protected static $openAPIModelName = 'TextToImageAsset'; /** * Array of property to type mappings. Used for (de)serialization @@ -61,7 +61,8 @@ class ShotstackTextToImageOptions implements ModelInterface, ArrayAccess, \JsonS 'type' => 'string', 'prompt' => 'string', 'width' => 'int', - 'height' => 'int' + 'height' => 'int', + 'crop' => '\ShotstackClient\Model\Crop' ]; /** @@ -75,7 +76,8 @@ class ShotstackTextToImageOptions implements ModelInterface, ArrayAccess, \JsonS 'type' => null, 'prompt' => null, 'width' => null, - 'height' => null + 'height' => null, + 'crop' => null ]; /** @@ -87,7 +89,8 @@ class ShotstackTextToImageOptions implements ModelInterface, ArrayAccess, \JsonS 'type' => false, 'prompt' => false, 'width' => false, - 'height' => false + 'height' => false, + 'crop' => false ]; /** @@ -179,7 +182,8 @@ public function isNullableSetToNull(string $property): bool 'type' => 'type', 'prompt' => 'prompt', 'width' => 'width', - 'height' => 'height' + 'height' => 'height', + 'crop' => 'crop' ]; /** @@ -191,7 +195,8 @@ public function isNullableSetToNull(string $property): bool 'type' => 'setType', 'prompt' => 'setPrompt', 'width' => 'setWidth', - 'height' => 'setHeight' + 'height' => 'setHeight', + 'crop' => 'setCrop' ]; /** @@ -203,7 +208,8 @@ public function isNullableSetToNull(string $property): bool 'type' => 'getType', 'prompt' => 'getPrompt', 'width' => 'getWidth', - 'height' => 'getHeight' + 'height' => 'getHeight', + 'crop' => 'getCrop' ]; /** @@ -280,6 +286,7 @@ public function __construct(array $data = null) $this->setIfExists('prompt', $data ?? [], null); $this->setIfExists('width', $data ?? [], null); $this->setIfExists('height', $data ?? [], null); + $this->setIfExists('crop', $data ?? [], null); } /** @@ -324,12 +331,6 @@ public function listInvalidProperties() if ($this->container['prompt'] === null) { $invalidProperties[] = "'prompt' can't be null"; } - if ($this->container['width'] === null) { - $invalidProperties[] = "'width' can't be null"; - } - if ($this->container['height'] === null) { - $invalidProperties[] = "'height' can't be null"; - } return $invalidProperties; } @@ -412,7 +413,7 @@ public function setPrompt($prompt) /** * Gets width * - * @return int + * @return int|null */ public function getWidth() { @@ -422,7 +423,7 @@ public function getWidth() /** * Sets width * - * @param int $width The width of the image in pixels. + * @param int|null $width The width of the image in pixels. * * @return self */ @@ -439,7 +440,7 @@ public function setWidth($width) /** * Gets height * - * @return int + * @return int|null */ public function getHeight() { @@ -449,7 +450,7 @@ public function getHeight() /** * Sets height * - * @param int $height The height of the image in pixels. + * @param int|null $height The height of the image in pixels. * * @return self */ @@ -462,6 +463,33 @@ public function setHeight($height) return $this; } + + /** + * Gets crop + * + * @return \ShotstackClient\Model\Crop|null + */ + public function getCrop() + { + return $this->container['crop']; + } + + /** + * Sets crop + * + * @param \ShotstackClient\Model\Crop|null $crop crop + * + * @return self + */ + public function setCrop($crop) + { + if (is_null($crop)) { + throw new \InvalidArgumentException('non-nullable crop cannot be null'); + } + $this->container['crop'] = $crop; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/src/Model/TextToSpeechAsset.php b/src/Model/TextToSpeechAsset.php new file mode 100644 index 0000000..2611591 --- /dev/null +++ b/src/Model/TextToSpeechAsset.php @@ -0,0 +1,777 @@ + + */ +class TextToSpeechAsset implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'TextToSpeechAsset'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'type' => 'string', + 'text' => 'string', + 'voice' => 'string', + 'language' => 'string', + 'newscaster' => 'bool', + 'trim' => 'float', + 'volume' => '\ShotstackClient\Model\AudioAssetVolume', + 'speed' => 'float', + 'effect' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'type' => null, + 'text' => null, + 'voice' => null, + 'language' => null, + 'newscaster' => null, + 'trim' => null, + 'volume' => null, + 'speed' => 'float', + 'effect' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'type' => false, + 'text' => false, + 'voice' => false, + 'language' => false, + 'newscaster' => false, + 'trim' => false, + 'volume' => false, + 'speed' => false, + 'effect' => 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; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $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 = [ + 'type' => 'type', + 'text' => 'text', + 'voice' => 'voice', + 'language' => 'language', + 'newscaster' => 'newscaster', + 'trim' => 'trim', + 'volume' => 'volume', + 'speed' => 'speed', + 'effect' => 'effect' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'type' => 'setType', + 'text' => 'setText', + 'voice' => 'setVoice', + 'language' => 'setLanguage', + 'newscaster' => 'setNewscaster', + 'trim' => 'setTrim', + 'volume' => 'setVolume', + 'speed' => 'setSpeed', + 'effect' => 'setEffect' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'type' => 'getType', + 'text' => 'getText', + 'voice' => 'getVoice', + 'language' => 'getLanguage', + 'newscaster' => 'getNewscaster', + 'trim' => 'getTrim', + 'volume' => 'getVolume', + 'speed' => 'getSpeed', + 'effect' => 'getEffect' + ]; + + /** + * 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 TYPE_TEXT_TO_SPEECH = 'text-to-speech'; + public const EFFECT_NONE = 'none'; + public const EFFECT_FADE_IN = 'fadeIn'; + public const EFFECT_FADE_OUT = 'fadeOut'; + public const EFFECT_FADE_IN_FADE_OUT = 'fadeInFadeOut'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_TEXT_TO_SPEECH, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getEffectAllowableValues() + { + return [ + self::EFFECT_NONE, + self::EFFECT_FADE_IN, + self::EFFECT_FADE_OUT, + self::EFFECT_FADE_IN_FADE_OUT, + ]; + } + + /** + * 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) + { + $this->setIfExists('type', $data ?? [], 'text-to-speech'); + $this->setIfExists('text', $data ?? [], null); + $this->setIfExists('voice', $data ?? [], null); + $this->setIfExists('language', $data ?? [], null); + $this->setIfExists('newscaster', $data ?? [], false); + $this->setIfExists('trim', $data ?? [], null); + $this->setIfExists('volume', $data ?? [], null); + $this->setIfExists('speed', $data ?? [], null); + $this->setIfExists('effect', $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 ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['text'] === null) { + $invalidProperties[] = "'text' can't be null"; + } + if ($this->container['voice'] === null) { + $invalidProperties[] = "'voice' can't be null"; + } + if (!is_null($this->container['speed']) && ($this->container['speed'] > 10)) { + $invalidProperties[] = "invalid value for 'speed', must be smaller than or equal to 10."; + } + + if (!is_null($this->container['speed']) && ($this->container['speed'] < 0)) { + $invalidProperties[] = "invalid value for 'speed', must be bigger than or equal to 0."; + } + + $allowedValues = $this->getEffectAllowableValues(); + if (!is_null($this->container['effect']) && !in_array($this->container['effect'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'effect', must be one of '%s'", + $this->container['effect'], + 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 type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type The type of asset - set to `text-to-speech` for text-to-speech. + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets text + * + * @return string + */ + public function getText() + { + return $this->container['text']; + } + + /** + * Sets text + * + * @param string $text The text to convert to speech. + * + * @return self + */ + public function setText($text) + { + if (is_null($text)) { + throw new \InvalidArgumentException('non-nullable text cannot be null'); + } + $this->container['text'] = $text; + + return $this; + } + + /** + * Gets voice + * + * @return string + */ + public function getVoice() + { + return $this->container['voice']; + } + + /** + * Sets voice + * + * @param string $voice The voice to use for the text-to-speech conversion. + * + * @return self + */ + public function setVoice($voice) + { + if (is_null($voice)) { + throw new \InvalidArgumentException('non-nullable voice cannot be null'); + } + $this->container['voice'] = $voice; + + return $this; + } + + /** + * Gets language + * + * @return string|null + */ + public function getLanguage() + { + return $this->container['language']; + } + + /** + * Sets language + * + * @param string|null $language The language code for the text-to-speech conversion. + * + * @return self + */ + public function setLanguage($language) + { + if (is_null($language)) { + throw new \InvalidArgumentException('non-nullable language cannot be null'); + } + $this->container['language'] = $language; + + return $this; + } + + /** + * Gets newscaster + * + * @return bool|null + */ + public function getNewscaster() + { + return $this->container['newscaster']; + } + + /** + * Sets newscaster + * + * @param bool|null $newscaster Set the voice to newscaster mode. + * + * @return self + */ + public function setNewscaster($newscaster) + { + if (is_null($newscaster)) { + throw new \InvalidArgumentException('non-nullable newscaster cannot be null'); + } + $this->container['newscaster'] = $newscaster; + + return $this; + } + + /** + * Gets trim + * + * @return float|null + */ + public function getTrim() + { + return $this->container['trim']; + } + + /** + * Sets trim + * + * @param float|null $trim The start trim point of the audio clip, in seconds (defaults to 0). Audio will start from the trim point. The audio will play until the file ends or the Clip length is reached. + * + * @return self + */ + public function setTrim($trim) + { + if (is_null($trim)) { + throw new \InvalidArgumentException('non-nullable trim cannot be null'); + } + $this->container['trim'] = $trim; + + return $this; + } + + /** + * Gets volume + * + * @return \ShotstackClient\Model\AudioAssetVolume|null + */ + public function getVolume() + { + return $this->container['volume']; + } + + /** + * Sets volume + * + * @param \ShotstackClient\Model\AudioAssetVolume|null $volume volume + * + * @return self + */ + public function setVolume($volume) + { + if (is_null($volume)) { + throw new \InvalidArgumentException('non-nullable volume cannot be null'); + } + $this->container['volume'] = $volume; + + return $this; + } + + /** + * Gets speed + * + * @return float|null + */ + public function getSpeed() + { + return $this->container['speed']; + } + + /** + * Sets speed + * + * @param float|null $speed Adjust the playback speed of the audio clip between 0 (paused) and 10 (10x normal speed), where 1 is normal speed (defaults to 1). Adjusting the speed will also adjust the duration of the clip and may require you to adjust the Clip length. + * + * @return self + */ + public function setSpeed($speed) + { + if (is_null($speed)) { + throw new \InvalidArgumentException('non-nullable speed cannot be null'); + } + + if (($speed > 10)) { + throw new \InvalidArgumentException('invalid value for $speed when calling TextToSpeechAsset., must be smaller than or equal to 10.'); + } + if (($speed < 0)) { + throw new \InvalidArgumentException('invalid value for $speed when calling TextToSpeechAsset., must be bigger than or equal to 0.'); + } + + $this->container['speed'] = $speed; + + return $this; + } + + /** + * Gets effect + * + * @return string|null + */ + public function getEffect() + { + return $this->container['effect']; + } + + /** + * Sets effect + * + * @param string|null $effect The effect to apply to the audio asset
  • `fadeIn` - fade volume in only
  • `fadeOut` - fade volume out only
  • `fadeInFadeOut` - fade volume in and out
+ * + * @return self + */ + public function setEffect($effect) + { + if (is_null($effect)) { + throw new \InvalidArgumentException('non-nullable effect cannot be null'); + } + $allowedValues = $this->getEffectAllowableValues(); + if (!in_array($effect, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'effect', must be one of '%s'", + $effect, + implode("', '", $allowedValues) + ) + ); + } + $this->container['effect'] = $effect; + + 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() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/Thumbnail.php b/src/Model/Thumbnail.php index 506abf2..9b528c4 100644 --- a/src/Model/Thumbnail.php +++ b/src/Model/Thumbnail.php @@ -5,7 +5,7 @@ * PHP version 7.4 * * @category Class - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech */ @@ -26,17 +26,17 @@ * Do not edit the class manually. */ -namespace Shotstack\Client\Model; +namespace ShotstackClient\Model; use \ArrayAccess; -use \Shotstack\Client\ObjectSerializer; +use \ShotstackClient\ObjectSerializer; /** * Thumbnail Class Doc Comment * * @category Class * @description Generate a thumbnail image for the video or image at a specific point from the timeline. - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech * @implements \ArrayAccess @@ -288,6 +288,14 @@ public function listInvalidProperties() if ($this->container['scale'] === null) { $invalidProperties[] = "'scale' can't be null"; } + if (($this->container['scale'] > 1)) { + $invalidProperties[] = "invalid value for 'scale', must be smaller than or equal to 1."; + } + + if (($this->container['scale'] < 0)) { + $invalidProperties[] = "invalid value for 'scale', must be bigger than or equal to 0."; + } + return $invalidProperties; } @@ -352,6 +360,14 @@ public function setScale($scale) if (is_null($scale)) { throw new \InvalidArgumentException('non-nullable scale cannot be null'); } + + if (($scale > 1)) { + throw new \InvalidArgumentException('invalid value for $scale when calling Thumbnail., must be smaller than or equal to 1.'); + } + if (($scale < 0)) { + throw new \InvalidArgumentException('invalid value for $scale when calling Thumbnail., must be bigger than or equal to 0.'); + } + $this->container['scale'] = $scale; return $this; diff --git a/src/Model/Timeline.php b/src/Model/Timeline.php index 7a4cd29..77392db 100644 --- a/src/Model/Timeline.php +++ b/src/Model/Timeline.php @@ -5,7 +5,7 @@ * PHP version 7.4 * * @category Class - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech */ @@ -26,17 +26,17 @@ * Do not edit the class manually. */ -namespace Shotstack\Client\Model; +namespace ShotstackClient\Model; use \ArrayAccess; -use \Shotstack\Client\ObjectSerializer; +use \ShotstackClient\ObjectSerializer; /** * Timeline Class Doc Comment * * @category Class * @description A timeline represents the contents of a video edit over time, an audio edit over time, in seconds, or an image layout. A timeline consists of layers called tracks. Tracks are composed of titles, images, audio, html or video segments referred to as clips which are placed along the track at specific starting point and lasting for a specific amount of time. - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech * @implements \ArrayAccess @@ -58,10 +58,10 @@ class Timeline implements ModelInterface, ArrayAccess, \JsonSerializable * @var string[] */ protected static $openAPITypes = [ - 'soundtrack' => '\Shotstack\Client\Model\Soundtrack', + 'soundtrack' => '\ShotstackClient\Model\Soundtrack', 'background' => 'string', - 'fonts' => '\Shotstack\Client\Model\Font[]', - 'tracks' => '\Shotstack\Client\Model\Track[]', + 'fonts' => '\ShotstackClient\Model\Font[]', + 'tracks' => '\ShotstackClient\Model\Track[]', 'cache' => 'bool' ]; @@ -306,6 +306,10 @@ public function listInvalidProperties() if ($this->container['tracks'] === null) { $invalidProperties[] = "'tracks' can't be null"; } + if ((count($this->container['tracks']) < 1)) { + $invalidProperties[] = "invalid value for 'tracks', number of items must be greater than or equal to 1."; + } + return $invalidProperties; } @@ -324,7 +328,7 @@ public function valid() /** * Gets soundtrack * - * @return \Shotstack\Client\Model\Soundtrack|null + * @return \ShotstackClient\Model\Soundtrack|null */ public function getSoundtrack() { @@ -334,7 +338,7 @@ public function getSoundtrack() /** * Sets soundtrack * - * @param \Shotstack\Client\Model\Soundtrack|null $soundtrack soundtrack + * @param \ShotstackClient\Model\Soundtrack|null $soundtrack soundtrack * * @return self */ @@ -378,7 +382,7 @@ public function setBackground($background) /** * Gets fonts * - * @return \Shotstack\Client\Model\Font[]|null + * @return \ShotstackClient\Model\Font[]|null */ public function getFonts() { @@ -388,7 +392,7 @@ public function getFonts() /** * Sets fonts * - * @param \Shotstack\Client\Model\Font[]|null $fonts An array of custom fonts to be downloaded for use by the HTML assets. + * @param \ShotstackClient\Model\Font[]|null $fonts An array of custom fonts to be downloaded for use by the HTML assets. * * @return self */ @@ -405,7 +409,7 @@ public function setFonts($fonts) /** * Gets tracks * - * @return \Shotstack\Client\Model\Track[] + * @return \ShotstackClient\Model\Track[] */ public function getTracks() { @@ -415,7 +419,7 @@ public function getTracks() /** * Sets tracks * - * @param \Shotstack\Client\Model\Track[] $tracks A timeline consists of an array of tracks, each track containing clips. Tracks are layered on top of each other in the same order they are added to the array with the top most track layered over the top of those below it. Ensure that a track containing titles is the top most track so that it is displayed above videos and images. + * @param \ShotstackClient\Model\Track[] $tracks A timeline consists of an array of tracks, each track containing clips. Tracks are layered on top of each other in the same order they are added to the array with the top most track layered over the top of those below it. Ensure that a track containing titles is the top most track so that it is displayed above videos and images. * * @return self */ @@ -424,6 +428,11 @@ public function setTracks($tracks) if (is_null($tracks)) { throw new \InvalidArgumentException('non-nullable tracks cannot be null'); } + + + if ((count($tracks) < 1)) { + throw new \InvalidArgumentException('invalid length for $tracks when calling Timeline., number of items must be greater than or equal to 1.'); + } $this->container['tracks'] = $tracks; return $this; diff --git a/src/Model/TitleAsset.php b/src/Model/TitleAsset.php index 7fd7166..1d65252 100644 --- a/src/Model/TitleAsset.php +++ b/src/Model/TitleAsset.php @@ -5,7 +5,7 @@ * PHP version 7.4 * * @category Class - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech */ @@ -26,17 +26,17 @@ * Do not edit the class manually. */ -namespace Shotstack\Client\Model; +namespace ShotstackClient\Model; use \ArrayAccess; -use \Shotstack\Client\ObjectSerializer; +use \ShotstackClient\ObjectSerializer; /** * TitleAsset Class Doc Comment * * @category Class - * @description **Notice: The title asset is deprecated, use the [HTML asset](#tocs_htmlasset) instead.** The TitleAsset clip type lets you create video titles from a text string and apply styling and positioning. - * @package Shotstack\Client + * @description **Notice: The TitleAsset is deprecated, use the [TextAsset](#tocs_textasset) instead.** The TitleAsset clip type lets you create video titles from a text string and apply styling and positioning. + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech * @implements \ArrayAccess @@ -65,7 +65,7 @@ class TitleAsset implements ModelInterface, ArrayAccess, \JsonSerializable 'size' => 'string', 'background' => 'string', 'position' => 'string', - 'offset' => '\Shotstack\Client\Model\Offset' + 'offset' => '\ShotstackClient\Model\Offset' ]; /** @@ -271,6 +271,7 @@ public function getModelName() return self::$openAPIModelName; } + public const TYPE_TITLE = 'title'; public const STYLE_MINIMAL = 'minimal'; public const STYLE_BLOCKBUSTER = 'blockbuster'; public const STYLE_VOGUE = 'vogue'; @@ -298,6 +299,18 @@ public function getModelName() public const POSITION_TOP_LEFT = 'topLeft'; public const POSITION_CENTER = 'center'; + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_TITLE, + ]; + } + /** * Gets allowable values of the enum * @@ -412,6 +425,15 @@ public function listInvalidProperties() if ($this->container['type'] === null) { $invalidProperties[] = "'type' can't be null"; } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + if ($this->container['text'] === null) { $invalidProperties[] = "'text' can't be null"; } @@ -479,6 +501,16 @@ public function setType($type) if (is_null($type)) { throw new \InvalidArgumentException('non-nullable type cannot be null'); } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } $this->container['type'] = $type; return $this; @@ -679,7 +711,7 @@ public function setPosition($position) /** * Gets offset * - * @return \Shotstack\Client\Model\Offset|null + * @return \ShotstackClient\Model\Offset|null */ public function getOffset() { @@ -689,7 +721,7 @@ public function getOffset() /** * Sets offset * - * @param \Shotstack\Client\Model\Offset|null $offset offset + * @param \ShotstackClient\Model\Offset|null $offset offset * * @return self */ diff --git a/src/Model/Track.php b/src/Model/Track.php index 9412dd8..03d7974 100644 --- a/src/Model/Track.php +++ b/src/Model/Track.php @@ -5,7 +5,7 @@ * PHP version 7.4 * * @category Class - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech */ @@ -26,17 +26,17 @@ * Do not edit the class manually. */ -namespace Shotstack\Client\Model; +namespace ShotstackClient\Model; use \ArrayAccess; -use \Shotstack\Client\ObjectSerializer; +use \ShotstackClient\ObjectSerializer; /** * Track Class Doc Comment * * @category Class * @description A track contains an array of clips. Tracks are layered on top of each other in the order in the array. The top most track will render on top of those below it. - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech * @implements \ArrayAccess @@ -58,7 +58,7 @@ class Track implements ModelInterface, ArrayAccess, \JsonSerializable * @var string[] */ protected static $openAPITypes = [ - 'clips' => '\Shotstack\Client\Model\Clip[]' + 'clips' => '\ShotstackClient\Model\Clip[]' ]; /** @@ -278,6 +278,10 @@ public function listInvalidProperties() if ($this->container['clips'] === null) { $invalidProperties[] = "'clips' can't be null"; } + if ((count($this->container['clips']) < 1)) { + $invalidProperties[] = "invalid value for 'clips', number of items must be greater than or equal to 1."; + } + return $invalidProperties; } @@ -296,7 +300,7 @@ public function valid() /** * Gets clips * - * @return \Shotstack\Client\Model\Clip[] + * @return \ShotstackClient\Model\Clip[] */ public function getClips() { @@ -306,7 +310,7 @@ public function getClips() /** * Sets clips * - * @param \Shotstack\Client\Model\Clip[] $clips An array of Clips comprising of TitleClip, ImageClip or VideoClip. + * @param \ShotstackClient\Model\Clip[] $clips An array of Clips comprising of TitleClip, ImageClip or VideoClip. * * @return self */ @@ -315,6 +319,11 @@ public function setClips($clips) if (is_null($clips)) { throw new \InvalidArgumentException('non-nullable clips cannot be null'); } + + + if ((count($clips) < 1)) { + throw new \InvalidArgumentException('invalid length for $clips when calling Track., number of items must be greater than or equal to 1.'); + } $this->container['clips'] = $clips; return $this; diff --git a/src/Model/Transcription.php b/src/Model/Transcription.php index 92d8a19..6506999 100644 --- a/src/Model/Transcription.php +++ b/src/Model/Transcription.php @@ -5,7 +5,7 @@ * PHP version 7.4 * * @category Class - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech */ @@ -26,17 +26,17 @@ * Do not edit the class manually. */ -namespace Shotstack\Client\Model; +namespace ShotstackClient\Model; use \ArrayAccess; -use \Shotstack\Client\ObjectSerializer; +use \ShotstackClient\ObjectSerializer; /** * Transcription Class Doc Comment * * @category Class * @description Generate a transcription of the audio in the video. The transcription can be output as a file in SRT or VTT format. - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech * @implements \ArrayAccess diff --git a/src/Model/Transfer.php b/src/Model/Transfer.php index b2b7aef..54af2db 100644 --- a/src/Model/Transfer.php +++ b/src/Model/Transfer.php @@ -5,7 +5,7 @@ * PHP version 7.4 * * @category Class - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech */ @@ -26,17 +26,17 @@ * Do not edit the class manually. */ -namespace Shotstack\Client\Model; +namespace ShotstackClient\Model; use \ArrayAccess; -use \Shotstack\Client\ObjectSerializer; +use \ShotstackClient\ObjectSerializer; /** * Transfer Class Doc Comment * * @category Class * @description The asset URL to fetch and transfer to a destination. - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech * @implements \ArrayAccess @@ -60,7 +60,7 @@ class Transfer implements ModelInterface, ArrayAccess, \JsonSerializable protected static $openAPITypes = [ 'url' => 'string', 'id' => 'string', - 'destinations' => '\Shotstack\Client\Model\Destinations[]' + 'destinations' => '\ShotstackClient\Model\Destinations[]' ]; /** @@ -370,7 +370,7 @@ public function setId($id) /** * Gets destinations * - * @return \Shotstack\Client\Model\Destinations[] + * @return \ShotstackClient\Model\Destinations[] */ public function getDestinations() { @@ -380,7 +380,7 @@ public function getDestinations() /** * Sets destinations * - * @param \Shotstack\Client\Model\Destinations[] $destinations Specify the storage locations and hosting services to send the file to. + * @param \ShotstackClient\Model\Destinations[] $destinations Specify the storage locations and hosting services to send the file to. * * @return self */ diff --git a/src/Model/TransferResponse.php b/src/Model/TransferResponse.php index 16ad0a8..cbbd9d3 100644 --- a/src/Model/TransferResponse.php +++ b/src/Model/TransferResponse.php @@ -5,7 +5,7 @@ * PHP version 7.4 * * @category Class - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech */ @@ -26,17 +26,17 @@ * Do not edit the class manually. */ -namespace Shotstack\Client\Model; +namespace ShotstackClient\Model; use \ArrayAccess; -use \Shotstack\Client\ObjectSerializer; +use \ShotstackClient\ObjectSerializer; /** * TransferResponse Class Doc Comment * * @category Class * @description The response returned by the Serve API [transfer asset](#transfer-asset) request. The response includes the ID and transfer status. The response follows the [json:api](https://jsonapi.org/) specification. - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech * @implements \ArrayAccess @@ -58,7 +58,7 @@ class TransferResponse implements ModelInterface, ArrayAccess, \JsonSerializable * @var string[] */ protected static $openAPITypes = [ - 'data' => '\Shotstack\Client\Model\TransferResponseData' + 'data' => '\ShotstackClient\Model\TransferResponseData' ]; /** @@ -296,7 +296,7 @@ public function valid() /** * Gets data * - * @return \Shotstack\Client\Model\TransferResponseData + * @return \ShotstackClient\Model\TransferResponseData */ public function getData() { @@ -306,7 +306,7 @@ public function getData() /** * Sets data * - * @param \Shotstack\Client\Model\TransferResponseData $data data + * @param \ShotstackClient\Model\TransferResponseData $data data * * @return self */ diff --git a/src/Model/TransferResponseAttributes.php b/src/Model/TransferResponseAttributes.php index aff6cad..d81cfcf 100644 --- a/src/Model/TransferResponseAttributes.php +++ b/src/Model/TransferResponseAttributes.php @@ -5,7 +5,7 @@ * PHP version 7.4 * * @category Class - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech */ @@ -26,17 +26,17 @@ * Do not edit the class manually. */ -namespace Shotstack\Client\Model; +namespace ShotstackClient\Model; use \ArrayAccess; -use \Shotstack\Client\ObjectSerializer; +use \ShotstackClient\ObjectSerializer; /** * TransferResponseAttributes Class Doc Comment * * @category Class * @description The transfer request attributes inlcudling the user specified ID and status. Returned with [TransferResponseData](#tocs_transferresponsedata). - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech * @implements \ArrayAccess diff --git a/src/Model/TransferResponseData.php b/src/Model/TransferResponseData.php index e1a28b6..40f85c2 100644 --- a/src/Model/TransferResponseData.php +++ b/src/Model/TransferResponseData.php @@ -5,7 +5,7 @@ * PHP version 7.4 * * @category Class - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech */ @@ -26,17 +26,17 @@ * Do not edit the class manually. */ -namespace Shotstack\Client\Model; +namespace ShotstackClient\Model; use \ArrayAccess; -use \Shotstack\Client\ObjectSerializer; +use \ShotstackClient\ObjectSerializer; /** * TransferResponseData Class Doc Comment * * @category Class * @description The type of resource (an asset) and the transfer attributes. Returned with [TransferResponse](#tocs_transferresponse). - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech * @implements \ArrayAccess @@ -59,7 +59,7 @@ class TransferResponseData implements ModelInterface, ArrayAccess, \JsonSerializ */ protected static $openAPITypes = [ 'type' => 'string', - 'attributes' => '\Shotstack\Client\Model\TransferResponseAttributes' + 'attributes' => '\ShotstackClient\Model\TransferResponseAttributes' ]; /** @@ -327,7 +327,7 @@ public function setType($type) /** * Gets attributes * - * @return \Shotstack\Client\Model\TransferResponseAttributes|null + * @return \ShotstackClient\Model\TransferResponseAttributes|null */ public function getAttributes() { @@ -337,7 +337,7 @@ public function getAttributes() /** * Sets attributes * - * @param \Shotstack\Client\Model\TransferResponseAttributes|null $attributes attributes + * @param \ShotstackClient\Model\TransferResponseAttributes|null $attributes attributes * * @return self */ diff --git a/src/Model/Transformation.php b/src/Model/Transformation.php index 1cebe2b..8103d3b 100644 --- a/src/Model/Transformation.php +++ b/src/Model/Transformation.php @@ -5,7 +5,7 @@ * PHP version 7.4 * * @category Class - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech */ @@ -26,17 +26,17 @@ * Do not edit the class manually. */ -namespace Shotstack\Client\Model; +namespace ShotstackClient\Model; use \ArrayAccess; -use \Shotstack\Client\ObjectSerializer; +use \ShotstackClient\ObjectSerializer; /** * Transformation Class Doc Comment * * @category Class * @description Apply one or more transformations to a clip. Transformations alter the visual properties of a clip and can be combined to create new shapes and effects. - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech * @implements \ArrayAccess @@ -58,9 +58,9 @@ class Transformation implements ModelInterface, ArrayAccess, \JsonSerializable * @var string[] */ protected static $openAPITypes = [ - 'rotate' => '\Shotstack\Client\Model\RotateTransformation', - 'skew' => '\Shotstack\Client\Model\SkewTransformation', - 'flip' => '\Shotstack\Client\Model\FlipTransformation' + 'rotate' => '\ShotstackClient\Model\RotateTransformation', + 'skew' => '\ShotstackClient\Model\SkewTransformation', + 'flip' => '\ShotstackClient\Model\FlipTransformation' ]; /** @@ -307,7 +307,7 @@ public function valid() /** * Gets rotate * - * @return \Shotstack\Client\Model\RotateTransformation|null + * @return \ShotstackClient\Model\RotateTransformation|null */ public function getRotate() { @@ -317,7 +317,7 @@ public function getRotate() /** * Sets rotate * - * @param \Shotstack\Client\Model\RotateTransformation|null $rotate rotate + * @param \ShotstackClient\Model\RotateTransformation|null $rotate rotate * * @return self */ @@ -334,7 +334,7 @@ public function setRotate($rotate) /** * Gets skew * - * @return \Shotstack\Client\Model\SkewTransformation|null + * @return \ShotstackClient\Model\SkewTransformation|null */ public function getSkew() { @@ -344,7 +344,7 @@ public function getSkew() /** * Sets skew * - * @param \Shotstack\Client\Model\SkewTransformation|null $skew skew + * @param \ShotstackClient\Model\SkewTransformation|null $skew skew * * @return self */ @@ -361,7 +361,7 @@ public function setSkew($skew) /** * Gets flip * - * @return \Shotstack\Client\Model\FlipTransformation|null + * @return \ShotstackClient\Model\FlipTransformation|null */ public function getFlip() { @@ -371,7 +371,7 @@ public function getFlip() /** * Sets flip * - * @param \Shotstack\Client\Model\FlipTransformation|null $flip flip + * @param \ShotstackClient\Model\FlipTransformation|null $flip flip * * @return self */ diff --git a/src/Model/Transition.php b/src/Model/Transition.php index 6fb7517..39e932a 100644 --- a/src/Model/Transition.php +++ b/src/Model/Transition.php @@ -5,7 +5,7 @@ * PHP version 7.4 * * @category Class - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech */ @@ -26,17 +26,17 @@ * Do not edit the class manually. */ -namespace Shotstack\Client\Model; +namespace ShotstackClient\Model; use \ArrayAccess; -use \Shotstack\Client\ObjectSerializer; +use \ShotstackClient\ObjectSerializer; /** * Transition Class Doc Comment * * @category Class * @description In and out transitions for a clip - i.e. fade in and fade out - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech * @implements \ArrayAccess @@ -235,6 +235,7 @@ public function getModelName() return self::$openAPIModelName; } + public const IN_NONE = 'none'; public const IN_FADE = 'fade'; public const IN_FADE_SLOW = 'fadeSlow'; public const IN_FADE_FAST = 'fadeFast'; @@ -296,6 +297,7 @@ public function getModelName() public const IN_SHUFFLE_TOP_LEFT_SLOW = 'shuffleTopLeftSlow'; public const IN_SHUFFLE_TOP_LEFT_FAST = 'shuffleTopLeftFast'; public const IN_ZOOM = 'zoom'; + public const OUT_NONE = 'none'; public const OUT_FADE = 'fade'; public const OUT_FADE_SLOW = 'fadeSlow'; public const OUT_FADE_FAST = 'fadeFast'; @@ -366,6 +368,7 @@ public function getModelName() public function getInAllowableValues() { return [ + self::IN_NONE, self::IN_FADE, self::IN_FADE_SLOW, self::IN_FADE_FAST, @@ -438,6 +441,7 @@ public function getInAllowableValues() public function getOutAllowableValues() { return [ + self::OUT_NONE, self::OUT_FADE, self::OUT_FADE_SLOW, self::OUT_FADE_FAST, diff --git a/src/Model/Tween.php b/src/Model/Tween.php new file mode 100644 index 0000000..f77664e --- /dev/null +++ b/src/Model/Tween.php @@ -0,0 +1,716 @@ + + */ +class Tween implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Tween'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'from' => 'mixed', + 'to' => 'mixed', + 'start' => 'float', + 'length' => 'float', + 'interpolation' => 'string', + 'easing' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'from' => null, + 'to' => null, + 'start' => null, + 'length' => null, + 'interpolation' => null, + 'easing' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'from' => true, + 'to' => true, + 'start' => false, + 'length' => false, + 'interpolation' => false, + 'easing' => 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; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $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 = [ + 'from' => 'from', + 'to' => 'to', + 'start' => 'start', + 'length' => 'length', + 'interpolation' => 'interpolation', + 'easing' => 'easing' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'from' => 'setFrom', + 'to' => 'setTo', + 'start' => 'setStart', + 'length' => 'setLength', + 'interpolation' => 'setInterpolation', + 'easing' => 'setEasing' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'from' => 'getFrom', + 'to' => 'getTo', + 'start' => 'getStart', + 'length' => 'getLength', + 'interpolation' => 'getInterpolation', + 'easing' => 'getEasing' + ]; + + /** + * 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 INTERPOLATION_LINEAR = 'linear'; + public const INTERPOLATION_BEZIER = 'bezier'; + public const INTERPOLATION_CONSTANT = 'constant'; + public const EASING_EASE = 'ease'; + public const EASING_EASE_IN = 'easeIn'; + public const EASING_EASE_OUT = 'easeOut'; + public const EASING_EASE_IN_OUT = 'easeInOut'; + public const EASING_EASE_IN_QUAD = 'easeInQuad'; + public const EASING_EASE_IN_CUBIC = 'easeInCubic'; + public const EASING_EASE_IN_QUART = 'easeInQuart'; + public const EASING_EASE_IN_QUINT = 'easeInQuint'; + public const EASING_EASE_IN_SINE = 'easeInSine'; + public const EASING_EASE_IN_EXPO = 'easeInExpo'; + public const EASING_EASE_IN_CIRC = 'easeInCirc'; + public const EASING_EASE_IN_BACK = 'easeInBack'; + public const EASING_EASE_OUT_QUAD = 'easeOutQuad'; + public const EASING_EASE_OUT_CUBIC = 'easeOutCubic'; + public const EASING_EASE_OUT_QUART = 'easeOutQuart'; + public const EASING_EASE_OUT_QUINT = 'easeOutQuint'; + public const EASING_EASE_OUT_SINE = 'easeOutSine'; + public const EASING_EASE_OUT_EXPO = 'easeOutExpo'; + public const EASING_EASE_OUT_CIRC = 'easeOutCirc'; + public const EASING_EASE_OUT_BACK = 'easeOutBack'; + public const EASING_EASE_IN_OUT_QUAD = 'easeInOutQuad'; + public const EASING_EASE_IN_OUT_CUBIC = 'easeInOutCubic'; + public const EASING_EASE_IN_OUT_QUART = 'easeInOutQuart'; + public const EASING_EASE_IN_OUT_QUINT = 'easeInOutQuint'; + public const EASING_EASE_IN_OUT_SINE = 'easeInOutSine'; + public const EASING_EASE_IN_OUT_EXPO = 'easeInOutExpo'; + public const EASING_EASE_IN_OUT_CIRC = 'easeInOutCirc'; + public const EASING_EASE_IN_OUT_BACK = 'easeInOutBack'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getInterpolationAllowableValues() + { + return [ + self::INTERPOLATION_LINEAR, + self::INTERPOLATION_BEZIER, + self::INTERPOLATION_CONSTANT, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getEasingAllowableValues() + { + return [ + self::EASING_EASE, + self::EASING_EASE_IN, + self::EASING_EASE_OUT, + self::EASING_EASE_IN_OUT, + self::EASING_EASE_IN_QUAD, + self::EASING_EASE_IN_CUBIC, + self::EASING_EASE_IN_QUART, + self::EASING_EASE_IN_QUINT, + self::EASING_EASE_IN_SINE, + self::EASING_EASE_IN_EXPO, + self::EASING_EASE_IN_CIRC, + self::EASING_EASE_IN_BACK, + self::EASING_EASE_OUT_QUAD, + self::EASING_EASE_OUT_CUBIC, + self::EASING_EASE_OUT_QUART, + self::EASING_EASE_OUT_QUINT, + self::EASING_EASE_OUT_SINE, + self::EASING_EASE_OUT_EXPO, + self::EASING_EASE_OUT_CIRC, + self::EASING_EASE_OUT_BACK, + self::EASING_EASE_IN_OUT_QUAD, + self::EASING_EASE_IN_OUT_CUBIC, + self::EASING_EASE_IN_OUT_QUART, + self::EASING_EASE_IN_OUT_QUINT, + self::EASING_EASE_IN_OUT_SINE, + self::EASING_EASE_IN_OUT_EXPO, + self::EASING_EASE_IN_OUT_CIRC, + self::EASING_EASE_IN_OUT_BACK, + ]; + } + + /** + * 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) + { + $this->setIfExists('from', $data ?? [], null); + $this->setIfExists('to', $data ?? [], null); + $this->setIfExists('start', $data ?? [], null); + $this->setIfExists('length', $data ?? [], null); + $this->setIfExists('interpolation', $data ?? [], null); + $this->setIfExists('easing', $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->getInterpolationAllowableValues(); + if (!is_null($this->container['interpolation']) && !in_array($this->container['interpolation'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'interpolation', must be one of '%s'", + $this->container['interpolation'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getEasingAllowableValues(); + if (!is_null($this->container['easing']) && !in_array($this->container['easing'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'easing', must be one of '%s'", + $this->container['easing'], + 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 from + * + * @return mixed|null + */ + public function getFrom() + { + return $this->container['from']; + } + + /** + * Sets from + * + * @param mixed|null $from The initial property value at the start of the animation. + * + * @return self + */ + public function setFrom($from) + { + if (is_null($from)) { + array_push($this->openAPINullablesSetToNull, 'from'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('from', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['from'] = $from; + + return $this; + } + + /** + * Gets to + * + * @return mixed|null + */ + public function getTo() + { + return $this->container['to']; + } + + /** + * Sets to + * + * @param mixed|null $to The final property value at the end of the animation. + * + * @return self + */ + public function setTo($to) + { + if (is_null($to)) { + array_push($this->openAPINullablesSetToNull, 'to'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('to', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['to'] = $to; + + return $this; + } + + /** + * Gets start + * + * @return float|null + */ + public function getStart() + { + return $this->container['start']; + } + + /** + * Sets start + * + * @param float|null $start The time in seconds when the animation starts, relative to the clip, not the timeline. + * + * @return self + */ + public function setStart($start) + { + if (is_null($start)) { + throw new \InvalidArgumentException('non-nullable start cannot be null'); + } + $this->container['start'] = $start; + + return $this; + } + + /** + * Gets length + * + * @return float|null + */ + public function getLength() + { + return $this->container['length']; + } + + /** + * Sets length + * + * @param float|null $length The duration of the animation in seconds. + * + * @return self + */ + public function setLength($length) + { + if (is_null($length)) { + throw new \InvalidArgumentException('non-nullable length cannot be null'); + } + $this->container['length'] = $length; + + return $this; + } + + /** + * Gets interpolation + * + * @return string|null + */ + public function getInterpolation() + { + return $this->container['interpolation']; + } + + /** + * Sets interpolation + * + * @param string|null $interpolation The interpolation method to use for the animation. Available options are:
  • `linear` - a linear interpolation between the start and end values.
  • `bezier` - a bezier curve interpolation between the start and end values.
  • `constant` - an interpolation where the property instantly jumps from the start to the end value, without any gradual transition.
+ * + * @return self + */ + public function setInterpolation($interpolation) + { + if (is_null($interpolation)) { + throw new \InvalidArgumentException('non-nullable interpolation cannot be null'); + } + $allowedValues = $this->getInterpolationAllowableValues(); + if (!in_array($interpolation, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'interpolation', must be one of '%s'", + $interpolation, + implode("', '", $allowedValues) + ) + ); + } + $this->container['interpolation'] = $interpolation; + + return $this; + } + + /** + * Gets easing + * + * @return string|null + */ + public function getEasing() + { + return $this->container['easing']; + } + + /** + * Sets easing + * + * @param string|null $easing The easing function to use for the animation. Easing controls the rate of change of the animated value, allowing for more natural motion by speeding up or slowing down the animation at different points. Only applicable if interpolation is set to `bezier`. + * + * @return self + */ + public function setEasing($easing) + { + if (is_null($easing)) { + throw new \InvalidArgumentException('non-nullable easing cannot be null'); + } + $allowedValues = $this->getEasingAllowableValues(); + if (!in_array($easing, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'easing', must be one of '%s'", + $easing, + implode("', '", $allowedValues) + ) + ); + } + $this->container['easing'] = $easing; + + 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() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/UploadResponse.php b/src/Model/UploadResponse.php index c207331..8f44dfd 100644 --- a/src/Model/UploadResponse.php +++ b/src/Model/UploadResponse.php @@ -5,7 +5,7 @@ * PHP version 7.4 * * @category Class - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech */ @@ -26,17 +26,17 @@ * Do not edit the class manually. */ -namespace Shotstack\Client\Model; +namespace ShotstackClient\Model; use \ArrayAccess; -use \Shotstack\Client\ObjectSerializer; +use \ShotstackClient\ObjectSerializer; /** * UploadResponse Class Doc Comment * * @category Class * @description The response returned by the Ingest API [direct upload](#direct-upload) request. Includes the id of the file and the signed url to send the binary file to. The response follows the [json:api](https://jsonapi.org/) specification. - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech * @implements \ArrayAccess @@ -58,7 +58,7 @@ class UploadResponse implements ModelInterface, ArrayAccess, \JsonSerializable * @var string[] */ protected static $openAPITypes = [ - 'data' => '\Shotstack\Client\Model\UploadResponseData' + 'data' => '\ShotstackClient\Model\UploadResponseData' ]; /** @@ -296,7 +296,7 @@ public function valid() /** * Gets data * - * @return \Shotstack\Client\Model\UploadResponseData + * @return \ShotstackClient\Model\UploadResponseData */ public function getData() { @@ -306,7 +306,7 @@ public function getData() /** * Sets data * - * @param \Shotstack\Client\Model\UploadResponseData $data data + * @param \ShotstackClient\Model\UploadResponseData $data data * * @return self */ diff --git a/src/Model/UploadResponseAttributes.php b/src/Model/UploadResponseAttributes.php index 9a716ae..9880740 100644 --- a/src/Model/UploadResponseAttributes.php +++ b/src/Model/UploadResponseAttributes.php @@ -5,7 +5,7 @@ * PHP version 7.4 * * @category Class - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech */ @@ -26,17 +26,17 @@ * Do not edit the class manually. */ -namespace Shotstack\Client\Model; +namespace ShotstackClient\Model; use \ArrayAccess; -use \Shotstack\Client\ObjectSerializer; +use \ShotstackClient\ObjectSerializer; /** * UploadResponseAttributes Class Doc Comment * * @category Class * @description The id and attributes of the upload file including the signed URL to send the binary file data to. - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech * @implements \ArrayAccess diff --git a/src/Model/UploadResponseData.php b/src/Model/UploadResponseData.php index 6a543c0..f933226 100644 --- a/src/Model/UploadResponseData.php +++ b/src/Model/UploadResponseData.php @@ -5,7 +5,7 @@ * PHP version 7.4 * * @category Class - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech */ @@ -26,17 +26,17 @@ * Do not edit the class manually. */ -namespace Shotstack\Client\Model; +namespace ShotstackClient\Model; use \ArrayAccess; -use \Shotstack\Client\ObjectSerializer; +use \ShotstackClient\ObjectSerializer; /** * UploadResponseData Class Doc Comment * * @category Class * @description The type of resource (an upload), it's id and attributes of the upload request. - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech * @implements \ArrayAccess @@ -60,7 +60,7 @@ class UploadResponseData implements ModelInterface, ArrayAccess, \JsonSerializab protected static $openAPITypes = [ 'type' => 'string', 'id' => 'string', - 'attributes' => '\Shotstack\Client\Model\UploadResponseAttributes' + 'attributes' => '\ShotstackClient\Model\UploadResponseAttributes' ]; /** @@ -370,7 +370,7 @@ public function setId($id) /** * Gets attributes * - * @return \Shotstack\Client\Model\UploadResponseAttributes + * @return \ShotstackClient\Model\UploadResponseAttributes */ public function getAttributes() { @@ -380,7 +380,7 @@ public function getAttributes() /** * Sets attributes * - * @param \Shotstack\Client\Model\UploadResponseAttributes $attributes attributes + * @param \ShotstackClient\Model\UploadResponseAttributes $attributes attributes * * @return self */ diff --git a/src/Model/VideoAsset.php b/src/Model/VideoAsset.php index c49134f..b643b62 100644 --- a/src/Model/VideoAsset.php +++ b/src/Model/VideoAsset.php @@ -5,7 +5,7 @@ * PHP version 7.4 * * @category Class - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech */ @@ -26,17 +26,17 @@ * Do not edit the class manually. */ -namespace Shotstack\Client\Model; +namespace ShotstackClient\Model; use \ArrayAccess; -use \Shotstack\Client\ObjectSerializer; +use \ShotstackClient\ObjectSerializer; /** * VideoAsset Class Doc Comment * * @category Class * @description The VideoAsset is used to create video sequences from video files. The src must be a publicly accessible URL to a video resource such as an mp4 file. - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech * @implements \ArrayAccess @@ -60,11 +60,13 @@ class VideoAsset implements ModelInterface, ArrayAccess, \JsonSerializable protected static $openAPITypes = [ 'type' => 'string', 'src' => 'string', + 'transcode' => 'bool', 'trim' => 'float', - 'volume' => 'float', + 'volume' => '\ShotstackClient\Model\VideoAssetVolume', 'volume_effect' => 'string', 'speed' => 'float', - 'crop' => '\Shotstack\Client\Model\Crop' + 'crop' => '\ShotstackClient\Model\Crop', + 'chroma_key' => '\ShotstackClient\Model\ChromaKey' ]; /** @@ -77,11 +79,13 @@ class VideoAsset implements ModelInterface, ArrayAccess, \JsonSerializable protected static $openAPIFormats = [ 'type' => null, 'src' => null, + 'transcode' => null, 'trim' => null, 'volume' => null, 'volume_effect' => null, 'speed' => 'float', - 'crop' => null + 'crop' => null, + 'chroma_key' => null ]; /** @@ -92,11 +96,13 @@ class VideoAsset implements ModelInterface, ArrayAccess, \JsonSerializable protected static array $openAPINullables = [ 'type' => false, 'src' => false, + 'transcode' => false, 'trim' => false, 'volume' => false, 'volume_effect' => false, 'speed' => false, - 'crop' => false + 'crop' => false, + 'chroma_key' => false ]; /** @@ -187,11 +193,13 @@ public function isNullableSetToNull(string $property): bool protected static $attributeMap = [ 'type' => 'type', 'src' => 'src', + 'transcode' => 'transcode', 'trim' => 'trim', 'volume' => 'volume', 'volume_effect' => 'volumeEffect', 'speed' => 'speed', - 'crop' => 'crop' + 'crop' => 'crop', + 'chroma_key' => 'chromaKey' ]; /** @@ -202,11 +210,13 @@ public function isNullableSetToNull(string $property): bool protected static $setters = [ 'type' => 'setType', 'src' => 'setSrc', + 'transcode' => 'setTranscode', 'trim' => 'setTrim', 'volume' => 'setVolume', 'volume_effect' => 'setVolumeEffect', 'speed' => 'setSpeed', - 'crop' => 'setCrop' + 'crop' => 'setCrop', + 'chroma_key' => 'setChromaKey' ]; /** @@ -217,11 +227,13 @@ public function isNullableSetToNull(string $property): bool protected static $getters = [ 'type' => 'getType', 'src' => 'getSrc', + 'transcode' => 'getTranscode', 'trim' => 'getTrim', 'volume' => 'getVolume', 'volume_effect' => 'getVolumeEffect', 'speed' => 'getSpeed', - 'crop' => 'getCrop' + 'crop' => 'getCrop', + 'chroma_key' => 'getChromaKey' ]; /** @@ -265,10 +277,24 @@ public function getModelName() return self::$openAPIModelName; } + public const TYPE_VIDEO = 'video'; + public const VOLUME_EFFECT_NONE = 'none'; public const VOLUME_EFFECT_FADE_IN = 'fadeIn'; public const VOLUME_EFFECT_FADE_OUT = 'fadeOut'; public const VOLUME_EFFECT_FADE_IN_FADE_OUT = 'fadeInFadeOut'; + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_VIDEO, + ]; + } + /** * Gets allowable values of the enum * @@ -277,6 +303,7 @@ public function getModelName() public function getVolumeEffectAllowableValues() { return [ + self::VOLUME_EFFECT_NONE, self::VOLUME_EFFECT_FADE_IN, self::VOLUME_EFFECT_FADE_OUT, self::VOLUME_EFFECT_FADE_IN_FADE_OUT, @@ -300,11 +327,13 @@ public function __construct(array $data = null) { $this->setIfExists('type', $data ?? [], 'video'); $this->setIfExists('src', $data ?? [], null); + $this->setIfExists('transcode', $data ?? [], null); $this->setIfExists('trim', $data ?? [], null); $this->setIfExists('volume', $data ?? [], null); $this->setIfExists('volume_effect', $data ?? [], null); $this->setIfExists('speed', $data ?? [], null); $this->setIfExists('crop', $data ?? [], null); + $this->setIfExists('chroma_key', $data ?? [], null); } /** @@ -337,9 +366,26 @@ public function listInvalidProperties() if ($this->container['type'] === null) { $invalidProperties[] = "'type' can't be null"; } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + if ($this->container['src'] === null) { $invalidProperties[] = "'src' can't be null"; } + if ((mb_strlen($this->container['src']) < 1)) { + $invalidProperties[] = "invalid value for 'src', the character length must be bigger than or equal to 1."; + } + + if (!preg_match("/\\S/", $this->container['src'])) { + $invalidProperties[] = "invalid value for 'src', must be conform to the pattern /\\S/."; + } + $allowedValues = $this->getVolumeEffectAllowableValues(); if (!is_null($this->container['volume_effect']) && !in_array($this->container['volume_effect'], $allowedValues, true)) { $invalidProperties[] = sprintf( @@ -394,6 +440,16 @@ public function setType($type) if (is_null($type)) { throw new \InvalidArgumentException('non-nullable type cannot be null'); } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } $this->container['type'] = $type; return $this; @@ -421,11 +477,46 @@ public function setSrc($src) if (is_null($src)) { throw new \InvalidArgumentException('non-nullable src cannot be null'); } + + if ((mb_strlen($src) < 1)) { + throw new \InvalidArgumentException('invalid length for $src when calling VideoAsset., must be bigger than or equal to 1.'); + } + if ((!preg_match("/\\S/", ObjectSerializer::toString($src)))) { + throw new \InvalidArgumentException("invalid value for \$src when calling VideoAsset., must conform to the pattern /\\S/."); + } + $this->container['src'] = $src; return $this; } + /** + * Gets transcode + * + * @return bool|null + */ + public function getTranscode() + { + return $this->container['transcode']; + } + + /** + * Sets transcode + * + * @param bool|null $transcode Set to `true` to force re-encoding of the video during preprocessing. This can help resolve compatibility issues, fix rotation problems, synchronize audio, or convert formats. The video will be processed to ensure optimal compatibility with the rendering engine. + * + * @return self + */ + public function setTranscode($transcode) + { + if (is_null($transcode)) { + throw new \InvalidArgumentException('non-nullable transcode cannot be null'); + } + $this->container['transcode'] = $transcode; + + return $this; + } + /** * Gets trim * @@ -456,7 +547,7 @@ public function setTrim($trim) /** * Gets volume * - * @return float|null + * @return \ShotstackClient\Model\VideoAssetVolume|null */ public function getVolume() { @@ -466,7 +557,7 @@ public function getVolume() /** * Sets volume * - * @param float|null $volume Set the volume for the video clip between 0 and 1 where 0 is muted and 1 is full volume (defaults to 1). + * @param \ShotstackClient\Model\VideoAssetVolume|null $volume volume * * @return self */ @@ -493,7 +584,7 @@ public function getVolumeEffect() /** * Sets volume_effect * - * @param string|null $volume_effect The volume effect to apply to the video asset
  • `fadeIn` - fade volume in only
  • `fadeOut` - fade volume out only
  • `fadeInFadeOut` - fade volume in and out
+ * @param string|null $volume_effect Preset volume effects to apply to the video asset
  • `fadeIn` - fade volume in only
  • `fadeOut` - fade volume out only
  • `fadeInFadeOut` - fade volume in and out
* * @return self */ @@ -555,7 +646,7 @@ public function setSpeed($speed) /** * Gets crop * - * @return \Shotstack\Client\Model\Crop|null + * @return \ShotstackClient\Model\Crop|null */ public function getCrop() { @@ -565,7 +656,7 @@ public function getCrop() /** * Sets crop * - * @param \Shotstack\Client\Model\Crop|null $crop crop + * @param \ShotstackClient\Model\Crop|null $crop crop * * @return self */ @@ -578,6 +669,33 @@ public function setCrop($crop) return $this; } + + /** + * Gets chroma_key + * + * @return \ShotstackClient\Model\ChromaKey|null + */ + public function getChromaKey() + { + return $this->container['chroma_key']; + } + + /** + * Sets chroma_key + * + * @param \ShotstackClient\Model\ChromaKey|null $chroma_key chroma_key + * + * @return self + */ + public function setChromaKey($chroma_key) + { + if (is_null($chroma_key)) { + throw new \InvalidArgumentException('non-nullable chroma_key cannot be null'); + } + $this->container['chroma_key'] = $chroma_key; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/src/Model/VideoAssetVolume.php b/src/Model/VideoAssetVolume.php new file mode 100644 index 0000000..e5657a4 --- /dev/null +++ b/src/Model/VideoAssetVolume.php @@ -0,0 +1,382 @@ + + */ +class VideoAssetVolume implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'VideoAsset_volume'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + + ]; + + /** + * 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; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $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 = [ + + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + + ]; + + /** + * 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) + { + } + + /** + * 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 = []; + + 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; + } + + /** + * 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() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/OpenAiGeneratedAsset.php b/src/Model/VimeoDestination.php similarity index 81% rename from src/Model/OpenAiGeneratedAsset.php rename to src/Model/VimeoDestination.php index 13cb776..f19c5a8 100644 --- a/src/Model/OpenAiGeneratedAsset.php +++ b/src/Model/VimeoDestination.php @@ -1,11 +1,11 @@ */ -class OpenAiGeneratedAsset implements ModelInterface, ArrayAccess, \JsonSerializable +class VimeoDestination implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; @@ -50,7 +50,7 @@ class OpenAiGeneratedAsset implements ModelInterface, ArrayAccess, \JsonSerializ * * @var string */ - protected static $openAPIModelName = 'OpenAiGeneratedAsset'; + protected static $openAPIModelName = 'VimeoDestination'; /** * Array of property to type mappings. Used for (de)serialization @@ -59,7 +59,7 @@ class OpenAiGeneratedAsset implements ModelInterface, ArrayAccess, \JsonSerializ */ protected static $openAPITypes = [ 'provider' => 'string', - 'options' => '\Shotstack\Client\Model\OpenAiGeneratedAssetOptions' + 'options' => '\ShotstackClient\Model\VimeoDestinationOptions' ]; /** @@ -235,19 +235,6 @@ public function getModelName() return self::$openAPIModelName; } - public const PROVIDER_OPENAI = 'openai'; - - /** - * Gets allowable values of the enum - * - * @return string[] - */ - public function getProviderAllowableValues() - { - return [ - self::PROVIDER_OPENAI, - ]; - } /** * Associative array for storing property values @@ -264,7 +251,7 @@ public function getProviderAllowableValues() */ public function __construct(array $data = null) { - $this->setIfExists('provider', $data ?? [], 'openai'); + $this->setIfExists('provider', $data ?? [], 'vimeo'); $this->setIfExists('options', $data ?? [], null); } @@ -298,18 +285,6 @@ public function listInvalidProperties() if ($this->container['provider'] === null) { $invalidProperties[] = "'provider' can't be null"; } - $allowedValues = $this->getProviderAllowableValues(); - if (!is_null($this->container['provider']) && !in_array($this->container['provider'], $allowedValues, true)) { - $invalidProperties[] = sprintf( - "invalid value '%s' for 'provider', must be one of '%s'", - $this->container['provider'], - implode("', '", $allowedValues) - ); - } - - if ($this->container['options'] === null) { - $invalidProperties[] = "'options' can't be null"; - } return $invalidProperties; } @@ -338,7 +313,7 @@ public function getProvider() /** * Sets provider * - * @param string $provider The name of the provider - set to `openai` for OpenAI. + * @param string $provider The destination to send video to - set to `vimeo` for Vimeo. * * @return self */ @@ -347,16 +322,6 @@ public function setProvider($provider) if (is_null($provider)) { throw new \InvalidArgumentException('non-nullable provider cannot be null'); } - $allowedValues = $this->getProviderAllowableValues(); - if (!in_array($provider, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value '%s' for 'provider', must be one of '%s'", - $provider, - implode("', '", $allowedValues) - ) - ); - } $this->container['provider'] = $provider; return $this; @@ -365,7 +330,7 @@ public function setProvider($provider) /** * Gets options * - * @return \Shotstack\Client\Model\OpenAiGeneratedAssetOptions + * @return \ShotstackClient\Model\VimeoDestinationOptions|null */ public function getOptions() { @@ -375,7 +340,7 @@ public function getOptions() /** * Sets options * - * @param \Shotstack\Client\Model\OpenAiGeneratedAssetOptions $options options + * @param \ShotstackClient\Model\VimeoDestinationOptions|null $options options * * @return self */ diff --git a/src/Model/VimeoDestinationOptions.php b/src/Model/VimeoDestinationOptions.php new file mode 100644 index 0000000..f765fb0 --- /dev/null +++ b/src/Model/VimeoDestinationOptions.php @@ -0,0 +1,512 @@ + + */ +class VimeoDestinationOptions implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'VimeoDestinationOptions'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'name' => 'string', + 'description' => 'string', + 'privacy' => '\ShotstackClient\Model\VimeoDestinationPrivacyOptions', + 'folder_uri' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'name' => null, + 'description' => null, + 'privacy' => null, + 'folder_uri' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'name' => false, + 'description' => false, + 'privacy' => false, + 'folder_uri' => 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; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $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', + 'description' => 'description', + 'privacy' => 'privacy', + 'folder_uri' => 'folderUri' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName', + 'description' => 'setDescription', + 'privacy' => 'setPrivacy', + 'folder_uri' => 'setFolderUri' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName', + 'description' => 'getDescription', + 'privacy' => 'getPrivacy', + 'folder_uri' => 'getFolderUri' + ]; + + /** + * 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) + { + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('privacy', $data ?? [], null); + $this->setIfExists('folder_uri', $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 = []; + + 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 A name or title for the video that will be displayed on the Vimeo website. + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description A description of the video that will be displayed on the Vimeo website. + * + * @return self + */ + public function setDescription($description) + { + if (is_null($description)) { + throw new \InvalidArgumentException('non-nullable description cannot be null'); + } + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets privacy + * + * @return \ShotstackClient\Model\VimeoDestinationPrivacyOptions|null + */ + public function getPrivacy() + { + return $this->container['privacy']; + } + + /** + * Sets privacy + * + * @param \ShotstackClient\Model\VimeoDestinationPrivacyOptions|null $privacy privacy + * + * @return self + */ + public function setPrivacy($privacy) + { + if (is_null($privacy)) { + throw new \InvalidArgumentException('non-nullable privacy cannot be null'); + } + $this->container['privacy'] = $privacy; + + return $this; + } + + /** + * Gets folder_uri + * + * @return string|null + */ + public function getFolderUri() + { + return $this->container['folder_uri']; + } + + /** + * Sets folder_uri + * + * @param string|null $folder_uri The Vimeo folder URI to upload the video to. The folder must already exist in your Vimeo account. + * + * @return self + */ + public function setFolderUri($folder_uri) + { + if (is_null($folder_uri)) { + throw new \InvalidArgumentException('non-nullable folder_uri cannot be null'); + } + $this->container['folder_uri'] = $folder_uri; + + 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() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/VimeoDestinationPrivacyOptions.php b/src/Model/VimeoDestinationPrivacyOptions.php new file mode 100644 index 0000000..3b6e25e --- /dev/null +++ b/src/Model/VimeoDestinationPrivacyOptions.php @@ -0,0 +1,658 @@ + + */ +class VimeoDestinationPrivacyOptions implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'VimeoDestinationPrivacyOptions'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'view' => 'string', + 'embed' => 'string', + 'comments' => 'string', + 'download' => 'bool', + 'add' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'view' => null, + 'embed' => null, + 'comments' => null, + 'download' => null, + 'add' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'view' => false, + 'embed' => false, + 'comments' => false, + 'download' => false, + 'add' => 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; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $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 = [ + 'view' => 'view', + 'embed' => 'embed', + 'comments' => 'comments', + 'download' => 'download', + 'add' => 'add' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'view' => 'setView', + 'embed' => 'setEmbed', + 'comments' => 'setComments', + 'download' => 'setDownload', + 'add' => 'setAdd' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'view' => 'getView', + 'embed' => 'getEmbed', + 'comments' => 'getComments', + 'download' => 'getDownload', + 'add' => 'getAdd' + ]; + + /** + * 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 VIEW_ANYBODY = 'anybody'; + public const VIEW_NOBODY = 'nobody'; + public const VIEW_CONTACTS = 'contacts'; + public const VIEW_PASSWORD = 'password'; + public const VIEW_UNLISTED = 'unlisted'; + public const EMBED__PUBLIC = 'public'; + public const EMBED__PRIVATE = 'private'; + public const EMBED_WHITELIST = 'whitelist'; + public const COMMENTS_ANYBODY = 'anybody'; + public const COMMENTS_NOBODY = 'nobody'; + public const COMMENTS_CONTACTS = 'contacts'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getViewAllowableValues() + { + return [ + self::VIEW_ANYBODY, + self::VIEW_NOBODY, + self::VIEW_CONTACTS, + self::VIEW_PASSWORD, + self::VIEW_UNLISTED, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getEmbedAllowableValues() + { + return [ + self::EMBED__PUBLIC, + self::EMBED__PRIVATE, + self::EMBED_WHITELIST, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getCommentsAllowableValues() + { + return [ + self::COMMENTS_ANYBODY, + self::COMMENTS_NOBODY, + self::COMMENTS_CONTACTS, + ]; + } + + /** + * 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) + { + $this->setIfExists('view', $data ?? [], null); + $this->setIfExists('embed', $data ?? [], null); + $this->setIfExists('comments', $data ?? [], null); + $this->setIfExists('download', $data ?? [], null); + $this->setIfExists('add', $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->getViewAllowableValues(); + if (!is_null($this->container['view']) && !in_array($this->container['view'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'view', must be one of '%s'", + $this->container['view'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getEmbedAllowableValues(); + if (!is_null($this->container['embed']) && !in_array($this->container['embed'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'embed', must be one of '%s'", + $this->container['embed'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getCommentsAllowableValues(); + if (!is_null($this->container['comments']) && !in_array($this->container['comments'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'comments', must be one of '%s'", + $this->container['comments'], + 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 view + * + * @return string|null + */ + public function getView() + { + return $this->container['view']; + } + + /** + * Sets view + * + * @param string|null $view Set who can view the videos. Available options are:
  • `anybody` - Anyone can view the video.
  • `nobody` - Only the video owner can view the video.
  • `contacts` - Only contacts can view the video.
  • `password` - A password is required to view the video.
  • `unlisted` - The video is not listed on Vimeo.
+ * + * @return self + */ + public function setView($view) + { + if (is_null($view)) { + throw new \InvalidArgumentException('non-nullable view cannot be null'); + } + $allowedValues = $this->getViewAllowableValues(); + if (!in_array($view, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'view', must be one of '%s'", + $view, + implode("', '", $allowedValues) + ) + ); + } + $this->container['view'] = $view; + + return $this; + } + + /** + * Gets embed + * + * @return string|null + */ + public function getEmbed() + { + return $this->container['embed']; + } + + /** + * Sets embed + * + * @param string|null $embed Set who can embed the video. Available options are:
  • `public` - Anyone can embed the video.
  • `private` - Only the video owner can embed the video.
  • `whitelist` - Only whitelisted domains can embed the video.
+ * + * @return self + */ + public function setEmbed($embed) + { + if (is_null($embed)) { + throw new \InvalidArgumentException('non-nullable embed cannot be null'); + } + $allowedValues = $this->getEmbedAllowableValues(); + if (!in_array($embed, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'embed', must be one of '%s'", + $embed, + implode("', '", $allowedValues) + ) + ); + } + $this->container['embed'] = $embed; + + return $this; + } + + /** + * Gets comments + * + * @return string|null + */ + public function getComments() + { + return $this->container['comments']; + } + + /** + * Sets comments + * + * @param string|null $comments Set who can comment on the video. Available options are:
  • `anybody` - Anyone can comment on the video.
  • `nobody` - Only the video owner can comment on the video.
  • `contacts` - Only contacts can comment on the video.
+ * + * @return self + */ + public function setComments($comments) + { + if (is_null($comments)) { + throw new \InvalidArgumentException('non-nullable comments cannot be null'); + } + $allowedValues = $this->getCommentsAllowableValues(); + if (!in_array($comments, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'comments', must be one of '%s'", + $comments, + implode("', '", $allowedValues) + ) + ); + } + $this->container['comments'] = $comments; + + return $this; + } + + /** + * Gets download + * + * @return bool|null + */ + public function getDownload() + { + return $this->container['download']; + } + + /** + * Sets download + * + * @param bool|null $download Set whether the video can be downloaded. + * + * @return self + */ + public function setDownload($download) + { + if (is_null($download)) { + throw new \InvalidArgumentException('non-nullable download cannot be null'); + } + $this->container['download'] = $download; + + return $this; + } + + /** + * Gets add + * + * @return bool|null + */ + public function getAdd() + { + return $this->container['add']; + } + + /** + * Sets add + * + * @param bool|null $add Set whether other users can add the video to their collections. + * + * @return self + */ + public function setAdd($add) + { + if (is_null($add)) { + throw new \InvalidArgumentException('non-nullable add cannot be null'); + } + $this->container['add'] = $add; + + 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() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/ObjectSerializer.php b/src/ObjectSerializer.php index 5f9d1ec..3d3e07a 100644 --- a/src/ObjectSerializer.php +++ b/src/ObjectSerializer.php @@ -5,7 +5,7 @@ * PHP version 7.4 * * @category Class - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech */ @@ -26,16 +26,16 @@ * Do not edit the class manually. */ -namespace Shotstack\Client; +namespace ShotstackClient; use GuzzleHttp\Psr7\Utils; -use Shotstack\Client\Model\ModelInterface; +use ShotstackClient\Model\ModelInterface; /** * ObjectSerializer Class Doc Comment * * @category Class - * @package Shotstack\Client + * @package ShotstackClient * @author OpenAPI Generator team * @link https://openapi-generator.tech */ @@ -513,7 +513,7 @@ public static function deserialize($data, $class, $httpHeaders = null) // If a discriminator is defined and points to a valid subclass, use it. $discriminator = $class::DISCRIMINATOR; if (!empty($discriminator) && isset($data->{$discriminator}) && is_string($data->{$discriminator})) { - $subclass = '\Shotstack\Client\Model\\' . $data->{$discriminator}; + $subclass = '\ShotstackClient\Model\\' . $data->{$discriminator}; if (is_subclass_of($subclass, $class)) { $class = $subclass; }