src/Aspose/Storage/Api/StorageApi.php
public function putCreateAsyncWithHttpInfo(Requests\PutCreateRequest $request)
    {
        $returnType = '\Aspose\Storage\Model\UploadResponse';
        $request = $this->PutCreateRequest($request);

        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);
                        }
                    }

                    if ($this->config->getDebug()) {
                        $this->_writeResponseLog($response->getStatusCode(), $response->getHeaders(), ObjectSerializer::deserialize($content, $returnType, []));
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();

                    if ($exception instanceof RepeatRequestException) {
                        $this->_refreshToken();
                        throw new RepeatRequestException("Request must be retried", $statusCode, $response->getHeaders(), $response->getBody());
                    }

                    throw new ApiException(
                        sprintf('[%d] Error connecting to the API (%s)', $statusCode, $exception->getRequest()->getUri()), $statusCode, $response->getHeaders(), $response->getBody()
                    );
                }
            );
    }
public function putCreateAsyncWithHttpInfo(Requests\PutCreateRequest $request)
    {
        $returnType = '\Aspose\Storage\Model\UploadResponse';
        $request = $this->PutCreateRequest($request);

        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);
                        }
                    }

                    if ($this->config->getDebug()) {
                        $this->_writeResponseLog($response->getStatusCode(), $response->getHeaders(), ObjectSerializer::deserialize($content, $returnType, []));
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();

                    if ($exception instanceof RepeatRequestException) {
                        $this->_refreshToken();
                        throw new RepeatRequestException("Request must be retried", $statusCode, $response->getHeaders(), $response->getBody());
                    }

                    throw new ApiException(
                        sprintf('[%d] Error connecting to the API (%s)', $statusCode, $exception->getRequest()->getUri()), $statusCode, $response->getHeaders(), $response->getBody()
                    );
                }
            );
    }
public function putCreateAsyncWithHttpInfo ( Requests \ PutCreateRequest $ request ) { $ returnType = '\Aspose\Storage\Model\UploadResponse' ; $ request = $ this -> PutCreateRequest ( $ request ) ; 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 ) ; } } if ( $ this -> config -> getDebug ( ) ) { $ this -> _writeResponseLog ( $ response -> getStatusCode ( ) , $ response -> getHeaders ( ) , ObjectSerializer :: deserialize ( $ content , $ returnType , [ ] ) ) ; } return [ ObjectSerializer :: deserialize ( $ content , $ returnType , [ ] ) , $ response -> getStatusCode ( ) , $ response -> getHeaders ( ) ] ; } , function ( $ exception ) { $ response = $ exception -> getResponse ( ) ; $ statusCode = $ response -> getStatusCode ( ) ; if ( $ exception instanceof RepeatRequestException ) { $ this -> _refreshToken ( ) ; throw new RepeatRequestException ( "Request must be retried" , $ statusCode , $ response -> getHeaders ( ) , $ response -> getBody ( ) ) ; } throw new ApiException ( sprintf ( '[%d] Error connecting to the API (%s)' , $ statusCode , $ exception -> getRequest ( ) -> getUri ( ) ) , $ statusCode , $ response -> getHeaders ( ) , $ response -> getBody ( ) ) ; } ) ; }
/*
Operation putCreateAsyncWithHttpInfo

Upload a specific file

@param Requests\PutCreateRequest $request is a request object for operation

@throws \InvalidArgumentException
@return \GuzzleHttp\Promise\PromiseInterface
/ * Operation putCreateAsyncWithHttpInfo