@@ -67588,6 +67588,334 @@ protected function cellsWorkbookPostAutofitWorkbookRowsRequest($name, $auto_fitt
6758867588 );
6758967589 }
6759067590
67591+ /**
67592+ * Operation cellsWorkbookPostDigitalSignature
67593+ *
67594+ * Add digital signature.
67595+ *
67596+ * @param string $name Workbook name. (required)
67597+ * @param string $digitalsignaturefile Digital signature file parameters. (required)
67598+ * @param string $password password (required)
67599+ * @param string $folder Workbook's folder. (optional)
67600+ * @param string $storage_name storage name. (optional)
67601+ *
67602+ * @throws \Aspose\Cells\Cloud\ApiException on non-2xx response
67603+ * @throws \InvalidArgumentException
67604+ * @return \Aspose\Cells\Cloud\Model\CellsCloudResponse
67605+ */
67606+ public function cellsWorkbookPostDigitalSignature($name, $digitalsignaturefile, $password, $folder = null, $storage_name = null)
67607+ {
67608+ $this->checkAccessToken();
67609+ list($response) = $this->cellsWorkbookPostDigitalSignatureWithHttpInfo($name, $digitalsignaturefile, $password, $folder, $storage_name);
67610+ return $response;
67611+ }
67612+
67613+ /**
67614+ * Operation cellsWorkbookPostDigitalSignatureWithHttpInfo
67615+ *
67616+ * Add digital signature.
67617+ *
67618+ * @param string $name Workbook name. (required)
67619+ * @param string $digitalsignaturefile Digital signature file parameters. (required)
67620+ * @param string $password (required)
67621+ * @param string $folder Workbook's folder. (optional)
67622+ * @param string $storage_name storage name. (optional)
67623+ *
67624+ * @throws \Aspose\Cells\Cloud\ApiException on non-2xx response
67625+ * @throws \InvalidArgumentException
67626+ * @return array of \Aspose\Cells\Cloud\Model\CellsCloudResponse, HTTP status code, HTTP response headers (array of strings)
67627+ */
67628+ public function cellsWorkbookPostDigitalSignatureWithHttpInfo($name, $digitalsignaturefile, $password, $folder = null, $storage_name = null)
67629+ {
67630+ $returnType = '\Aspose\Cells\Cloud\Model\CellsCloudResponse';
67631+ $request = $this->cellsWorkbookPostDigitalSignatureRequest($name, $digitalsignaturefile, $password, $folder, $storage_name);
67632+
67633+ try {
67634+ $options = $this->createHttpClientOption();
67635+ try {
67636+ $response = $this->client->send($request, $options);
67637+ } catch (RequestException $e) {
67638+ throw new ApiException(
67639+ "[{$e->getCode()}] {$e->getMessage()}",
67640+ $e->getCode(),
67641+ $e->getResponse() ? $e->getResponse()->getHeaders() : null,
67642+ $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null
67643+ );
67644+ }
67645+
67646+ $statusCode = $response->getStatusCode();
67647+
67648+ if ($statusCode < 200 || $statusCode > 299) {
67649+ throw new ApiException(
67650+ sprintf(
67651+ '[%d] Error connecting to the API (%s)',
67652+ $statusCode,
67653+ $request->getUri()
67654+ ),
67655+ $statusCode,
67656+ $response->getHeaders(),
67657+ $response->getBody()
67658+ );
67659+ }
67660+
67661+ $responseBody = $response->getBody();
67662+ if ($returnType === '\SplFileObject') {
67663+ $content = $responseBody; //stream goes to serializer
67664+ } else {
67665+ $content = $responseBody->getContents();
67666+ if ($returnType !== 'string') {
67667+ $content = json_decode($content);
67668+ }
67669+ }
67670+
67671+ return [
67672+ ObjectSerializer::deserialize($content, $returnType, []),
67673+ $response->getStatusCode(),
67674+ $response->getHeaders()
67675+ ];
67676+
67677+ } catch (ApiException $e) {
67678+ switch ($e->getCode()) {
67679+ case 200:
67680+ $data = ObjectSerializer::deserialize(
67681+ $e->getResponseBody(),
67682+ '\Aspose\Cells\Cloud\Model\CellsCloudResponse',
67683+ $e->getResponseHeaders()
67684+ );
67685+ $e->setResponseObject($data);
67686+ break;
67687+ }
67688+ throw $e;
67689+ }
67690+ }
67691+
67692+ /**
67693+ * Operation cellsWorkbookPostDigitalSignatureAsync
67694+ *
67695+ * Add digital signature.
67696+ *
67697+ * @param string $name Workbook name. (required)
67698+ * @param string $digitalsignaturefile Digital signature file parameters. (required)
67699+ * @param string $password (required)
67700+ * @param string $folder Workbook's folder. (optional)
67701+ * @param string $storage_name storage name. (optional)
67702+ *
67703+ * @throws \InvalidArgumentException
67704+ * @return \GuzzleHttp\Promise\PromiseInterface
67705+ */
67706+ public function cellsWorkbookPostDigitalSignatureAsync($name, $digitalsignaturefile, $password, $folder = null, $storage_name = null)
67707+ {
67708+ return $this->cellsWorkbookPostDigitalSignatureAsyncWithHttpInfo($name, $digitalsignaturefile, $password, $folder, $storage_name)
67709+ ->then(
67710+ function ($response) {
67711+ return $response[0];
67712+ }
67713+ );
67714+ }
67715+
67716+ /**
67717+ * Operation cellsWorkbookPostDigitalSignatureAsyncWithHttpInfo
67718+ *
67719+ * Add digital signature.
67720+ *
67721+ * @param string $name Workbook name. (required)
67722+ * @param string $digitalsignaturefile Digital signature file parameters. (required)
67723+ * @param string $password (required)
67724+ * @param string $folder Workbook's folder. (optional)
67725+ * @param string $storage_name storage name. (optional)
67726+ *
67727+ * @throws \InvalidArgumentException
67728+ * @return \GuzzleHttp\Promise\PromiseInterface
67729+ */
67730+ public function cellsWorkbookPostDigitalSignatureAsyncWithHttpInfo($name, $digitalsignaturefile, $password, $folder = null, $storage_name = null)
67731+ {
67732+ $returnType = '\Aspose\Cells\Cloud\Model\CellsCloudResponse';
67733+ $request = $this->cellsWorkbookPostDigitalSignatureRequest($name, $digitalsignaturefile, $password, $folder, $storage_name);
67734+
67735+ return $this->client
67736+ ->sendAsync($request, $this->createHttpClientOption())
67737+ ->then(
67738+ function ($response) use ($returnType) {
67739+ $responseBody = $response->getBody();
67740+ if ($returnType === '\SplFileObject') {
67741+ $content = $responseBody; //stream goes to serializer
67742+ } else {
67743+ $content = $responseBody->getContents();
67744+ if ($returnType !== 'string') {
67745+ $content = json_decode($content);
67746+ }
67747+ }
67748+
67749+ return [
67750+ ObjectSerializer::deserialize($content, $returnType, []),
67751+ $response->getStatusCode(),
67752+ $response->getHeaders()
67753+ ];
67754+ },
67755+ function ($exception) {
67756+ $response = $exception->getResponse();
67757+ $statusCode = $response->getStatusCode();
67758+ throw new ApiException(
67759+ sprintf(
67760+ '[%d] Error connecting to the API (%s)',
67761+ $statusCode,
67762+ $exception->getRequest()->getUri()
67763+ ),
67764+ $statusCode,
67765+ $response->getHeaders(),
67766+ $response->getBody()
67767+ );
67768+ }
67769+ );
67770+ }
67771+
67772+ /**
67773+ * Create request for operation 'cellsWorkbookPostDigitalSignature'
67774+ *
67775+ * @param string $name Workbook name. (required)
67776+ * @param string $digitalsignaturefile Digital signature file parameters. (required)
67777+ * @param string $password (required)
67778+ * @param string $folder Workbook's folder. (optional)
67779+ * @param string $storage_name storage name. (optional)
67780+ *
67781+ * @throws \InvalidArgumentException
67782+ * @return \GuzzleHttp\Psr7\Request
67783+ */
67784+ protected function cellsWorkbookPostDigitalSignatureRequest($name, $digitalsignaturefile, $password, $folder = null, $storage_name = null)
67785+ {
67786+ // verify the required parameter 'name' is set
67787+ if ($name === null) {
67788+ throw new \InvalidArgumentException(
67789+ 'Missing the required parameter $name when calling cellsWorkbookPostDigitalSignature'
67790+ );
67791+ }
67792+ // verify the required parameter 'digitalsignaturefile' is set
67793+ if ($digitalsignaturefile === null) {
67794+ throw new \InvalidArgumentException(
67795+ 'Missing the required parameter $digitalsignaturefile when calling cellsWorkbookPostDigitalSignature'
67796+ );
67797+ }
67798+ // verify the required parameter 'password' is set
67799+ if ($password === null) {
67800+ throw new \InvalidArgumentException(
67801+ 'Missing the required parameter $password when calling cellsWorkbookPostDigitalSignature'
67802+ );
67803+ }
67804+
67805+ $resourcePath = '/cells/{name}/digitalsignature';
67806+ $formParams = [];
67807+ $queryParams = [];
67808+ $headerParams = [];
67809+ $httpBody = '';
67810+ $multipart = false;
67811+
67812+ // query params
67813+ if ($digitalsignaturefile !== null) {
67814+ $queryParams['digitalsignaturefile'] = ObjectSerializer::toQueryValue($digitalsignaturefile);
67815+ }
67816+ // query params
67817+ if ($password !== null) {
67818+ $queryParams['password'] = ObjectSerializer::toQueryValue($password);
67819+ }
67820+ // query params
67821+ if ($folder !== null) {
67822+ $queryParams['folder'] = ObjectSerializer::toQueryValue($folder);
67823+ }
67824+ // query params
67825+ if ($storage_name !== null) {
67826+ $queryParams['storageName'] = ObjectSerializer::toQueryValue($storage_name);
67827+ }
67828+
67829+ // path params
67830+ if ($name !== null) {
67831+ $resourcePath = str_replace(
67832+ '{' . 'name' . '}',
67833+ ObjectSerializer::toPathValue($name),
67834+ $resourcePath
67835+ );
67836+ }
67837+
67838+ // body params
67839+ $_tempBody = null;
67840+ $_tempBodyName ;
67841+
67842+ if ($multipart) {
67843+ $headers = $this->headerSelector->selectHeadersForMultipart(
67844+ ['application/json']
67845+ );
67846+ } else {
67847+ $headers = $this->headerSelector->selectHeaders(
67848+ ['application/json'],
67849+ ['application/json']
67850+ );
67851+ }
67852+
67853+ // for model (json/xml)
67854+ if (count($formParams) > 0) {
67855+ if ($multipart) {
67856+ $multipartContents = [];
67857+ foreach ($formParams as $formParamName => $formParamValue) {
67858+ $multipartContents[] = [
67859+ 'name' => $formParamName,
67860+ 'contents' => $formParamValue
67861+ ];
67862+ }
67863+ if (isset($_tempBody)) {
67864+ $httpBody = $_tempBody;
67865+ $multipartContents[] = [
67866+ 'name' =>$_tempBodyName ,
67867+ 'filename' =>$_tempBodyName ,
67868+ 'contents' => json_encode( ObjectSerializer::sanitizeForSerialization($httpBody))
67869+ ];
67870+ }
67871+ // for HTTP post (form)
67872+ $httpBody = new MultipartStream($multipartContents);
67873+
67874+ } elseif ($headers['Content-Type'] === 'application/json') {
67875+ $httpBody = \GuzzleHttp\json_encode($formParams);
67876+
67877+ } else {
67878+ // for HTTP post (form)
67879+ $httpBody = \GuzzleHttp\Psr7\build_query($formParams);
67880+ }
67881+ }elseif (isset($_tempBody)) {
67882+ // $_tempBody is the method argument, if present
67883+ $httpBody = $_tempBody;
67884+ // \stdClass has no __toString(), so we should encode it manually
67885+ if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') {
67886+ $httpBody = \GuzzleHttp\json_encode($httpBody);
67887+ }
67888+ else if (gettype($httpBody) == 'array' && $headers['Content-Type'] === 'application/json') {
67889+ $httpBody = json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
67890+ }
67891+ else if('cellsWorkbookPostDigitalSignature'==='cellsSaveAsPostDocumentSaveAs'){
67892+ $httpBody = \GuzzleHttp\json_encode($httpBody);
67893+ }
67894+ }
67895+
67896+
67897+ $defaultHeaders = [];
67898+ if ($this->config->getUserAgent()) {
67899+ $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
67900+ }
67901+ if($this->config->getAccessToken()!==''){
67902+ $defaultHeaders['Authorization']= 'Bearer ' . $this->config->getAccessToken();
67903+ }
67904+ $headers = array_merge(
67905+ $defaultHeaders,
67906+ $headerParams,
67907+ $headers
67908+ );
67909+
67910+ $query = \GuzzleHttp\Psr7\build_query($queryParams);
67911+ return new Request(
67912+ 'POST',
67913+ $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
67914+ $headers,
67915+ $httpBody
67916+ );
67917+ }
67918+
6759167919 /**
6759267920 * Operation cellsWorkbookPostEncryptDocument
6759367921 *
0 commit comments