diff --git a/README.md b/README.md index 08d8067..45f9cb6 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ Convert API lets you effortlessly convert file formats and types. [Cloudmersive Document and Data Conversion API](https://www.cloudmersive.com/convert-api) provides advanced document conversion, editing and generation capabilities. - API version: v1 -- Package version: 2.1.4 +- Package version: 2.1.5 ## Requirements @@ -342,6 +342,7 @@ Class | Method | HTTP request | Description *TransformDocumentApi* | [**transformDocumentPptxReplace**](docs/Api/TransformDocumentApi.md#transformdocumentpptxreplace) | **POST** /convert/transform/pptx/replace-all | Replace string in PowerPoint PPTX presentation, return result *ValidateDocumentApi* | [**validateDocumentAutodetectValidation**](docs/Api/ValidateDocumentApi.md#validatedocumentautodetectvalidation) | **POST** /convert/validate/autodetect | Autodetect content type and validate *ValidateDocumentApi* | [**validateDocumentCsvValidation**](docs/Api/ValidateDocumentApi.md#validatedocumentcsvvalidation) | **POST** /convert/validate/csv | Validate a CSV file document (CSV) +*ValidateDocumentApi* | [**validateDocumentDocValidation**](docs/Api/ValidateDocumentApi.md#validatedocumentdocvalidation) | **POST** /convert/validate/doc | Validate a Word 97-2003 Legacy document (DOC) *ValidateDocumentApi* | [**validateDocumentDocxValidation**](docs/Api/ValidateDocumentApi.md#validatedocumentdocxvalidation) | **POST** /convert/validate/docx | Validate a Word document (DOCX) *ValidateDocumentApi* | [**validateDocumentEmlValidation**](docs/Api/ValidateDocumentApi.md#validatedocumentemlvalidation) | **POST** /convert/validate/eml | Validate if an EML file is executable *ValidateDocumentApi* | [**validateDocumentExecutableValidation**](docs/Api/ValidateDocumentApi.md#validatedocumentexecutablevalidation) | **POST** /convert/validate/executable | Validate if a file is executable @@ -354,10 +355,13 @@ Class | Method | HTTP request | Description *ValidateDocumentApi* | [**validateDocumentMsgValidation**](docs/Api/ValidateDocumentApi.md#validatedocumentmsgvalidation) | **POST** /convert/validate/msg | Validate if an MSG file is executable *ValidateDocumentApi* | [**validateDocumentPdfValidation**](docs/Api/ValidateDocumentApi.md#validatedocumentpdfvalidation) | **POST** /convert/validate/pdf | Validate a PDF document file *ValidateDocumentApi* | [**validateDocumentPngValidation**](docs/Api/ValidateDocumentApi.md#validatedocumentpngvalidation) | **POST** /convert/validate/png | Validate a PNG File +*ValidateDocumentApi* | [**validateDocumentPptValidation**](docs/Api/ValidateDocumentApi.md#validatedocumentpptvalidation) | **POST** /convert/validate/ppt | Validate a PowerPoint 97-2003 Legacy presentation (PPT) *ValidateDocumentApi* | [**validateDocumentPptxValidation**](docs/Api/ValidateDocumentApi.md#validatedocumentpptxvalidation) | **POST** /convert/validate/pptx | Validate a PowerPoint presentation (PPTX) *ValidateDocumentApi* | [**validateDocumentRarValidation**](docs/Api/ValidateDocumentApi.md#validatedocumentrarvalidation) | **POST** /convert/validate/rar | Validate a RAR Archive file (RAR) +*ValidateDocumentApi* | [**validateDocumentRtfValidation**](docs/Api/ValidateDocumentApi.md#validatedocumentrtfvalidation) | **POST** /convert/validate/rtf | Validate a Rich Text Format document (RTF) *ValidateDocumentApi* | [**validateDocumentTarValidation**](docs/Api/ValidateDocumentApi.md#validatedocumenttarvalidation) | **POST** /convert/validate/tar | Validate a TAR Tarball Archive file (TAR) *ValidateDocumentApi* | [**validateDocumentTxtValidation**](docs/Api/ValidateDocumentApi.md#validatedocumenttxtvalidation) | **POST** /convert/validate/txt | Validate an TXT file +*ValidateDocumentApi* | [**validateDocumentXlsValidation**](docs/Api/ValidateDocumentApi.md#validatedocumentxlsvalidation) | **POST** /convert/validate/xls | Validate a Excel 97-2003 Legacy spreadsheet (XLS) *ValidateDocumentApi* | [**validateDocumentXlsxValidation**](docs/Api/ValidateDocumentApi.md#validatedocumentxlsxvalidation) | **POST** /convert/validate/xlsx | Validate a Excel document (XLSX) *ValidateDocumentApi* | [**validateDocumentXmlValidation**](docs/Api/ValidateDocumentApi.md#validatedocumentxmlvalidation) | **POST** /convert/validate/xml | Validate an XML file *ValidateDocumentApi* | [**validateDocumentXmlXxeThreatValidation**](docs/Api/ValidateDocumentApi.md#validatedocumentxmlxxethreatvalidation) | **POST** /convert/validate/xml/xxe-threats | Validate an XML file for XML External Entity (XXE) threats diff --git a/composer.json b/composer.json index e7d52fd..35d0db7 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "cloudmersive/cloudmersive_document_convert_api_client", - "version": "2.1.4", + "version": "2.1.5", "description": "", "keywords": [ "swagger", diff --git a/docs/Api/ValidateDocumentApi.md b/docs/Api/ValidateDocumentApi.md index a5f5864..cfaf5d2 100644 --- a/docs/Api/ValidateDocumentApi.md +++ b/docs/Api/ValidateDocumentApi.md @@ -6,6 +6,7 @@ Method | HTTP request | Description ------------- | ------------- | ------------- [**validateDocumentAutodetectValidation**](ValidateDocumentApi.md#validateDocumentAutodetectValidation) | **POST** /convert/validate/autodetect | Autodetect content type and validate [**validateDocumentCsvValidation**](ValidateDocumentApi.md#validateDocumentCsvValidation) | **POST** /convert/validate/csv | Validate a CSV file document (CSV) +[**validateDocumentDocValidation**](ValidateDocumentApi.md#validateDocumentDocValidation) | **POST** /convert/validate/doc | Validate a Word 97-2003 Legacy document (DOC) [**validateDocumentDocxValidation**](ValidateDocumentApi.md#validateDocumentDocxValidation) | **POST** /convert/validate/docx | Validate a Word document (DOCX) [**validateDocumentEmlValidation**](ValidateDocumentApi.md#validateDocumentEmlValidation) | **POST** /convert/validate/eml | Validate if an EML file is executable [**validateDocumentExecutableValidation**](ValidateDocumentApi.md#validateDocumentExecutableValidation) | **POST** /convert/validate/executable | Validate if a file is executable @@ -18,10 +19,13 @@ Method | HTTP request | Description [**validateDocumentMsgValidation**](ValidateDocumentApi.md#validateDocumentMsgValidation) | **POST** /convert/validate/msg | Validate if an MSG file is executable [**validateDocumentPdfValidation**](ValidateDocumentApi.md#validateDocumentPdfValidation) | **POST** /convert/validate/pdf | Validate a PDF document file [**validateDocumentPngValidation**](ValidateDocumentApi.md#validateDocumentPngValidation) | **POST** /convert/validate/png | Validate a PNG File +[**validateDocumentPptValidation**](ValidateDocumentApi.md#validateDocumentPptValidation) | **POST** /convert/validate/ppt | Validate a PowerPoint 97-2003 Legacy presentation (PPT) [**validateDocumentPptxValidation**](ValidateDocumentApi.md#validateDocumentPptxValidation) | **POST** /convert/validate/pptx | Validate a PowerPoint presentation (PPTX) [**validateDocumentRarValidation**](ValidateDocumentApi.md#validateDocumentRarValidation) | **POST** /convert/validate/rar | Validate a RAR Archive file (RAR) +[**validateDocumentRtfValidation**](ValidateDocumentApi.md#validateDocumentRtfValidation) | **POST** /convert/validate/rtf | Validate a Rich Text Format document (RTF) [**validateDocumentTarValidation**](ValidateDocumentApi.md#validateDocumentTarValidation) | **POST** /convert/validate/tar | Validate a TAR Tarball Archive file (TAR) [**validateDocumentTxtValidation**](ValidateDocumentApi.md#validateDocumentTxtValidation) | **POST** /convert/validate/txt | Validate an TXT file +[**validateDocumentXlsValidation**](ValidateDocumentApi.md#validateDocumentXlsValidation) | **POST** /convert/validate/xls | Validate a Excel 97-2003 Legacy spreadsheet (XLS) [**validateDocumentXlsxValidation**](ValidateDocumentApi.md#validateDocumentXlsxValidation) | **POST** /convert/validate/xlsx | Validate a Excel document (XLSX) [**validateDocumentXmlValidation**](ValidateDocumentApi.md#validateDocumentXmlValidation) | **POST** /convert/validate/xml | Validate an XML file [**validateDocumentXmlXxeThreatValidation**](ValidateDocumentApi.md#validateDocumentXmlXxeThreatValidation) | **POST** /convert/validate/xml/xxe-threats | Validate an XML file for XML External Entity (XXE) threats @@ -138,6 +142,61 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) +# **validateDocumentDocValidation** +> \Swagger\Client\Model\DocumentValidationResult validateDocumentDocValidation($input_file) + +Validate a Word 97-2003 Legacy document (DOC) + +Validate a Word 97-2003 Legacy document (DOC) + +### Example +```php +setApiKey('Apikey', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Apikey', 'Bearer'); + +$apiInstance = new Swagger\Client\Api\ValidateDocumentApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$input_file = "/path/to/file.txt"; // \SplFileObject | Input file to perform the operation on. + +try { + $result = $apiInstance->validateDocumentDocValidation($input_file); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ValidateDocumentApi->validateDocumentDocValidation: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **input_file** | **\SplFileObject**| Input file to perform the operation on. | + +### Return type + +[**\Swagger\Client\Model\DocumentValidationResult**](../Model/DocumentValidationResult.md) + +### Authorization + +[Apikey](../../README.md#Apikey) + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: application/json, text/json, application/xml, text/xml + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + # **validateDocumentDocxValidation** > \Swagger\Client\Model\DocumentValidationResult validateDocumentDocxValidation($input_file) @@ -798,6 +857,61 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) +# **validateDocumentPptValidation** +> \Swagger\Client\Model\DocumentValidationResult validateDocumentPptValidation($input_file) + +Validate a PowerPoint 97-2003 Legacy presentation (PPT) + +Validate a PowerPoint 97-2003 Legacy presentation (PPT) + +### Example +```php +setApiKey('Apikey', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Apikey', 'Bearer'); + +$apiInstance = new Swagger\Client\Api\ValidateDocumentApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$input_file = "/path/to/file.txt"; // \SplFileObject | Input file to perform the operation on. + +try { + $result = $apiInstance->validateDocumentPptValidation($input_file); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ValidateDocumentApi->validateDocumentPptValidation: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **input_file** | **\SplFileObject**| Input file to perform the operation on. | + +### Return type + +[**\Swagger\Client\Model\DocumentValidationResult**](../Model/DocumentValidationResult.md) + +### Authorization + +[Apikey](../../README.md#Apikey) + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: application/json, text/json, application/xml, text/xml + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + # **validateDocumentPptxValidation** > \Swagger\Client\Model\DocumentValidationResult validateDocumentPptxValidation($input_file) @@ -908,6 +1022,61 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) +# **validateDocumentRtfValidation** +> \Swagger\Client\Model\DocumentValidationResult validateDocumentRtfValidation($input_file) + +Validate a Rich Text Format document (RTF) + +Validate a Rich Text Format document (RTF) + +### Example +```php +setApiKey('Apikey', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Apikey', 'Bearer'); + +$apiInstance = new Swagger\Client\Api\ValidateDocumentApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$input_file = "/path/to/file.txt"; // \SplFileObject | Input file to perform the operation on. + +try { + $result = $apiInstance->validateDocumentRtfValidation($input_file); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ValidateDocumentApi->validateDocumentRtfValidation: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **input_file** | **\SplFileObject**| Input file to perform the operation on. | + +### Return type + +[**\Swagger\Client\Model\DocumentValidationResult**](../Model/DocumentValidationResult.md) + +### Authorization + +[Apikey](../../README.md#Apikey) + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: application/json, text/json, application/xml, text/xml + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + # **validateDocumentTarValidation** > \Swagger\Client\Model\DocumentValidationResult validateDocumentTarValidation($input_file) @@ -1018,6 +1187,61 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) +# **validateDocumentXlsValidation** +> \Swagger\Client\Model\DocumentValidationResult validateDocumentXlsValidation($input_file) + +Validate a Excel 97-2003 Legacy spreadsheet (XLS) + +Validate a Excel 97-2003 Legacy spreadsheet (XLS) + +### Example +```php +setApiKey('Apikey', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Apikey', 'Bearer'); + +$apiInstance = new Swagger\Client\Api\ValidateDocumentApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$input_file = "/path/to/file.txt"; // \SplFileObject | Input file to perform the operation on. + +try { + $result = $apiInstance->validateDocumentXlsValidation($input_file); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ValidateDocumentApi->validateDocumentXlsValidation: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **input_file** | **\SplFileObject**| Input file to perform the operation on. | + +### Return type + +[**\Swagger\Client\Model\DocumentValidationResult**](../Model/DocumentValidationResult.md) + +### Authorization + +[Apikey](../../README.md#Apikey) + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: application/json, text/json, application/xml, text/xml + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + # **validateDocumentXlsxValidation** > \Swagger\Client\Model\DocumentValidationResult validateDocumentXlsxValidation($input_file) diff --git a/lib/Api/ValidateDocumentApi.php b/lib/Api/ValidateDocumentApi.php index 014e27b..ecee8d0 100644 --- a/lib/Api/ValidateDocumentApi.php +++ b/lib/Api/ValidateDocumentApi.php @@ -536,6 +536,270 @@ protected function validateDocumentCsvValidationRequest($input_file) + // form params + if ($input_file !== null) { + $multipart = true; + $formParams['inputFile'] = \GuzzleHttp\Psr7\try_fopen(ObjectSerializer::toFormValue($input_file), 'rb'); + } + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json', 'text/json', 'application/xml', 'text/xml'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'text/json', 'application/xml', 'text/xml'], + ['multipart/form-data'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Apikey'); + if ($apiKey !== null) { + $headers['Apikey'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation validateDocumentDocValidation + * + * Validate a Word 97-2003 Legacy document (DOC) + * + * @param \SplFileObject $input_file Input file to perform the operation on. (required) + * + * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Swagger\Client\Model\DocumentValidationResult + */ + public function validateDocumentDocValidation($input_file) + { + list($response) = $this->validateDocumentDocValidationWithHttpInfo($input_file); + return $response; + } + + /** + * Operation validateDocumentDocValidationWithHttpInfo + * + * Validate a Word 97-2003 Legacy document (DOC) + * + * @param \SplFileObject $input_file Input file to perform the operation on. (required) + * + * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Swagger\Client\Model\DocumentValidationResult, HTTP status code, HTTP response headers (array of strings) + */ + public function validateDocumentDocValidationWithHttpInfo($input_file) + { + $returnType = '\Swagger\Client\Model\DocumentValidationResult'; + $request = $this->validateDocumentDocValidationRequest($input_file); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Swagger\Client\Model\DocumentValidationResult', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation validateDocumentDocValidationAsync + * + * Validate a Word 97-2003 Legacy document (DOC) + * + * @param \SplFileObject $input_file Input file to perform the operation on. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function validateDocumentDocValidationAsync($input_file) + { + return $this->validateDocumentDocValidationAsyncWithHttpInfo($input_file) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation validateDocumentDocValidationAsyncWithHttpInfo + * + * Validate a Word 97-2003 Legacy document (DOC) + * + * @param \SplFileObject $input_file Input file to perform the operation on. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function validateDocumentDocValidationAsyncWithHttpInfo($input_file) + { + $returnType = '\Swagger\Client\Model\DocumentValidationResult'; + $request = $this->validateDocumentDocValidationRequest($input_file); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + 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(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'validateDocumentDocValidation' + * + * @param \SplFileObject $input_file Input file to perform the operation on. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function validateDocumentDocValidationRequest($input_file) + { + // verify the required parameter 'input_file' is set + if ($input_file === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $input_file when calling validateDocumentDocValidation' + ); + } + + $resourcePath = '/convert/validate/doc'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + // form params if ($input_file !== null) { $multipart = true; @@ -3779,9 +4043,9 @@ protected function validateDocumentPngValidationRequest($input_file) } /** - * Operation validateDocumentPptxValidation + * Operation validateDocumentPptValidation * - * Validate a PowerPoint presentation (PPTX) + * Validate a PowerPoint 97-2003 Legacy presentation (PPT) * * @param \SplFileObject $input_file Input file to perform the operation on. (required) * @@ -3789,16 +4053,16 @@ protected function validateDocumentPngValidationRequest($input_file) * @throws \InvalidArgumentException * @return \Swagger\Client\Model\DocumentValidationResult */ - public function validateDocumentPptxValidation($input_file) + public function validateDocumentPptValidation($input_file) { - list($response) = $this->validateDocumentPptxValidationWithHttpInfo($input_file); + list($response) = $this->validateDocumentPptValidationWithHttpInfo($input_file); return $response; } /** - * Operation validateDocumentPptxValidationWithHttpInfo + * Operation validateDocumentPptValidationWithHttpInfo * - * Validate a PowerPoint presentation (PPTX) + * Validate a PowerPoint 97-2003 Legacy presentation (PPT) * * @param \SplFileObject $input_file Input file to perform the operation on. (required) * @@ -3806,10 +4070,10 @@ public function validateDocumentPptxValidation($input_file) * @throws \InvalidArgumentException * @return array of \Swagger\Client\Model\DocumentValidationResult, HTTP status code, HTTP response headers (array of strings) */ - public function validateDocumentPptxValidationWithHttpInfo($input_file) + public function validateDocumentPptValidationWithHttpInfo($input_file) { $returnType = '\Swagger\Client\Model\DocumentValidationResult'; - $request = $this->validateDocumentPptxValidationRequest($input_file); + $request = $this->validateDocumentPptValidationRequest($input_file); try { $options = $this->createHttpClientOption(); @@ -3871,18 +4135,282 @@ public function validateDocumentPptxValidationWithHttpInfo($input_file) } /** - * Operation validateDocumentPptxValidationAsync + * Operation validateDocumentPptValidationAsync * - * Validate a PowerPoint presentation (PPTX) + * Validate a PowerPoint 97-2003 Legacy presentation (PPT) * * @param \SplFileObject $input_file Input file to perform the operation on. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function validateDocumentPptxValidationAsync($input_file) + public function validateDocumentPptValidationAsync($input_file) { - return $this->validateDocumentPptxValidationAsyncWithHttpInfo($input_file) + return $this->validateDocumentPptValidationAsyncWithHttpInfo($input_file) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation validateDocumentPptValidationAsyncWithHttpInfo + * + * Validate a PowerPoint 97-2003 Legacy presentation (PPT) + * + * @param \SplFileObject $input_file Input file to perform the operation on. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function validateDocumentPptValidationAsyncWithHttpInfo($input_file) + { + $returnType = '\Swagger\Client\Model\DocumentValidationResult'; + $request = $this->validateDocumentPptValidationRequest($input_file); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + 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(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'validateDocumentPptValidation' + * + * @param \SplFileObject $input_file Input file to perform the operation on. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function validateDocumentPptValidationRequest($input_file) + { + // verify the required parameter 'input_file' is set + if ($input_file === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $input_file when calling validateDocumentPptValidation' + ); + } + + $resourcePath = '/convert/validate/ppt'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // form params + if ($input_file !== null) { + $multipart = true; + $formParams['inputFile'] = \GuzzleHttp\Psr7\try_fopen(ObjectSerializer::toFormValue($input_file), 'rb'); + } + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json', 'text/json', 'application/xml', 'text/xml'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'text/json', 'application/xml', 'text/xml'], + ['multipart/form-data'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Apikey'); + if ($apiKey !== null) { + $headers['Apikey'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation validateDocumentPptxValidation + * + * Validate a PowerPoint presentation (PPTX) + * + * @param \SplFileObject $input_file Input file to perform the operation on. (required) + * + * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Swagger\Client\Model\DocumentValidationResult + */ + public function validateDocumentPptxValidation($input_file) + { + list($response) = $this->validateDocumentPptxValidationWithHttpInfo($input_file); + return $response; + } + + /** + * Operation validateDocumentPptxValidationWithHttpInfo + * + * Validate a PowerPoint presentation (PPTX) + * + * @param \SplFileObject $input_file Input file to perform the operation on. (required) + * + * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Swagger\Client\Model\DocumentValidationResult, HTTP status code, HTTP response headers (array of strings) + */ + public function validateDocumentPptxValidationWithHttpInfo($input_file) + { + $returnType = '\Swagger\Client\Model\DocumentValidationResult'; + $request = $this->validateDocumentPptxValidationRequest($input_file); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Swagger\Client\Model\DocumentValidationResult', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation validateDocumentPptxValidationAsync + * + * Validate a PowerPoint presentation (PPTX) + * + * @param \SplFileObject $input_file Input file to perform the operation on. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function validateDocumentPptxValidationAsync($input_file) + { + return $this->validateDocumentPptxValidationAsyncWithHttpInfo($input_file) ->then( function ($response) { return $response[0]; @@ -3893,17 +4421,545 @@ function ($response) { /** * Operation validateDocumentPptxValidationAsyncWithHttpInfo * - * Validate a PowerPoint presentation (PPTX) + * Validate a PowerPoint presentation (PPTX) + * + * @param \SplFileObject $input_file Input file to perform the operation on. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function validateDocumentPptxValidationAsyncWithHttpInfo($input_file) + { + $returnType = '\Swagger\Client\Model\DocumentValidationResult'; + $request = $this->validateDocumentPptxValidationRequest($input_file); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + 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(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'validateDocumentPptxValidation' + * + * @param \SplFileObject $input_file Input file to perform the operation on. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function validateDocumentPptxValidationRequest($input_file) + { + // verify the required parameter 'input_file' is set + if ($input_file === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $input_file when calling validateDocumentPptxValidation' + ); + } + + $resourcePath = '/convert/validate/pptx'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // form params + if ($input_file !== null) { + $multipart = true; + $formParams['inputFile'] = \GuzzleHttp\Psr7\try_fopen(ObjectSerializer::toFormValue($input_file), 'rb'); + } + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json', 'text/json', 'application/xml', 'text/xml'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'text/json', 'application/xml', 'text/xml'], + ['multipart/form-data'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Apikey'); + if ($apiKey !== null) { + $headers['Apikey'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation validateDocumentRarValidation + * + * Validate a RAR Archive file (RAR) + * + * @param \SplFileObject $input_file Input file to perform the operation on. (required) + * + * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Swagger\Client\Model\DocumentValidationResult + */ + public function validateDocumentRarValidation($input_file) + { + list($response) = $this->validateDocumentRarValidationWithHttpInfo($input_file); + return $response; + } + + /** + * Operation validateDocumentRarValidationWithHttpInfo + * + * Validate a RAR Archive file (RAR) + * + * @param \SplFileObject $input_file Input file to perform the operation on. (required) + * + * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Swagger\Client\Model\DocumentValidationResult, HTTP status code, HTTP response headers (array of strings) + */ + public function validateDocumentRarValidationWithHttpInfo($input_file) + { + $returnType = '\Swagger\Client\Model\DocumentValidationResult'; + $request = $this->validateDocumentRarValidationRequest($input_file); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Swagger\Client\Model\DocumentValidationResult', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation validateDocumentRarValidationAsync + * + * Validate a RAR Archive file (RAR) + * + * @param \SplFileObject $input_file Input file to perform the operation on. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function validateDocumentRarValidationAsync($input_file) + { + return $this->validateDocumentRarValidationAsyncWithHttpInfo($input_file) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation validateDocumentRarValidationAsyncWithHttpInfo + * + * Validate a RAR Archive file (RAR) + * + * @param \SplFileObject $input_file Input file to perform the operation on. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function validateDocumentRarValidationAsyncWithHttpInfo($input_file) + { + $returnType = '\Swagger\Client\Model\DocumentValidationResult'; + $request = $this->validateDocumentRarValidationRequest($input_file); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + 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(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'validateDocumentRarValidation' + * + * @param \SplFileObject $input_file Input file to perform the operation on. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function validateDocumentRarValidationRequest($input_file) + { + // verify the required parameter 'input_file' is set + if ($input_file === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $input_file when calling validateDocumentRarValidation' + ); + } + + $resourcePath = '/convert/validate/rar'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // form params + if ($input_file !== null) { + $multipart = true; + $formParams['inputFile'] = \GuzzleHttp\Psr7\try_fopen(ObjectSerializer::toFormValue($input_file), 'rb'); + } + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json', 'text/json', 'application/xml', 'text/xml'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'text/json', 'application/xml', 'text/xml'], + ['multipart/form-data'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Apikey'); + if ($apiKey !== null) { + $headers['Apikey'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation validateDocumentRtfValidation + * + * Validate a Rich Text Format document (RTF) + * + * @param \SplFileObject $input_file Input file to perform the operation on. (required) + * + * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Swagger\Client\Model\DocumentValidationResult + */ + public function validateDocumentRtfValidation($input_file) + { + list($response) = $this->validateDocumentRtfValidationWithHttpInfo($input_file); + return $response; + } + + /** + * Operation validateDocumentRtfValidationWithHttpInfo + * + * Validate a Rich Text Format document (RTF) + * + * @param \SplFileObject $input_file Input file to perform the operation on. (required) + * + * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Swagger\Client\Model\DocumentValidationResult, HTTP status code, HTTP response headers (array of strings) + */ + public function validateDocumentRtfValidationWithHttpInfo($input_file) + { + $returnType = '\Swagger\Client\Model\DocumentValidationResult'; + $request = $this->validateDocumentRtfValidationRequest($input_file); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Swagger\Client\Model\DocumentValidationResult', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation validateDocumentRtfValidationAsync + * + * Validate a Rich Text Format document (RTF) * * @param \SplFileObject $input_file Input file to perform the operation on. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function validateDocumentPptxValidationAsyncWithHttpInfo($input_file) + public function validateDocumentRtfValidationAsync($input_file) + { + return $this->validateDocumentRtfValidationAsyncWithHttpInfo($input_file) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation validateDocumentRtfValidationAsyncWithHttpInfo + * + * Validate a Rich Text Format document (RTF) + * + * @param \SplFileObject $input_file Input file to perform the operation on. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function validateDocumentRtfValidationAsyncWithHttpInfo($input_file) { $returnType = '\Swagger\Client\Model\DocumentValidationResult'; - $request = $this->validateDocumentPptxValidationRequest($input_file); + $request = $this->validateDocumentRtfValidationRequest($input_file); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -3943,23 +4999,23 @@ function ($exception) { } /** - * Create request for operation 'validateDocumentPptxValidation' + * Create request for operation 'validateDocumentRtfValidation' * * @param \SplFileObject $input_file Input file to perform the operation on. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function validateDocumentPptxValidationRequest($input_file) + protected function validateDocumentRtfValidationRequest($input_file) { // verify the required parameter 'input_file' is set if ($input_file === null) { throw new \InvalidArgumentException( - 'Missing the required parameter $input_file when calling validateDocumentPptxValidation' + 'Missing the required parameter $input_file when calling validateDocumentRtfValidation' ); } - $resourcePath = '/convert/validate/pptx'; + $resourcePath = '/convert/validate/rtf'; $formParams = []; $queryParams = []; $headerParams = []; @@ -4043,9 +5099,9 @@ protected function validateDocumentPptxValidationRequest($input_file) } /** - * Operation validateDocumentRarValidation + * Operation validateDocumentTarValidation * - * Validate a RAR Archive file (RAR) + * Validate a TAR Tarball Archive file (TAR) * * @param \SplFileObject $input_file Input file to perform the operation on. (required) * @@ -4053,16 +5109,16 @@ protected function validateDocumentPptxValidationRequest($input_file) * @throws \InvalidArgumentException * @return \Swagger\Client\Model\DocumentValidationResult */ - public function validateDocumentRarValidation($input_file) + public function validateDocumentTarValidation($input_file) { - list($response) = $this->validateDocumentRarValidationWithHttpInfo($input_file); + list($response) = $this->validateDocumentTarValidationWithHttpInfo($input_file); return $response; } /** - * Operation validateDocumentRarValidationWithHttpInfo + * Operation validateDocumentTarValidationWithHttpInfo * - * Validate a RAR Archive file (RAR) + * Validate a TAR Tarball Archive file (TAR) * * @param \SplFileObject $input_file Input file to perform the operation on. (required) * @@ -4070,10 +5126,10 @@ public function validateDocumentRarValidation($input_file) * @throws \InvalidArgumentException * @return array of \Swagger\Client\Model\DocumentValidationResult, HTTP status code, HTTP response headers (array of strings) */ - public function validateDocumentRarValidationWithHttpInfo($input_file) + public function validateDocumentTarValidationWithHttpInfo($input_file) { $returnType = '\Swagger\Client\Model\DocumentValidationResult'; - $request = $this->validateDocumentRarValidationRequest($input_file); + $request = $this->validateDocumentTarValidationRequest($input_file); try { $options = $this->createHttpClientOption(); @@ -4135,18 +5191,18 @@ public function validateDocumentRarValidationWithHttpInfo($input_file) } /** - * Operation validateDocumentRarValidationAsync + * Operation validateDocumentTarValidationAsync * - * Validate a RAR Archive file (RAR) + * Validate a TAR Tarball Archive file (TAR) * * @param \SplFileObject $input_file Input file to perform the operation on. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function validateDocumentRarValidationAsync($input_file) + public function validateDocumentTarValidationAsync($input_file) { - return $this->validateDocumentRarValidationAsyncWithHttpInfo($input_file) + return $this->validateDocumentTarValidationAsyncWithHttpInfo($input_file) ->then( function ($response) { return $response[0]; @@ -4155,19 +5211,19 @@ function ($response) { } /** - * Operation validateDocumentRarValidationAsyncWithHttpInfo + * Operation validateDocumentTarValidationAsyncWithHttpInfo * - * Validate a RAR Archive file (RAR) + * Validate a TAR Tarball Archive file (TAR) * * @param \SplFileObject $input_file Input file to perform the operation on. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function validateDocumentRarValidationAsyncWithHttpInfo($input_file) + public function validateDocumentTarValidationAsyncWithHttpInfo($input_file) { $returnType = '\Swagger\Client\Model\DocumentValidationResult'; - $request = $this->validateDocumentRarValidationRequest($input_file); + $request = $this->validateDocumentTarValidationRequest($input_file); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -4207,23 +5263,23 @@ function ($exception) { } /** - * Create request for operation 'validateDocumentRarValidation' + * Create request for operation 'validateDocumentTarValidation' * * @param \SplFileObject $input_file Input file to perform the operation on. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function validateDocumentRarValidationRequest($input_file) + protected function validateDocumentTarValidationRequest($input_file) { // verify the required parameter 'input_file' is set if ($input_file === null) { throw new \InvalidArgumentException( - 'Missing the required parameter $input_file when calling validateDocumentRarValidation' + 'Missing the required parameter $input_file when calling validateDocumentTarValidation' ); } - $resourcePath = '/convert/validate/rar'; + $resourcePath = '/convert/validate/tar'; $formParams = []; $queryParams = []; $headerParams = []; @@ -4307,9 +5363,9 @@ protected function validateDocumentRarValidationRequest($input_file) } /** - * Operation validateDocumentTarValidation + * Operation validateDocumentTxtValidation * - * Validate a TAR Tarball Archive file (TAR) + * Validate an TXT file * * @param \SplFileObject $input_file Input file to perform the operation on. (required) * @@ -4317,16 +5373,16 @@ protected function validateDocumentRarValidationRequest($input_file) * @throws \InvalidArgumentException * @return \Swagger\Client\Model\DocumentValidationResult */ - public function validateDocumentTarValidation($input_file) + public function validateDocumentTxtValidation($input_file) { - list($response) = $this->validateDocumentTarValidationWithHttpInfo($input_file); + list($response) = $this->validateDocumentTxtValidationWithHttpInfo($input_file); return $response; } /** - * Operation validateDocumentTarValidationWithHttpInfo + * Operation validateDocumentTxtValidationWithHttpInfo * - * Validate a TAR Tarball Archive file (TAR) + * Validate an TXT file * * @param \SplFileObject $input_file Input file to perform the operation on. (required) * @@ -4334,10 +5390,10 @@ public function validateDocumentTarValidation($input_file) * @throws \InvalidArgumentException * @return array of \Swagger\Client\Model\DocumentValidationResult, HTTP status code, HTTP response headers (array of strings) */ - public function validateDocumentTarValidationWithHttpInfo($input_file) + public function validateDocumentTxtValidationWithHttpInfo($input_file) { $returnType = '\Swagger\Client\Model\DocumentValidationResult'; - $request = $this->validateDocumentTarValidationRequest($input_file); + $request = $this->validateDocumentTxtValidationRequest($input_file); try { $options = $this->createHttpClientOption(); @@ -4399,18 +5455,18 @@ public function validateDocumentTarValidationWithHttpInfo($input_file) } /** - * Operation validateDocumentTarValidationAsync + * Operation validateDocumentTxtValidationAsync * - * Validate a TAR Tarball Archive file (TAR) + * Validate an TXT file * * @param \SplFileObject $input_file Input file to perform the operation on. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function validateDocumentTarValidationAsync($input_file) + public function validateDocumentTxtValidationAsync($input_file) { - return $this->validateDocumentTarValidationAsyncWithHttpInfo($input_file) + return $this->validateDocumentTxtValidationAsyncWithHttpInfo($input_file) ->then( function ($response) { return $response[0]; @@ -4419,19 +5475,19 @@ function ($response) { } /** - * Operation validateDocumentTarValidationAsyncWithHttpInfo + * Operation validateDocumentTxtValidationAsyncWithHttpInfo * - * Validate a TAR Tarball Archive file (TAR) + * Validate an TXT file * * @param \SplFileObject $input_file Input file to perform the operation on. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function validateDocumentTarValidationAsyncWithHttpInfo($input_file) + public function validateDocumentTxtValidationAsyncWithHttpInfo($input_file) { $returnType = '\Swagger\Client\Model\DocumentValidationResult'; - $request = $this->validateDocumentTarValidationRequest($input_file); + $request = $this->validateDocumentTxtValidationRequest($input_file); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -4471,23 +5527,23 @@ function ($exception) { } /** - * Create request for operation 'validateDocumentTarValidation' + * Create request for operation 'validateDocumentTxtValidation' * * @param \SplFileObject $input_file Input file to perform the operation on. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function validateDocumentTarValidationRequest($input_file) + protected function validateDocumentTxtValidationRequest($input_file) { // verify the required parameter 'input_file' is set if ($input_file === null) { throw new \InvalidArgumentException( - 'Missing the required parameter $input_file when calling validateDocumentTarValidation' + 'Missing the required parameter $input_file when calling validateDocumentTxtValidation' ); } - $resourcePath = '/convert/validate/tar'; + $resourcePath = '/convert/validate/txt'; $formParams = []; $queryParams = []; $headerParams = []; @@ -4571,9 +5627,9 @@ protected function validateDocumentTarValidationRequest($input_file) } /** - * Operation validateDocumentTxtValidation + * Operation validateDocumentXlsValidation * - * Validate an TXT file + * Validate a Excel 97-2003 Legacy spreadsheet (XLS) * * @param \SplFileObject $input_file Input file to perform the operation on. (required) * @@ -4581,16 +5637,16 @@ protected function validateDocumentTarValidationRequest($input_file) * @throws \InvalidArgumentException * @return \Swagger\Client\Model\DocumentValidationResult */ - public function validateDocumentTxtValidation($input_file) + public function validateDocumentXlsValidation($input_file) { - list($response) = $this->validateDocumentTxtValidationWithHttpInfo($input_file); + list($response) = $this->validateDocumentXlsValidationWithHttpInfo($input_file); return $response; } /** - * Operation validateDocumentTxtValidationWithHttpInfo + * Operation validateDocumentXlsValidationWithHttpInfo * - * Validate an TXT file + * Validate a Excel 97-2003 Legacy spreadsheet (XLS) * * @param \SplFileObject $input_file Input file to perform the operation on. (required) * @@ -4598,10 +5654,10 @@ public function validateDocumentTxtValidation($input_file) * @throws \InvalidArgumentException * @return array of \Swagger\Client\Model\DocumentValidationResult, HTTP status code, HTTP response headers (array of strings) */ - public function validateDocumentTxtValidationWithHttpInfo($input_file) + public function validateDocumentXlsValidationWithHttpInfo($input_file) { $returnType = '\Swagger\Client\Model\DocumentValidationResult'; - $request = $this->validateDocumentTxtValidationRequest($input_file); + $request = $this->validateDocumentXlsValidationRequest($input_file); try { $options = $this->createHttpClientOption(); @@ -4663,18 +5719,18 @@ public function validateDocumentTxtValidationWithHttpInfo($input_file) } /** - * Operation validateDocumentTxtValidationAsync + * Operation validateDocumentXlsValidationAsync * - * Validate an TXT file + * Validate a Excel 97-2003 Legacy spreadsheet (XLS) * * @param \SplFileObject $input_file Input file to perform the operation on. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function validateDocumentTxtValidationAsync($input_file) + public function validateDocumentXlsValidationAsync($input_file) { - return $this->validateDocumentTxtValidationAsyncWithHttpInfo($input_file) + return $this->validateDocumentXlsValidationAsyncWithHttpInfo($input_file) ->then( function ($response) { return $response[0]; @@ -4683,19 +5739,19 @@ function ($response) { } /** - * Operation validateDocumentTxtValidationAsyncWithHttpInfo + * Operation validateDocumentXlsValidationAsyncWithHttpInfo * - * Validate an TXT file + * Validate a Excel 97-2003 Legacy spreadsheet (XLS) * * @param \SplFileObject $input_file Input file to perform the operation on. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function validateDocumentTxtValidationAsyncWithHttpInfo($input_file) + public function validateDocumentXlsValidationAsyncWithHttpInfo($input_file) { $returnType = '\Swagger\Client\Model\DocumentValidationResult'; - $request = $this->validateDocumentTxtValidationRequest($input_file); + $request = $this->validateDocumentXlsValidationRequest($input_file); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -4735,23 +5791,23 @@ function ($exception) { } /** - * Create request for operation 'validateDocumentTxtValidation' + * Create request for operation 'validateDocumentXlsValidation' * * @param \SplFileObject $input_file Input file to perform the operation on. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function validateDocumentTxtValidationRequest($input_file) + protected function validateDocumentXlsValidationRequest($input_file) { // verify the required parameter 'input_file' is set if ($input_file === null) { throw new \InvalidArgumentException( - 'Missing the required parameter $input_file when calling validateDocumentTxtValidation' + 'Missing the required parameter $input_file when calling validateDocumentXlsValidation' ); } - $resourcePath = '/convert/validate/txt'; + $resourcePath = '/convert/validate/xls'; $formParams = []; $queryParams = []; $headerParams = []; diff --git a/lib/Configuration.php b/lib/Configuration.php index fa32d73..03daef7 100644 --- a/lib/Configuration.php +++ b/lib/Configuration.php @@ -88,7 +88,7 @@ class Configuration * * @var string */ - protected $userAgent = 'Swagger-Codegen/2.1.4/php'; + protected $userAgent = 'Swagger-Codegen/2.1.5/php'; /** * Debug switch (default set to false) @@ -397,7 +397,7 @@ public static function toDebugReport() $report .= ' OS: ' . php_uname() . PHP_EOL; $report .= ' PHP Version: ' . PHP_VERSION . PHP_EOL; $report .= ' OpenAPI Spec Version: v1' . PHP_EOL; - $report .= ' SDK Package Version: 2.1.4' . PHP_EOL; + $report .= ' SDK Package Version: 2.1.5' . PHP_EOL; $report .= ' Temp Folder Path: ' . self::getDefaultConfiguration()->getTempFolderPath() . PHP_EOL; return $report; diff --git a/packageconfig.json b/packageconfig.json index d6d3007..c308e78 100644 --- a/packageconfig.json +++ b/packageconfig.json @@ -1,5 +1,5 @@ { - "artifactVersion": "2.1.4", + "artifactVersion": "2.1.5", "gitUserId": "Cloudmersive", "gitRepoId": "Cloudmersive.APIClient.PHP.DocumentAndDataConvert", "composerVendorName": "cloudmersive", diff --git a/test/Api/ValidateDocumentApiTest.php b/test/Api/ValidateDocumentApiTest.php index e82abf7..241c9f5 100644 --- a/test/Api/ValidateDocumentApiTest.php +++ b/test/Api/ValidateDocumentApiTest.php @@ -91,6 +91,16 @@ public function testValidateDocumentCsvValidation() { } + /** + * Test case for validateDocumentDocValidation + * + * Validate a Word 97-2003 Legacy document (DOC). + * + */ + public function testValidateDocumentDocValidation() + { + } + /** * Test case for validateDocumentDocxValidation * @@ -211,6 +221,16 @@ public function testValidateDocumentPngValidation() { } + /** + * Test case for validateDocumentPptValidation + * + * Validate a PowerPoint 97-2003 Legacy presentation (PPT). + * + */ + public function testValidateDocumentPptValidation() + { + } + /** * Test case for validateDocumentPptxValidation * @@ -231,6 +251,16 @@ public function testValidateDocumentRarValidation() { } + /** + * Test case for validateDocumentRtfValidation + * + * Validate a Rich Text Format document (RTF). + * + */ + public function testValidateDocumentRtfValidation() + { + } + /** * Test case for validateDocumentTarValidation * @@ -251,6 +281,16 @@ public function testValidateDocumentTxtValidation() { } + /** + * Test case for validateDocumentXlsValidation + * + * Validate a Excel 97-2003 Legacy spreadsheet (XLS). + * + */ + public function testValidateDocumentXlsValidation() + { + } + /** * Test case for validateDocumentXlsxValidation *