Skip to content

Commit 7ff6baf

Browse files
committed
Release Aspose.Cells Cloud SDK 21.12
1 parent 74ddf18 commit 7ff6baf

13 files changed

+8364
-5936
lines changed

README.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
![](https://img.shields.io/badge/REST%20API-v3.0-lightgrey) ![Packagist Version](https://img.shields.io/packagist/v/aspose/cells-sdk-php) ![Packagist PHP Version Support](https://img.shields.io/packagist/php-v/aspose/cells-sdk-php) ![Packagist Downloads](https://img.shields.io/packagist/dt/aspose/cells-sdk-php) [![GitHub license](https://img.shields.io/github/license/aspose-cells-cloud/aspose-cells-cloud-java)](https://github.com/aspose-cells-cloud/aspose-cells-cloud-php/blob/master/LICENSE) ![GitHub commits since latest release (by date)](https://img.shields.io/github/commits-since/aspose-cells-cloud/aspose-cells-cloud-php/21.11)
1+
![](https://img.shields.io/badge/REST%20API-v3.0-lightgrey) ![Packagist Version](https://img.shields.io/packagist/v/aspose/cells-sdk-php) ![Packagist PHP Version Support](https://img.shields.io/packagist/php-v/aspose/cells-sdk-php) ![Packagist Downloads](https://img.shields.io/packagist/dt/aspose/cells-sdk-php) [![GitHub license](https://img.shields.io/github/license/aspose-cells-cloud/aspose-cells-cloud-java)](https://github.com/aspose-cells-cloud/aspose-cells-cloud-php/blob/master/LICENSE) ![GitHub commits since latest release (by date)](https://img.shields.io/github/commits-since/aspose-cells-cloud/aspose-cells-cloud-php/21.12)
22

33
# PHP SDK for Spreadsheet Processing in Cloud
44

@@ -24,12 +24,15 @@ This Cloud SDK enhances your PHP-based Cloud apps to [process & manipulate Micro
2424
- Fetch the required shape from worksheet.
2525
- Leverage the power of [Pivot Tables](https://docs.aspose.cloud/cells/working-with-pivot-tables/) & Ranges.
2626

27-
## Feature & Enhancements in Version 21.11
27+
## Feature & Enhancements in Version 21.12
2828

29-
- Add new API for workbook get page count on Aspose.Cells Cloud.
30-
- Add new API for worksheet get page count on Aspose.Cells Cloud.
31-
- Add new API for compress excel file on Aspose.Cells Cloud.
32-
- Add new feature for replace API.
29+
- Improvement for conversion API.
30+
- Improvement for batch data import to support to set cell formula.
31+
- Improvement for setting row height and column wight to support to set multi-rows and multi-columns.
32+
- Support to set cell formula in batch data import.
33+
- Add a new API for updating the list column.
34+
- Add a new API for reversing columns and rows.
35+
- Add new APIs for grouping and ungrouping shapes.
3336

3437
## Read Other Formats
3538

lib/Api/CellsApi.php

Lines changed: 7322 additions & 5902 deletions
Large diffs are not rendered by default.

lib/Api/LiteCellsApi.php

Lines changed: 312 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4145,7 +4145,7 @@ function ($response) {
41454145
public function postCompressAsyncAsyncWithHttpInfo($file, $compress_level)
41464146
{
41474147
$returnType = '\Aspose\Cells\Cloud\Model\FilesResult';
4148-
$request = $this->postWatermarkRequest($file, $compress_level);
4148+
$request = $this->posttCompressRequest($file, $compress_level);
41494149

41504150
return $this->client
41514151
->sendAsync($request, $this->createHttpClientOption())
@@ -4450,7 +4450,7 @@ function ($response) {
44504450
public function postReplaceAsyncWithHttpInfo($file, $text,$newtext,$password,$sheet_name)
44514451
{
44524452
$returnType = '\Aspose\Cells\Cloud\Model\FilesResult';
4453-
$request = $this->postWatermarkRequest($file, $text,$newtext,$password,$sheet_name);
4453+
$request = $this->postReplaceRequest($file, $text,$newtext,$password,$sheet_name);
44544454

44554455
return $this->client
44564456
->sendAsync($request, $this->createHttpClientOption())
@@ -4638,6 +4638,316 @@ protected function postReplaceRequest($file, $text, $newtext,$password,$sheet_na
46384638
);
46394639
}
46404640

4641+
/**
4642+
* Operation postReverse
4643+
*
4644+
* @param \SplFileObject $file File to upload (required)
4645+
* @param string $rotateType rotateType (required)
4646+
* @param string $format format (required)
4647+
4648+
*
4649+
* @throws \Aspose\Cells\Cloud\ApiException on non-2xx response
4650+
* @throws \InvalidArgumentException
4651+
* @return \Aspose\Cells\Cloud\Model\FilesResult
4652+
*/
4653+
public function postReverse($file, $rotateType, $format)
4654+
{
4655+
$this->checkAccessToken();
4656+
list($response) = $this->postReverseWithHttpInfo($file, $rotateType, $format);
4657+
return $response;
4658+
}
4659+
4660+
/**
4661+
* Operation postReverseWithHttpInfo
4662+
*
4663+
* @param \SplFileObject $file File to upload (required)
4664+
* @param string $rotateType (required)
4665+
* @param string $format (required)
4666+
*
4667+
* @throws \Aspose\Cells\Cloud\ApiException on non-2xx response
4668+
* @throws \InvalidArgumentException
4669+
* @return array of \Aspose\Cells\Cloud\Model\FilesResult, HTTP status code, HTTP response headers (array of strings)
4670+
*/
4671+
public function postReverseWithHttpInfo($file, $rotateType,$format)
4672+
{
4673+
$returnType = '\Aspose\Cells\Cloud\Model\FilesResult';
4674+
$request = $this->postReverseRequest($file, $rotateType, $format);
4675+
4676+
try {
4677+
$options = $this->createHttpClientOption();
4678+
try {
4679+
$response = $this->client->send($request, $options);
4680+
} catch (RequestException $e) {
4681+
throw new ApiException(
4682+
"[{$e->getCode()}] {$e->getMessage()}",
4683+
$e->getCode(),
4684+
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
4685+
$e->getResponse() ? $e->getResponse()->getBody()->getContents() : null
4686+
);
4687+
}
4688+
4689+
$statusCode = $response->getStatusCode();
4690+
4691+
if ($statusCode < 200 || $statusCode > 299) {
4692+
throw new ApiException(
4693+
sprintf(
4694+
'[%d] Error connecting to the API (%s)',
4695+
$statusCode,
4696+
$request->getUri()
4697+
),
4698+
$statusCode,
4699+
$response->getHeaders(),
4700+
$response->getBody()
4701+
);
4702+
}
4703+
4704+
$responseBody = $response->getBody();
4705+
if ($returnType === '\SplFileObject') {
4706+
$content = $responseBody; //stream goes to serializer
4707+
} else {
4708+
$content = $responseBody->getContents();
4709+
if ($returnType !== 'string') {
4710+
$content = json_decode($content);
4711+
}
4712+
}
4713+
4714+
return [
4715+
ObjectSerializer::deserialize($content, $returnType, []),
4716+
$response->getStatusCode(),
4717+
$response->getHeaders()
4718+
];
4719+
4720+
} catch (ApiException $e) {
4721+
switch ($e->getCode()) {
4722+
case 200:
4723+
$data = ObjectSerializer::deserialize(
4724+
$e->getResponseBody(),
4725+
'\Aspose\Cells\Cloud\Model\FilesResult',
4726+
$e->getResponseHeaders()
4727+
);
4728+
$e->setResponseObject($data);
4729+
break;
4730+
}
4731+
throw $e;
4732+
}
4733+
}
4734+
4735+
/**
4736+
* Operation postReverseAsync
4737+
*
4738+
*
4739+
*
4740+
* @param \SplFileObject $file File to upload (required)
4741+
* @param string $rotateType (required)
4742+
* @param string $format (required)
4743+
*
4744+
* @throws \InvalidArgumentException
4745+
* @return \GuzzleHttp\Promise\PromiseInterface
4746+
*/
4747+
public function postReverseAsync($file, $rotateType, $format)
4748+
{
4749+
return $this->postReverseAsyncWithHttpInfo($file, $rotateType, $format)
4750+
->then(
4751+
function ($response) {
4752+
return $response[0];
4753+
}
4754+
);
4755+
}
4756+
4757+
/**
4758+
* Operation postReversAsyncWithHttpInfo
4759+
*
4760+
*
4761+
*
4762+
* @param \SplFileObject $file File to upload (required)
4763+
* @param string $rotateType (required)
4764+
* @param string $format (required)
4765+
*
4766+
* @throws \InvalidArgumentException
4767+
* @return \GuzzleHttp\Promise\PromiseInterface
4768+
*/
4769+
public function postReverseAsyncWithHttpInfo($file, $rotateType,$newtext)
4770+
{
4771+
$returnType = '\Aspose\Cells\Cloud\Model\FilesResult';
4772+
$request = $this->postReverseRequest($file, $rotateType,$format);
4773+
4774+
return $this->client
4775+
->sendAsync($request, $this->createHttpClientOption())
4776+
->then(
4777+
function ($response) use ($returnType) {
4778+
$responseBody = $response->getBody();
4779+
if ($returnType === '\SplFileObject') {
4780+
$content = $responseBody; //stream goes to serializer
4781+
} else {
4782+
$content = $responseBody->getContents();
4783+
if ($returnType !== 'string') {
4784+
$content = json_decode($content);
4785+
}
4786+
}
4787+
4788+
return [
4789+
ObjectSerializer::deserialize($content, $returnType, []),
4790+
$response->getStatusCode(),
4791+
$response->getHeaders()
4792+
];
4793+
},
4794+
function ($exception) {
4795+
$response = $exception->getResponse();
4796+
$statusCode = $response->getStatusCode();
4797+
throw new ApiException(
4798+
sprintf(
4799+
'[%d] Error connecting to the API (%s)',
4800+
$statusCode,
4801+
$exception->getRequest()->getUri()
4802+
),
4803+
$statusCode,
4804+
$response->getHeaders(),
4805+
$response->getBody()
4806+
);
4807+
}
4808+
);
4809+
}
4810+
4811+
/**
4812+
* Create request for operation 'postWatermark'
4813+
*
4814+
* @param \SplFileObject $file File to upload (required)
4815+
* @param string $rotateType (required)
4816+
* @param string $format (required)
4817+
*
4818+
* @throws \InvalidArgumentException
4819+
* @return \GuzzleHttp\Psr7\Request
4820+
*/
4821+
protected function postReverseRequest($file, $rotateType, $format)
4822+
{
4823+
// verify the required parameter 'file' is set
4824+
if ($file === null) {
4825+
throw new \InvalidArgumentException(
4826+
'Missing the required parameter $file when calling postReplace'
4827+
);
4828+
}
4829+
// verify the required parameter 'text' is set
4830+
if ($rotateType === null) {
4831+
throw new \InvalidArgumentException(
4832+
'Missing the required parameter $text when calling postReplace'
4833+
);
4834+
}
4835+
// verify the required parameter 'color' is set
4836+
if ($format === null) {
4837+
throw new \InvalidArgumentException(
4838+
'Missing the required parameter $newtext when calling postReplace'
4839+
);
4840+
}
4841+
4842+
$resourcePath = '/cells/reverse';
4843+
$formParams = [];
4844+
$queryParams = [];
4845+
$headerParams = [];
4846+
$httpBody = '';
4847+
$multipart = false;
4848+
4849+
// query params
4850+
if ($rotateType !== null) {
4851+
$queryParams['rotateType'] = ObjectSerializer::toQueryValue($rotateType);
4852+
}
4853+
// query params
4854+
if ($format !== null) {
4855+
$queryParams['format'] = ObjectSerializer::toQueryValue($format);
4856+
}
4857+
4858+
// form params
4859+
if ($file !== null) {
4860+
$multipart = true;
4861+
if( is_array($file)){
4862+
foreach($file as $key => $value) {
4863+
$formParams[$key] = \GuzzleHttp\Psr7\try_fopen(ObjectSerializer::toFormValue($value), 'rb');
4864+
}
4865+
}else {
4866+
$formParams['File'] = \GuzzleHttp\Psr7\try_fopen(ObjectSerializer::toFormValue($file), 'rb');
4867+
}
4868+
4869+
}
4870+
// body params
4871+
$_tempBody = null;
4872+
$_tempBodyName ;
4873+
4874+
if ($multipart) {
4875+
$headers = $this->headerSelector->selectHeadersForMultipart(
4876+
['application/json']
4877+
);
4878+
} else {
4879+
$headers = $this->headerSelector->selectHeaders(
4880+
['application/json'],
4881+
['multipart/form-data']
4882+
);
4883+
}
4884+
4885+
// for model (json/xml)
4886+
if (count($formParams) > 0) {
4887+
if ($multipart) {
4888+
$multipartContents = [];
4889+
foreach ($formParams as $formParamName => $formParamValue) {
4890+
$multipartContents[] = [
4891+
'name' => $formParamName,
4892+
'contents' => $formParamValue
4893+
];
4894+
}
4895+
if (isset($_tempBody)) {
4896+
$httpBody = $_tempBody;
4897+
$multipartContents[] = [
4898+
'name' =>$_tempBodyName ,
4899+
'filename' =>$_tempBodyName ,
4900+
'contents' => json_encode( ObjectSerializer::sanitizeForSerialization($httpBody))
4901+
];
4902+
}
4903+
// for HTTP post (form)
4904+
$httpBody = new MultipartStream($multipartContents);
4905+
4906+
} elseif ($headers['Content-Type'] === 'application/json') {
4907+
$httpBody = \GuzzleHttp\json_encode($formParams);
4908+
4909+
} else {
4910+
// for HTTP post (form)
4911+
$httpBody = \GuzzleHttp\Psr7\build_query($formParams);
4912+
}
4913+
}elseif (isset($_tempBody)) {
4914+
// $_tempBody is the method argument, if present
4915+
$httpBody = $_tempBody;
4916+
// \stdClass has no __toString(), so we should encode it manually
4917+
if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') {
4918+
$httpBody = \GuzzleHttp\json_encode($httpBody);
4919+
}
4920+
else if (gettype($httpBody) == 'array' && $headers['Content-Type'] === 'application/json') {
4921+
$httpBody = json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
4922+
}
4923+
else if('postWatermark'==='cellsSaveAsPostDocumentSaveAs'){
4924+
$httpBody = \GuzzleHttp\json_encode($httpBody);
4925+
}
4926+
}
4927+
4928+
4929+
$defaultHeaders = [];
4930+
if ($this->config->getUserAgent()) {
4931+
$defaultHeaders['User-Agent'] = $this->config->getUserAgent();
4932+
}
4933+
if($this->config->getAccessToken()!==''){
4934+
$defaultHeaders['Authorization']= 'Bearer ' . $this->config->getAccessToken();
4935+
}
4936+
$headers = array_merge(
4937+
$defaultHeaders,
4938+
$headerParams,
4939+
$headers
4940+
);
4941+
4942+
$query = \GuzzleHttp\Psr7\build_query($queryParams);
4943+
return new Request(
4944+
'POST',
4945+
$this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
4946+
$headers,
4947+
$httpBody
4948+
);
4949+
}
4950+
46414951

46424952
/**
46434953
* Create http client option

lib/Configuration.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ class Configuration
8787
*
8888
* @var string
8989
*/
90-
protected $userAgent = 'Swagger-Codegen/21.11/php';
90+
protected $userAgent = 'Swagger-Codegen/21.12/php';
9191

9292
/**
9393
* Debug switch (default set to false)
@@ -395,8 +395,8 @@ public static function toDebugReport()
395395
$report = 'PHP SDK (Aspose\Cells\Cloud) Debug Report:' . PHP_EOL;
396396
$report .= ' OS: ' . php_uname() . PHP_EOL;
397397
$report .= ' PHP Version: ' . PHP_VERSION . PHP_EOL;
398-
$report .= ' OpenAPI Spec Version: 21.9' . PHP_EOL;
399-
$report .= ' SDK Package Version: 21.11' . PHP_EOL;
398+
$report .= ' OpenAPI Spec Version: 21.12' . PHP_EOL;
399+
$report .= ' SDK Package Version: 21.12' . PHP_EOL;
400400
$report .= ' Temp Folder Path: ' . self::getDefaultConfiguration()->getTempFolderPath() . PHP_EOL;
401401

402402
return $report;

0 commit comments

Comments
 (0)