Skip to content

Commit

Permalink
1.8.8
Browse files Browse the repository at this point in the history
  • Loading branch information
Cloudmersive committed Apr 23, 2020
1 parent 00b21c9 commit 399d924
Show file tree
Hide file tree
Showing 9 changed files with 358 additions and 16 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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: 1.8.7
- Package version: 1.8.8


## Requirements
Expand Down Expand Up @@ -248,6 +248,7 @@ Class | Method | HTTP request | Description
*SplitDocumentApi* | [**splitDocumentTxtByString**](docs/Api/SplitDocumentApi.md#splitdocumenttxtbystring) | **POST** /convert/split/txt/by-string | Split a single Text file (txt) by a string delimiter
*SplitDocumentApi* | [**splitDocumentXlsx**](docs/Api/SplitDocumentApi.md#splitdocumentxlsx) | **POST** /convert/split/xlsx | Split a single Excel XLSX into Separate Worksheets
*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* | [**validateDocumentDocxValidation**](docs/Api/ValidateDocumentApi.md#validatedocumentdocxvalidation) | **POST** /convert/validate/docx | Validate a Word document (DOCX)
*ValidateDocumentApi* | [**validateDocumentExecutableValidation**](docs/Api/ValidateDocumentApi.md#validatedocumentexecutablevalidation) | **POST** /convert/validate/executable | Validate if a file is executable
*ValidateDocumentApi* | [**validateDocumentGZipValidation**](docs/Api/ValidateDocumentApi.md#validatedocumentgzipvalidation) | **POST** /convert/validate/gzip | Validate a GZip Archive file (gzip or gz)
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cloudmersive/cloudmersive_document_convert_api_client",
"version": "1.8.7",
"version": "1.8.8",
"description": "",
"keywords": [
"swagger",
Expand Down
6 changes: 4 additions & 2 deletions docs/Api/ConvertDataApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Method | HTTP request | Description


# **convertDataCsvToJson**
> object convertDataCsvToJson($input_file)
> object convertDataCsvToJson($input_file, $column_names_from_first_row)
Convert CSV to JSON conversion

Expand All @@ -45,9 +45,10 @@ $apiInstance = new Swagger\Client\Api\ConvertDataApi(
$config
);
$input_file = "/path/to/file.txt"; // \SplFileObject | Input file to perform the operation on.
$column_names_from_first_row = true; // bool | Optional; If true, the first row will be used as the labels for the columns; if false, columns will be named Column0, Column1, etc. Default is true. Set to false if you are not using column headings, or have an irregular column structure.

try {
$result = $apiInstance->convertDataCsvToJson($input_file);
$result = $apiInstance->convertDataCsvToJson($input_file, $column_names_from_first_row);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling ConvertDataApi->convertDataCsvToJson: ', $e->getMessage(), PHP_EOL;
Expand All @@ -60,6 +61,7 @@ try {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**input_file** | **\SplFileObject**| Input file to perform the operation on. |
**column_names_from_first_row** | **bool**| Optional; If true, the first row will be used as the labels for the columns; if false, columns will be named Column0, Column1, etc. Default is true. Set to false if you are not using column headings, or have an irregular column structure. | [optional]

### Return type

Expand Down
56 changes: 56 additions & 0 deletions docs/Api/ValidateDocumentApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ All URIs are relative to *https://api.cloudmersive.com*
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)
[**validateDocumentDocxValidation**](ValidateDocumentApi.md#validateDocumentDocxValidation) | **POST** /convert/validate/docx | Validate a Word document (DOCX)
[**validateDocumentExecutableValidation**](ValidateDocumentApi.md#validateDocumentExecutableValidation) | **POST** /convert/validate/executable | Validate if a file is executable
[**validateDocumentGZipValidation**](ValidateDocumentApi.md#validateDocumentGZipValidation) | **POST** /convert/validate/gzip | Validate a GZip Archive file (gzip or gz)
Expand Down Expand Up @@ -73,6 +74,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)

# **validateDocumentCsvValidation**
> \Swagger\Client\Model\DocumentValidationResult validateDocumentCsvValidation($input_file)
Validate a CSV file document (CSV)

Validate a CSV file document (CSV); if the document is not valid, identifies the errors in the document

### Example
```php
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure API key authorization: Apikey
$config = Swagger\Client\Configuration::getDefaultConfiguration()->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->validateDocumentCsvValidation($input_file);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling ValidateDocumentApi->validateDocumentCsvValidation: ', $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)
Expand Down
27 changes: 18 additions & 9 deletions lib/Api/ConvertDataApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,14 +88,15 @@ public function getConfig()
* Convert CSV to JSON conversion
*
* @param \SplFileObject $input_file Input file to perform the operation on. (required)
* @param bool $column_names_from_first_row Optional; If true, the first row will be used as the labels for the columns; if false, columns will be named Column0, Column1, etc. Default is true. Set to false if you are not using column headings, or have an irregular column structure. (optional)
*
* @throws \Swagger\Client\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return object
*/
public function convertDataCsvToJson($input_file)
public function convertDataCsvToJson($input_file, $column_names_from_first_row = null)
{
list($response) = $this->convertDataCsvToJsonWithHttpInfo($input_file);
list($response) = $this->convertDataCsvToJsonWithHttpInfo($input_file, $column_names_from_first_row);
return $response;
}

Expand All @@ -105,15 +106,16 @@ public function convertDataCsvToJson($input_file)
* Convert CSV to JSON conversion
*
* @param \SplFileObject $input_file Input file to perform the operation on. (required)
* @param bool $column_names_from_first_row Optional; If true, the first row will be used as the labels for the columns; if false, columns will be named Column0, Column1, etc. Default is true. Set to false if you are not using column headings, or have an irregular column structure. (optional)
*
* @throws \Swagger\Client\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return array of object, HTTP status code, HTTP response headers (array of strings)
*/
public function convertDataCsvToJsonWithHttpInfo($input_file)
public function convertDataCsvToJsonWithHttpInfo($input_file, $column_names_from_first_row = null)
{
$returnType = 'object';
$request = $this->convertDataCsvToJsonRequest($input_file);
$request = $this->convertDataCsvToJsonRequest($input_file, $column_names_from_first_row);

try {
$options = $this->createHttpClientOption();
Expand Down Expand Up @@ -180,13 +182,14 @@ public function convertDataCsvToJsonWithHttpInfo($input_file)
* Convert CSV to JSON conversion
*
* @param \SplFileObject $input_file Input file to perform the operation on. (required)
* @param bool $column_names_from_first_row Optional; If true, the first row will be used as the labels for the columns; if false, columns will be named Column0, Column1, etc. Default is true. Set to false if you are not using column headings, or have an irregular column structure. (optional)
*
* @throws \InvalidArgumentException
* @return \GuzzleHttp\Promise\PromiseInterface
*/
public function convertDataCsvToJsonAsync($input_file)
public function convertDataCsvToJsonAsync($input_file, $column_names_from_first_row = null)
{
return $this->convertDataCsvToJsonAsyncWithHttpInfo($input_file)
return $this->convertDataCsvToJsonAsyncWithHttpInfo($input_file, $column_names_from_first_row)
->then(
function ($response) {
return $response[0];
Expand All @@ -200,14 +203,15 @@ function ($response) {
* Convert CSV to JSON conversion
*
* @param \SplFileObject $input_file Input file to perform the operation on. (required)
* @param bool $column_names_from_first_row Optional; If true, the first row will be used as the labels for the columns; if false, columns will be named Column0, Column1, etc. Default is true. Set to false if you are not using column headings, or have an irregular column structure. (optional)
*
* @throws \InvalidArgumentException
* @return \GuzzleHttp\Promise\PromiseInterface
*/
public function convertDataCsvToJsonAsyncWithHttpInfo($input_file)
public function convertDataCsvToJsonAsyncWithHttpInfo($input_file, $column_names_from_first_row = null)
{
$returnType = 'object';
$request = $this->convertDataCsvToJsonRequest($input_file);
$request = $this->convertDataCsvToJsonRequest($input_file, $column_names_from_first_row);

return $this->client
->sendAsync($request, $this->createHttpClientOption())
Expand Down Expand Up @@ -250,11 +254,12 @@ function ($exception) {
* Create request for operation 'convertDataCsvToJson'
*
* @param \SplFileObject $input_file Input file to perform the operation on. (required)
* @param bool $column_names_from_first_row Optional; If true, the first row will be used as the labels for the columns; if false, columns will be named Column0, Column1, etc. Default is true. Set to false if you are not using column headings, or have an irregular column structure. (optional)
*
* @throws \InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
protected function convertDataCsvToJsonRequest($input_file)
protected function convertDataCsvToJsonRequest($input_file, $column_names_from_first_row = null)
{
// verify the required parameter 'input_file' is set
if ($input_file === null) {
Expand All @@ -270,6 +275,10 @@ protected function convertDataCsvToJsonRequest($input_file)
$httpBody = '';
$multipart = false;

// header params
if ($column_names_from_first_row !== null) {
$headerParams['columnNamesFromFirstRow'] = ObjectSerializer::toHeaderValue($column_names_from_first_row);
}


// form params
Expand Down
Loading

0 comments on commit 399d924

Please sign in to comment.