/// <summary>
        /// Creates the http request based on this request.
        /// </summary>
        /// <param name="configuration">SDK configuration.</param>
        /// <returns>The http request instance.</returns>
        public HttpRequestMessage CreateHttpRequest(Configuration configuration)
        {
            // verify the required parameter 'name' is set
            if (this.Name == null)
            {
                throw new ApiException(400, "Missing required parameter 'name' when calling DeleteHeadersFooters");
            }

            var path = configuration.GetApiRootUrl() + "/words/{name}/{sectionPath}/headersfooters";

            path = Regex
                   .Replace(path, "\\*", string.Empty)
                   .Replace("&amp;", "&")
                   .Replace("/?", "?");
            path = UrlHelper.AddPathParameter(path, "name", this.Name);
            path = UrlHelper.AddPathParameter(path, "sectionPath", this.SectionPath);
            path = UrlHelper.AddQueryParameterToUrl(path, "folder", this.Folder);
            path = UrlHelper.AddQueryParameterToUrl(path, "storage", this.Storage);
            path = UrlHelper.AddQueryParameterToUrl(path, "loadEncoding", this.LoadEncoding);
            path = UrlHelper.AddQueryParameterToUrl(path, "password", this.Password);
            path = UrlHelper.AddQueryParameterToUrl(path, "destFileName", this.DestFileName);
            path = UrlHelper.AddQueryParameterToUrl(path, "revisionAuthor", this.RevisionAuthor);
            path = UrlHelper.AddQueryParameterToUrl(path, "revisionDateTime", this.RevisionDateTime);
            path = UrlHelper.AddQueryParameterToUrl(path, "headersFootersTypes", this.HeadersFootersTypes);

            var result = new HttpRequestMessage(HttpMethod.Delete, path);

            return(result);
        }
        /// <summary>
        /// Download file
        /// </summary>
        /// <param name="request">Request. <see cref="DownloadFileRequest" /></param>
        /// <returns><see cref="System.IO.Stream"/></returns>
        public System.IO.Stream DownloadFile(DownloadFileRequest request)
        {
            // verify the required parameter 'path' is set
            if (request.path == null)
            {
                throw new ApiException(400, "Missing required parameter 'path' when calling DownloadFile");
            }

            // create path and map variables
            var resourcePath = this.configuration.GetServerUrl() + "/annotation/storage/file/{path}";

            resourcePath = Regex
                           .Replace(resourcePath, "\\*", string.Empty)
                           .Replace("&amp;", "&")
                           .Replace("/?", "?");
            resourcePath = UrlHelper.AddPathParameter(resourcePath, "path", request.path);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "storageName", request.storageName);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "versionId", request.versionId);

            return(this.apiInvoker.InvokeBinaryApi(
                       resourcePath,
                       "GET",
                       null,
                       null,
                       null));
        }
        /// <summary>
        /// Creates the http request based on this request.
        /// </summary>
        /// <param name="configuration">SDK configuration.</param>
        /// <returns>The http request instance.</returns>
        public HttpRequestMessage CreateHttpRequest(Configuration configuration)
        {
            // verify the required parameter 'name' is set
            if (this.Name == null)
            {
                throw new ApiException(400, "Missing required parameter 'name' when calling GetHeaderFooter");
            }

            var path = configuration.GetApiRootUrl() + "/words/{name}/headersfooters/{headerFooterIndex}";

            path = Regex
                   .Replace(path, "\\*", string.Empty)
                   .Replace("&amp;", "&")
                   .Replace("/?", "?");
            path = UrlHelper.AddPathParameter(path, "name", this.Name);
            path = UrlHelper.AddPathParameter(path, "headerFooterIndex", this.HeaderFooterIndex);
            path = UrlHelper.AddQueryParameterToUrl(path, "folder", this.Folder);
            path = UrlHelper.AddQueryParameterToUrl(path, "storage", this.Storage);
            path = UrlHelper.AddQueryParameterToUrl(path, "loadEncoding", this.LoadEncoding);
            path = UrlHelper.AddQueryParameterToUrl(path, "password", this.Password);
            path = UrlHelper.AddQueryParameterToUrl(path, "filterByType", this.FilterByType);

            var result = new HttpRequestMessage(HttpMethod.Get, path);

            return(result);
        }
        /// <summary>
        /// Creates the http request based on this request.
        /// </summary>
        /// <param name="configuration">SDK configuration.</param>
        /// <returns>The http request instance.</returns>
        public HttpRequestMessage CreateHttpRequest(Configuration configuration)
        {
            // verify the required parameter 'name' is set
            if (this.Name == null)
            {
                throw new ApiException(400, "Missing required parameter 'name' when calling DeleteAllParagraphTabStops");
            }

            var path = configuration.GetApiRootUrl() + "/words/{name}/{nodePath}/paragraphs/{index}/tabstops";

            path = Regex
                   .Replace(path, "\\*", string.Empty)
                   .Replace("&amp;", "&")
                   .Replace("/?", "?");
            path = UrlHelper.AddPathParameter(path, "name", this.Name);
            path = UrlHelper.AddPathParameter(path, "index", this.Index);
            path = UrlHelper.AddPathParameter(path, "nodePath", this.NodePath);
            path = UrlHelper.AddQueryParameterToUrl(path, "folder", this.Folder);
            path = UrlHelper.AddQueryParameterToUrl(path, "storage", this.Storage);
            path = UrlHelper.AddQueryParameterToUrl(path, "loadEncoding", this.LoadEncoding);
            path = UrlHelper.AddQueryParameterToUrl(path, "password", this.Password);
            path = UrlHelper.AddQueryParameterToUrl(path, "destFileName", this.DestFileName);

            var result = new HttpRequestMessage(HttpMethod.Delete, path);

            return(result);
        }
Beispiel #5
0
        /// <summary>
        /// Creates the http request based on this request.
        /// </summary>
        /// <param name="configuration">SDK configuration.</param>
        /// <returns>The http request instance.</returns>
        public HttpRequestMessage CreateHttpRequest(Configuration configuration)
        {
            // verify the required parameter 'name' is set
            if (this.Name == null)
            {
                throw new ApiException(400, "Missing required parameter 'name' when calling RemoveRange");
            }

            // verify the required parameter 'rangeStartIdentifier' is set
            if (this.RangeStartIdentifier == null)
            {
                throw new ApiException(400, "Missing required parameter 'rangeStartIdentifier' when calling RemoveRange");
            }

            var path = configuration.GetApiRootUrl() + "/words/{name}/range/{rangeStartIdentifier}/{rangeEndIdentifier}";

            path = Regex
                   .Replace(path, "\\*", string.Empty)
                   .Replace("&amp;", "&")
                   .Replace("/?", "?");
            path = UrlHelper.AddPathParameter(path, "name", this.Name);
            path = UrlHelper.AddPathParameter(path, "rangeStartIdentifier", this.RangeStartIdentifier);
            path = UrlHelper.AddPathParameter(path, "rangeEndIdentifier", this.RangeEndIdentifier);
            path = UrlHelper.AddQueryParameterToUrl(path, "folder", this.Folder);
            path = UrlHelper.AddQueryParameterToUrl(path, "storage", this.Storage);
            path = UrlHelper.AddQueryParameterToUrl(path, "loadEncoding", this.LoadEncoding);
            path = UrlHelper.AddQueryParameterToUrl(path, "password", this.Password);
            path = UrlHelper.AddQueryParameterToUrl(path, "destFileName", this.DestFileName);

            var result = new HttpRequestMessage(HttpMethod.Delete, path);

            return(result);
        }
        /// <summary>
        /// Check if storage exists
        /// </summary>
        /// <param name="request">Request. <see cref="StorageExistsRequest" /></param>
        /// <returns><see cref="StorageExist"/></returns>
        public StorageExist StorageExists(StorageExistsRequest request)
        {
            // verify the required parameter 'storageName' is set
            if (request.storageName == null)
            {
                throw new ApiException(400, "Missing required parameter 'storageName' when calling StorageExists");
            }

            // create path and map variables
            var resourcePath = this.configuration.GetServerUrl() + "/comparison/storage/{storageName}/exist";

            resourcePath = Regex
                           .Replace(resourcePath, "\\*", string.Empty)
                           .Replace("&amp;", "&")
                           .Replace("/?", "?");
            resourcePath = UrlHelper.AddPathParameter(resourcePath, "storageName", request.storageName);

            var response = this.apiInvoker.InvokeApi(
                resourcePath,
                "GET",
                null,
                null,
                null);

            if (response != null)
            {
                return((StorageExist)SerializationHelper.Deserialize(response, typeof(StorageExist)));
            }

            return(null);
        }
        /// <summary>
        /// Copy folder
        /// </summary>
        /// <param name="request">Request. <see cref="CopyFolderRequest" /></param>
        public void CopyFolder(CopyFolderRequest request)
        {
            // verify the required parameter 'srcPath' is set
            if (request.srcPath == null)
            {
                throw new ApiException(400, "Missing required parameter 'srcPath' when calling CopyFolder");
            }

            // verify the required parameter 'destPath' is set
            if (request.destPath == null)
            {
                throw new ApiException(400, "Missing required parameter 'destPath' when calling CopyFolder");
            }

            // create path and map variables
            var resourcePath = this.configuration.GetServerUrl() + "/metadata/storage/folder/copy/{srcPath}";

            resourcePath = Regex
                           .Replace(resourcePath, "\\*", string.Empty)
                           .Replace("&amp;", "&")
                           .Replace("/?", "?");
            resourcePath = UrlHelper.AddPathParameter(resourcePath, "srcPath", request.srcPath);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "destPath", request.destPath);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "srcStorageName", request.srcStorageName);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "destStorageName", request.destStorageName);

            this.apiInvoker.InvokeApi(
                resourcePath,
                "PUT",
                null,
                null,
                null);
        }
        /// <summary>
        ///     Move folder
        /// </summary>
        /// <param name="request">Request. <see cref="MoveFolderRequest" /></param>

        public void MoveFolder(MoveFolderRequest request)
        {
            // verify the required parameter 'srcPath' is set
            if (request.srcPath == null)
            {
                throw new ApiException(400, "Missing required parameter 'srcPath' when calling MoveFolder");
            }
            // verify the required parameter 'destPath' is set
            if (request.destPath == null)
            {
                throw new ApiException(400, "Missing required parameter 'destPath' when calling MoveFolder");
            }
            // create path and map variables
            string resourcePath = _configuration.GetApiRootUrl() + "/barcode/storage/folder/move/{srcPath}";

            resourcePath = Regex
                           .Replace(resourcePath, "\\*", string.Empty)
                           .Replace("&amp;", "&")
                           .Replace("/?", "?");
            resourcePath = UrlHelper.AddPathParameter(resourcePath, "srcPath", request.srcPath);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "destPath", request.destPath);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "srcStorageName", request.srcStorageName);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "destStorageName", request.destStorageName);



            _apiInvoker.InvokeApi(
                resourcePath,
                "PUT",
                null,
                null,
                null);
        }
Beispiel #9
0
        /// <summary>
        /// Creates the http request based on this request.
        /// </summary>
        /// <param name="configuration">SDK configuration.</param>
        /// <returns>The http request instance.</returns>
        public HttpRequestMessage CreateHttpRequest(Configuration configuration)
        {
            // verify the required parameter 'name' is set
            if (this.Name == null)
            {
                throw new ApiException(400, "Missing required parameter 'name' when calling ClassifyDocument");
            }

            var path = configuration.GetApiRootUrl() + "/words/{name}/classify";

            path = Regex
                   .Replace(path, "\\*", string.Empty)
                   .Replace("&amp;", "&")
                   .Replace("/?", "?");
            path = UrlHelper.AddPathParameter(path, "name", this.Name);
            path = UrlHelper.AddQueryParameterToUrl(path, "folder", this.Folder);
            path = UrlHelper.AddQueryParameterToUrl(path, "storage", this.Storage);
            path = UrlHelper.AddQueryParameterToUrl(path, "loadEncoding", this.LoadEncoding);
            path = UrlHelper.AddQueryParameterToUrl(path, "password", this.Password);
            path = UrlHelper.AddQueryParameterToUrl(path, "bestClassesCount", this.BestClassesCount);
            path = UrlHelper.AddQueryParameterToUrl(path, "taxonomy", this.Taxonomy);

            var result = new HttpRequestMessage(HttpMethod.Get, path);

            return(result);
        }
        /// <summary>
        /// Check if file or folder exists
        /// </summary>
        /// <param name="request">Request. <see cref="ObjectExistsRequest" /></param>
        /// <returns><see cref="ObjectExist"/></returns>
        public ObjectExist ObjectExists(ObjectExistsRequest request)
        {
            // verify the required parameter 'path' is set
            if (request.path == null)
            {
                throw new ApiException(400, "Missing required parameter 'path' when calling ObjectExists");
            }

            // create path and map variables
            var resourcePath = this.configuration.GetServerUrl() + "/viewer/storage/exist/{path}";

            resourcePath = Regex
                           .Replace(resourcePath, "\\*", string.Empty)
                           .Replace("&amp;", "&")
                           .Replace("/?", "?");
            resourcePath = UrlHelper.AddPathParameter(resourcePath, "path", request.path);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "storageName", request.storageName);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "versionId", request.versionId);

            var response = this.apiInvoker.InvokeApi(
                resourcePath,
                "GET",
                null,
                null,
                null);

            if (response != null)
            {
                return((ObjectExist)SerializationHelper.Deserialize(response, typeof(ObjectExist)));
            }

            return(null);
        }
        /// <summary>
        /// Move file
        /// </summary>
        /// <param name="request">Request. <see cref="MoveFileRequest" /></param>
        /// <returns><see cref=""/></returns>
        public void MoveFile(MoveFileRequest request)
        {
            // verify the required parameter 'srcPath' is set
            if (request.SrcPath == null)
            {
                throw new ApiException(400, "Missing required parameter 'srcPath' when calling MoveFile");
            }

            // verify the required parameter 'destPath' is set
            if (request.DestPath == null)
            {
                throw new ApiException(400, "Missing required parameter 'destPath' when calling MoveFile");
            }

            // create path and map variables
            var resourcePath = this.configuration.GetApiRootUrl() + "/classification/storage/file/move/{srcPath}";

            resourcePath = Regex
                           .Replace(resourcePath, "\\*", string.Empty)
                           .Replace("&amp;", "&")
                           .Replace("/?", "?");
            resourcePath = UrlHelper.AddPathParameter(resourcePath, "srcPath", request.SrcPath);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "destPath", request.DestPath);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "srcStorageName", request.SrcStorageName);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "destStorageName", request.DestStorageName);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "versionId", request.VersionId);

            this.apiInvoker.InvokeApi(
                resourcePath,
                "PUT",
                null,
                null,
                null);
        }
        /// <summary>
        /// Delete folder
        /// </summary>
        /// <param name="request">Request. <see cref="DeleteFolderRequest" /></param>
        public void DeleteFolder(DeleteFolderRequest request)
        {
            // verify the required parameter 'path' is set
            if (request.path == null)
            {
                throw new ApiException(400, "Missing required parameter 'path' when calling DeleteFolder");
            }

            // create path and map variables
            var resourcePath = this.configuration.GetServerUrl() + "/metadata/storage/folder/{path}";

            resourcePath = Regex
                           .Replace(resourcePath, "\\*", string.Empty)
                           .Replace("&amp;", "&")
                           .Replace("/?", "?");
            resourcePath = UrlHelper.AddPathParameter(resourcePath, "path", request.path);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "storageName", request.storageName);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "recursive", request.recursive);

            this.apiInvoker.InvokeApi(
                resourcePath,
                "DELETE",
                null,
                null,
                null);
        }
Beispiel #13
0
        /// <summary>
        /// Creates the http request based on this request.
        /// </summary>
        /// <param name="configuration">SDK configuration.</param>
        /// <returns>The http request instance.</returns>
        public HttpRequestMessage CreateHttpRequest(Configuration configuration)
        {
            // verify the required parameter 'name' is set
            if (this.Name == null)
            {
                throw new ApiException(400, "Missing required parameter 'name' when calling UpdateDrawingObject");
            }

            // verify the required parameter 'drawingObject' is set
            if (this.DrawingObject == null)
            {
                throw new ApiException(400, "Missing required parameter 'drawingObject' when calling UpdateDrawingObject");
            }

            // verify the required parameter 'imageFile' is set
            if (this.ImageFile == null)
            {
                throw new ApiException(400, "Missing required parameter 'imageFile' when calling UpdateDrawingObject");
            }

            var path = configuration.GetApiRootUrl() + "/words/{name}/{nodePath}/drawingObjects/{index}";

            path = Regex
                   .Replace(path, "\\*", string.Empty)
                   .Replace("&amp;", "&")
                   .Replace("/?", "?");
            path = UrlHelper.AddPathParameter(path, "name", this.Name);
            path = UrlHelper.AddPathParameter(path, "index", this.Index);
            path = UrlHelper.AddPathParameter(path, "nodePath", this.NodePath);
            path = UrlHelper.AddQueryParameterToUrl(path, "folder", this.Folder);
            path = UrlHelper.AddQueryParameterToUrl(path, "storage", this.Storage);
            path = UrlHelper.AddQueryParameterToUrl(path, "loadEncoding", this.LoadEncoding);
            path = UrlHelper.AddQueryParameterToUrl(path, "password", this.Password);
            path = UrlHelper.AddQueryParameterToUrl(path, "destFileName", this.DestFileName);
            path = UrlHelper.AddQueryParameterToUrl(path, "revisionAuthor", this.RevisionAuthor);
            path = UrlHelper.AddQueryParameterToUrl(path, "revisionDateTime", this.RevisionDateTime);

            var result   = new HttpRequestMessage(HttpMethod.Put, path);
            var formData = new Dictionary <string, object>();

            if (this.DrawingObject != null)
            {
                formData.Add("DrawingObject", this.DrawingObject);
            }

            if (this.ImageFile != null)
            {
                formData.Add("imageFile", new Aspose.Words.Cloud.Sdk.FileInfo()
                {
                    Name = "ImageFile", FileContent = StreamHelper.ReadAsBytes(this.ImageFile)
                });
            }

            if (formData.Count > 0)
            {
                result.Content = ApiInvoker.GetMultipartFormData(formData);
            }

            return(result);
        }
        /// <summary>
        /// Creates the http request based on this request.
        /// </summary>
        /// <param name="configuration">SDK configuration.</param>
        /// <returns>The http request instance.</returns>
        public HttpRequestMessage CreateHttpRequest(Configuration configuration)
        {
            // verify the required parameter 'name' is set
            if (this.Name == null)
            {
                throw new ApiException(400, "Missing required parameter 'name' when calling ReplaceText");
            }

            // verify the required parameter 'replaceText' is set
            if (this.ReplaceText == null)
            {
                throw new ApiException(400, "Missing required parameter 'replaceText' when calling ReplaceText");
            }

            var path = configuration.GetApiRootUrl() + "/words/{name}/replaceText";

            path = Regex
                   .Replace(path, "\\*", string.Empty)
                   .Replace("&amp;", "&")
                   .Replace("/?", "?");
            path = UrlHelper.AddPathParameter(path, "name", this.Name);
            path = UrlHelper.AddQueryParameterToUrl(path, "folder", this.Folder);
            path = UrlHelper.AddQueryParameterToUrl(path, "storage", this.Storage);
            path = UrlHelper.AddQueryParameterToUrl(path, "loadEncoding", this.LoadEncoding);
            path = UrlHelper.AddQueryParameterToUrl(path, "password", this.Password);
            path = UrlHelper.AddQueryParameterToUrl(path, "destFileName", this.DestFileName);
            path = UrlHelper.AddQueryParameterToUrl(path, "revisionAuthor", this.RevisionAuthor);
            path = UrlHelper.AddQueryParameterToUrl(path, "revisionDateTime", this.RevisionDateTime);

            var result = new HttpRequestMessage(HttpMethod.Put, path);

            result.Content = ApiInvoker.GetBodyParameterData(this.ReplaceText);
            return(result);
        }
        /// <summary>
        /// Create the folder
        /// </summary>
        /// <param name="request">Request. <see cref="CreateFolderRequest" /></param>
        /// <returns><see cref=""/></returns>
        public void CreateFolder(CreateFolderRequest request)
        {
            // verify the required parameter 'path' is set
            if (request.Path == null)
            {
                throw new ApiException(400, "Missing required parameter 'path' when calling CreateFolder");
            }

            // create path and map variables
            var resourcePath = this.configuration.GetApiRootUrl() + "/classification/storage/folder/{path}";

            resourcePath = Regex
                           .Replace(resourcePath, "\\*", string.Empty)
                           .Replace("&amp;", "&")
                           .Replace("/?", "?");
            resourcePath = UrlHelper.AddPathParameter(resourcePath, "path", request.Path);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "storageName", request.StorageName);

            this.apiInvoker.InvokeApi(
                resourcePath,
                "PUT",
                null,
                null,
                null);
        }
        /// <summary>
        /// Creates the http request based on this request.
        /// </summary>
        /// <param name="configuration">SDK configuration.</param>
        /// <returns>The http request instance.</returns>
        public HttpRequestMessage CreateHttpRequest(Configuration configuration)
        {
            // verify the required parameter 'name' is set
            if (this.Name == null)
            {
                throw new ApiException(400, "Missing required parameter 'name' when calling GetDocumentStatistics");
            }

            var path = configuration.GetApiRootUrl() + "/words/{name}/statistics";

            path = Regex
                   .Replace(path, "\\*", string.Empty)
                   .Replace("&amp;", "&")
                   .Replace("/?", "?");
            path = UrlHelper.AddPathParameter(path, "name", this.Name);
            path = UrlHelper.AddQueryParameterToUrl(path, "folder", this.Folder);
            path = UrlHelper.AddQueryParameterToUrl(path, "storage", this.Storage);
            path = UrlHelper.AddQueryParameterToUrl(path, "loadEncoding", this.LoadEncoding);
            path = UrlHelper.AddQueryParameterToUrl(path, "password", this.Password);
            path = UrlHelper.AddQueryParameterToUrl(path, "includeComments", this.IncludeComments);
            path = UrlHelper.AddQueryParameterToUrl(path, "includeFootnotes", this.IncludeFootnotes);
            path = UrlHelper.AddQueryParameterToUrl(path, "includeTextInShapes", this.IncludeTextInShapes);

            var result = new HttpRequestMessage(HttpMethod.Get, path);

            return(result);
        }
        /// <summary>
        ///     Get all files and folders within a folder
        /// </summary>
        /// <param name="request">Request. <see cref="GetFilesListRequest" /></param>
        /// <returns>
        ///     <see cref="FilesList" />
        /// </returns>
        public FilesList GetFilesList(GetFilesListRequest request)
        {
            // verify the required parameter 'path' is set
            if (request.path == null)
            {
                throw new ApiException(400, "Missing required parameter 'path' when calling GetFilesList");
            }
            // create path and map variables
            string resourcePath = _configuration.GetApiRootUrl() + "/barcode/storage/folder/{path}";

            resourcePath = Regex
                           .Replace(resourcePath, "\\*", string.Empty)
                           .Replace("&amp;", "&")
                           .Replace("/?", "?");
            resourcePath = UrlHelper.AddPathParameter(resourcePath, "path", request.path);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "storageName", request.storageName);



            string response = _apiInvoker.InvokeApi(
                resourcePath,
                "GET",
                null,
                null,
                null);

            if (response != null)
            {
                return((FilesList)SerializationHelper.Deserialize(response, typeof(FilesList)));
            }

            return(null);
        }
        /// <summary>
        /// Creates the http request based on this request.
        /// </summary>
        /// <param name="configuration">SDK configuration.</param>
        /// <returns>The http request instance.</returns>
        public HttpRequestMessage CreateHttpRequest(Configuration configuration)
        {
            // verify the required parameter 'document' is set
            if (this.Document == null)
            {
                throw new ApiException(400, "Missing required parameter 'document' when calling UpdateBorderOnline");
            }

            // verify the required parameter 'borderProperties' is set
            if (this.BorderProperties == null)
            {
                throw new ApiException(400, "Missing required parameter 'borderProperties' when calling UpdateBorderOnline");
            }

            // verify the required parameter 'borderType' is set
            if (this.BorderType == null)
            {
                throw new ApiException(400, "Missing required parameter 'borderType' when calling UpdateBorderOnline");
            }

            var path = configuration.GetApiRootUrl() + "/words/online/put/{nodePath}/borders/{borderType}";

            path = Regex
                   .Replace(path, "\\*", string.Empty)
                   .Replace("&amp;", "&")
                   .Replace("/?", "?");
            path = UrlHelper.AddPathParameter(path, "borderType", this.BorderType);
            path = UrlHelper.AddPathParameter(path, "nodePath", this.NodePath);
            path = UrlHelper.AddQueryParameterToUrl(path, "loadEncoding", this.LoadEncoding);
            path = UrlHelper.AddQueryParameterToUrl(path, "password", this.Password);
            path = UrlHelper.AddQueryParameterToUrl(path, "destFileName", this.DestFileName);
            path = UrlHelper.AddQueryParameterToUrl(path, "revisionAuthor", this.RevisionAuthor);
            path = UrlHelper.AddQueryParameterToUrl(path, "revisionDateTime", this.RevisionDateTime);

            var result   = new HttpRequestMessage(HttpMethod.Put, path);
            var formData = new Dictionary <string, object>();

            if (this.Document != null)
            {
                formData.Add("document", new Aspose.Words.Cloud.Sdk.FileInfo()
                {
                    Name = "Document", FileContent = StreamHelper.ReadAsBytes(this.Document)
                });
            }

            if (this.BorderProperties != null)
            {
                formData.Add("BorderProperties", this.BorderProperties);
            }

            if (formData.Count > 0)
            {
                result.Content = ApiInvoker.GetMultipartFormData(formData);
            }

            return(result);
        }
        /// <summary>
        /// Creates the http request based on this request.
        /// </summary>
        /// <param name="configuration">SDK configuration.</param>
        /// <returns>The http request instance.</returns>
        public HttpRequestMessage CreateHttpRequest(Configuration configuration)
        {
            // verify the required parameter 'document' is set
            if (this.Document == null)
            {
                throw new ApiException(400, "Missing required parameter 'document' when calling ReplaceWithTextOnline");
            }

            // verify the required parameter 'rangeStartIdentifier' is set
            if (this.RangeStartIdentifier == null)
            {
                throw new ApiException(400, "Missing required parameter 'rangeStartIdentifier' when calling ReplaceWithTextOnline");
            }

            // verify the required parameter 'rangeText' is set
            if (this.RangeText == null)
            {
                throw new ApiException(400, "Missing required parameter 'rangeText' when calling ReplaceWithTextOnline");
            }

            var path = configuration.GetApiRootUrl() + "/words/online/post/range/{rangeStartIdentifier}/{rangeEndIdentifier}";

            path = Regex
                   .Replace(path, "\\*", string.Empty)
                   .Replace("&amp;", "&")
                   .Replace("/?", "?");
            path = UrlHelper.AddPathParameter(path, "rangeStartIdentifier", this.RangeStartIdentifier);
            path = UrlHelper.AddPathParameter(path, "rangeEndIdentifier", this.RangeEndIdentifier);
            path = UrlHelper.AddQueryParameterToUrl(path, "loadEncoding", this.LoadEncoding);
            path = UrlHelper.AddQueryParameterToUrl(path, "password", this.Password);
            path = UrlHelper.AddQueryParameterToUrl(path, "destFileName", this.DestFileName);

            var result   = new HttpRequestMessage(HttpMethod.Put, path);
            var formData = new Dictionary <string, object>();

            if (this.Document != null)
            {
                formData.Add("document", new Aspose.Words.Cloud.Sdk.FileInfo()
                {
                    Name = "Document", FileContent = StreamHelper.ReadAsBytes(this.Document)
                });
            }

            if (this.RangeText != null)
            {
                formData.Add("RangeText", this.RangeText);
            }

            if (formData.Count > 0)
            {
                result.Content = ApiInvoker.GetMultipartFormData(formData);
            }

            return(result);
        }
        /// <summary>
        /// Upload file
        /// </summary>
        /// <param name="request">Request. <see cref="UploadFileRequest" /></param>
        /// <returns><see cref="FilesUploadResult"/></returns>
        public FilesUploadResult UploadFile(UploadFileRequest request)
        {
            // verify the required parameter 'path' is set
            if (request.Path == null)
            {
                throw new ApiException(400, "Missing required parameter 'path' when calling UploadFile");
            }

            // verify the required parameter 'file' is set
            if (request.File == null)
            {
                throw new ApiException(400, "Missing required parameter 'file' when calling UploadFile");
            }

            // create path and map variables
            var resourcePath = this.configuration.GetApiRootUrl() + "/classification/storage/file/{path}";

            resourcePath = Regex
                           .Replace(resourcePath, "\\*", string.Empty)
                           .Replace("&amp;", "&")
                           .Replace("/?", "?");
            var formParams = new Dictionary <string, object>();

            resourcePath = UrlHelper.AddPathParameter(resourcePath, "path", request.Path);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "storageName", request.StorageName);

            if (request.File != null)
            {
                formParams.Add("filename", "test.pdf");
                formParams.Add("file", this.apiInvoker.ToFileInfo(request.File, "File"));
            }

            try
            {
                var response = this.apiInvoker.InvokeApi(
                    resourcePath,
                    "PUT",
                    null,
                    null,
                    formParams);
                if (response != null)
                {
                    return((FilesUploadResult)SerializationHelper.Deserialize(response, typeof(FilesUploadResult)));
                }
                return(null);
            }
            catch (ApiException ex)
            {
                if (ex.ErrorCode == 404)
                {
                    return(null);
                }
                throw;
            }
        }
        /// <summary>
        /// Creates the http request based on this request.
        /// </summary>
        /// <param name="configuration">SDK configuration.</param>
        /// <returns>The http request instance.</returns>
        public HttpRequestMessage CreateHttpRequest(Configuration configuration)
        {
            // verify the required parameter 'name' is set
            if (this.Name == null)
            {
                throw new ApiException(400, "Missing required parameter 'name' when calling BuildReport");
            }

            // verify the required parameter 'data' is set
            if (this.Data == null)
            {
                throw new ApiException(400, "Missing required parameter 'data' when calling BuildReport");
            }

            // verify the required parameter 'reportEngineSettings' is set
            if (this.ReportEngineSettings == null)
            {
                throw new ApiException(400, "Missing required parameter 'reportEngineSettings' when calling BuildReport");
            }

            var path = configuration.GetApiRootUrl() + "/words/{name}/buildReport";

            path = Regex
                   .Replace(path, "\\*", string.Empty)
                   .Replace("&amp;", "&")
                   .Replace("/?", "?");
            path = UrlHelper.AddPathParameter(path, "name", this.Name);
            path = UrlHelper.AddQueryParameterToUrl(path, "folder", this.Folder);
            path = UrlHelper.AddQueryParameterToUrl(path, "storage", this.Storage);
            path = UrlHelper.AddQueryParameterToUrl(path, "loadEncoding", this.LoadEncoding);
            path = UrlHelper.AddQueryParameterToUrl(path, "password", this.Password);
            path = UrlHelper.AddQueryParameterToUrl(path, "destFileName", this.DestFileName);

            var result   = new HttpRequestMessage(HttpMethod.Put, path);
            var formData = new Dictionary <string, object>();

            if (this.Data != null)
            {
                formData.Add("Data", this.Data);
            }

            if (this.ReportEngineSettings != null)
            {
                formData.Add("ReportEngineSettings", this.ReportEngineSettings);
            }

            if (formData.Count > 0)
            {
                result.Content = ApiInvoker.GetMultipartFormData(formData);
            }

            return(result);
        }
        /// <summary>
        /// Creates the http request based on this request.
        /// </summary>
        /// <param name="configuration">SDK configuration.</param>
        /// <returns>The http request instance.</returns>
        public HttpRequestMessage CreateHttpRequest(Configuration configuration)
        {
            // verify the required parameter 'document' is set
            if (this.Document == null)
            {
                throw new ApiException(400, "Missing required parameter 'document' when calling InsertOrUpdateParagraphTabStopOnline");
            }

            // verify the required parameter 'tabStopInsertDto' is set
            if (this.TabStopInsertDto == null)
            {
                throw new ApiException(400, "Missing required parameter 'tabStopInsertDto' when calling InsertOrUpdateParagraphTabStopOnline");
            }

            var path = configuration.GetApiRootUrl() + "/words/online/post/{nodePath}/paragraphs/{index}/tabstops";

            path = Regex
                   .Replace(path, "\\*", string.Empty)
                   .Replace("&amp;", "&")
                   .Replace("/?", "?");
            path = UrlHelper.AddPathParameter(path, "index", this.Index);
            path = UrlHelper.AddPathParameter(path, "nodePath", this.NodePath);
            path = UrlHelper.AddQueryParameterToUrl(path, "loadEncoding", this.LoadEncoding);
            path = UrlHelper.AddQueryParameterToUrl(path, "password", this.Password);
            path = UrlHelper.AddQueryParameterToUrl(path, "destFileName", this.DestFileName);

            var result   = new HttpRequestMessage(HttpMethod.Put, path);
            var formData = new Dictionary <string, object>();

            if (this.Document != null)
            {
                formData.Add("document", new Aspose.Words.Cloud.Sdk.FileInfo()
                {
                    Name = "Document", FileContent = StreamHelper.ReadAsBytes(this.Document)
                });
            }

            if (this.TabStopInsertDto != null)
            {
                formData.Add("TabStopInsertDto", this.TabStopInsertDto);
            }

            if (formData.Count > 0)
            {
                result.Content = ApiInvoker.GetMultipartFormData(formData);
            }

            return(result);
        }
        /// <summary>
        /// Creates the http request based on this request.
        /// </summary>
        /// <param name="configuration">SDK configuration.</param>
        /// <returns>The http request instance.</returns>
        public HttpRequestMessage CreateHttpRequest(Configuration configuration)
        {
            // verify the required parameter 'name' is set
            if (this.Name == null)
            {
                throw new ApiException(400, "Missing required parameter 'name' when calling SaveAsTiff");
            }

            // verify the required parameter 'saveOptions' is set
            if (this.SaveOptions == null)
            {
                throw new ApiException(400, "Missing required parameter 'saveOptions' when calling SaveAsTiff");
            }

            var path = configuration.GetApiRootUrl() + "/words/{name}/saveAs/tiff";

            path = Regex
                   .Replace(path, "\\*", string.Empty)
                   .Replace("&amp;", "&")
                   .Replace("/?", "?");
            path = UrlHelper.AddPathParameter(path, "name", this.Name);
            path = UrlHelper.AddQueryParameterToUrl(path, "folder", this.Folder);
            path = UrlHelper.AddQueryParameterToUrl(path, "storage", this.Storage);
            path = UrlHelper.AddQueryParameterToUrl(path, "loadEncoding", this.LoadEncoding);
            path = UrlHelper.AddQueryParameterToUrl(path, "password", this.Password);
            path = UrlHelper.AddQueryParameterToUrl(path, "useAntiAliasing", this.UseAntiAliasing);
            path = UrlHelper.AddQueryParameterToUrl(path, "useHighQualityRendering", this.UseHighQualityRendering);
            path = UrlHelper.AddQueryParameterToUrl(path, "imageBrightness", this.ImageBrightness);
            path = UrlHelper.AddQueryParameterToUrl(path, "imageColorMode", this.ImageColorMode);
            path = UrlHelper.AddQueryParameterToUrl(path, "imageContrast", this.ImageContrast);
            path = UrlHelper.AddQueryParameterToUrl(path, "numeralFormat", this.NumeralFormat);
            path = UrlHelper.AddQueryParameterToUrl(path, "pageCount", this.PageCount);
            path = UrlHelper.AddQueryParameterToUrl(path, "pageIndex", this.PageIndex);
            path = UrlHelper.AddQueryParameterToUrl(path, "paperColor", this.PaperColor);
            path = UrlHelper.AddQueryParameterToUrl(path, "pixelFormat", this.PixelFormat);
            path = UrlHelper.AddQueryParameterToUrl(path, "resolution", this.Resolution);
            path = UrlHelper.AddQueryParameterToUrl(path, "scale", this.Scale);
            path = UrlHelper.AddQueryParameterToUrl(path, "tiffCompression", this.TiffCompression);
            path = UrlHelper.AddQueryParameterToUrl(path, "dmlRenderingMode", this.DmlRenderingMode);
            path = UrlHelper.AddQueryParameterToUrl(path, "dmlEffectsRenderingMode", this.DmlEffectsRenderingMode);
            path = UrlHelper.AddQueryParameterToUrl(path, "tiffBinarizationMethod", this.TiffBinarizationMethod);
            path = UrlHelper.AddQueryParameterToUrl(path, "zipOutput", this.ZipOutput);
            path = UrlHelper.AddQueryParameterToUrl(path, "fontsLocation", this.FontsLocation);

            var result = new HttpRequestMessage(HttpMethod.Put, path);

            result.Content = ApiInvoker.GetBodyParameterData(this.SaveOptions);
            return(result);
        }
        /// <summary>
        /// Creates the http request based on this request.
        /// </summary>
        /// <param name="configuration">SDK configuration.</param>
        /// <returns>The http request instance.</returns>
        public HttpRequestMessage CreateHttpRequest(Configuration configuration)
        {
            // verify the required parameter 'document' is set
            if (this.Document == null)
            {
                throw new ApiException(400, "Missing required parameter 'document' when calling RenderPageOnline");
            }

            // verify the required parameter 'format' is set
            if (this.Format == null)
            {
                throw new ApiException(400, "Missing required parameter 'format' when calling RenderPageOnline");
            }

            var path = configuration.GetApiRootUrl() + "/words/online/get/pages/{pageIndex}/render";

            path = Regex
                   .Replace(path, "\\*", string.Empty)
                   .Replace("&amp;", "&")
                   .Replace("/?", "?");
            path = UrlHelper.AddPathParameter(path, "pageIndex", this.PageIndex);
            path = UrlHelper.AddQueryParameterToUrl(path, "format", this.Format);
            path = UrlHelper.AddQueryParameterToUrl(path, "loadEncoding", this.LoadEncoding);
            path = UrlHelper.AddQueryParameterToUrl(path, "password", this.Password);
            path = UrlHelper.AddQueryParameterToUrl(path, "fontsLocation", this.FontsLocation);

            var result   = new HttpRequestMessage(HttpMethod.Put, path);
            var formData = new Dictionary <string, object>();

            if (this.Document != null)
            {
                formData.Add("document", new Aspose.Words.Cloud.Sdk.FileInfo()
                {
                    Name = "Document", FileContent = StreamHelper.ReadAsBytes(this.Document)
                });
            }

            if (formData.Count > 0)
            {
                result.Content = ApiInvoker.GetMultipartFormData(formData);
            }

            return(result);
        }
        /// <summary>
        /// Get file versions
        /// </summary>
        /// <param name="request">Request. <see cref="GetFileVersionsRequest" /></param>
        /// <returns><see cref="FileVersions"/></returns>
        public FileVersions GetFileVersions(GetFileVersionsRequest request)
        {
            // verify the required parameter 'path' is set
            if (request.path == null)
            {
                throw new ApiException(400, "Missing required parameter 'path' when calling GetFileVersions");
            }

            // create path and map variables
            var resourcePath = this.configuration.GetApiRootUrl() + "/omr/storage/version/{path}";

            resourcePath = Regex
                           .Replace(resourcePath, "\\*", string.Empty)
                           .Replace("&amp;", "&")
                           .Replace("/?", "?");
            resourcePath = UrlHelper.AddPathParameter(resourcePath, "path", request.path);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "storageName", request.storageName);

            try
            {
                var response = this.apiInvoker.InvokeApi(
                    resourcePath,
                    "GET",
                    null,
                    null,
                    null);
                if (response != null)
                {
                    return((FileVersions)SerializationHelper.Deserialize(response, typeof(FileVersions)));
                }

                return(null);
            }
            catch (ApiException ex)
            {
                if (ex.ErrorCode == 404)
                {
                    return(null);
                }

                throw;
            }
        }
Beispiel #26
0
        /// <summary>
        /// Check if storage exists
        /// </summary>
        /// <param name="request">Request. <see cref="GetIsStorageExistRequest" /></param>
        /// <returns><see cref="StorageExistResponse"/></returns>
        public StorageExistResponse GetIsStorageExist(GetIsStorageExistRequest request)
        {
            // verify the required parameter 'name' is set
            if (request.Name == null)
            {
                throw new ApiException(400, "Missing required parameter 'name' when calling GetIsStorageExist");
            }

            // create path and map variables
            var resourcePath = this.configuration.GetApiRootUrl() + "/storage/{name}/exist";

            resourcePath = Regex
                           .Replace(resourcePath, "\\*", string.Empty)
                           .Replace("&amp;", "&")
                           .Replace("/?", "?");
            resourcePath = UrlHelper.AddPathParameter(resourcePath, "name", request.Name);

            try
            {
                var response = this.apiInvoker.InvokeApi(
                    resourcePath,
                    "GET",
                    null,
                    null,
                    null);
                if (response != null)
                {
                    return((StorageExistResponse)SerializationHelper.Deserialize(response, typeof(StorageExistResponse)));
                }

                return(null);
            }
            catch (ApiException ex)
            {
                if (ex.ErrorCode == 404)
                {
                    return(null);
                }

                throw;
            }
        }
Beispiel #27
0
        /// <summary>
        /// Creates the http request based on this request.
        /// </summary>
        /// <param name="configuration">SDK configuration.</param>
        /// <returns>The http request instance.</returns>
        public HttpRequestMessage CreateHttpRequest(Configuration configuration)
        {
            // verify the required parameter 'fileContent' is set
            if (this.FileContent == null)
            {
                throw new ApiException(400, "Missing required parameter 'fileContent' when calling UploadFile");
            }

            // verify the required parameter 'path' is set
            if (this.Path == null)
            {
                throw new ApiException(400, "Missing required parameter 'path' when calling UploadFile");
            }

            var path = configuration.GetApiRootUrl() + "/words/storage/file/{path}";

            path = Regex
                   .Replace(path, "\\*", string.Empty)
                   .Replace("&amp;", "&")
                   .Replace("/?", "?");
            path = UrlHelper.AddPathParameter(path, "path", this.Path);
            path = UrlHelper.AddQueryParameterToUrl(path, "storageName", this.StorageName);

            var result   = new HttpRequestMessage(HttpMethod.Put, path);
            var formData = new Dictionary <string, object>();

            if (this.FileContent != null)
            {
                formData.Add("fileContent", new Aspose.Words.Cloud.Sdk.FileInfo()
                {
                    Name = "FileContent", FileContent = StreamHelper.ReadAsBytes(this.FileContent)
                });
            }

            if (formData.Count > 0)
            {
                result.Content = ApiInvoker.GetMultipartFormData(formData);
            }

            return(result);
        }
        /// <summary>
        /// Creates the http request based on this request.
        /// </summary>
        /// <param name="configuration">SDK configuration.</param>
        /// <returns>The http request instance.</returns>
        public HttpRequestMessage CreateHttpRequest(Configuration configuration)
        {
            // verify the required parameter 'path' is set
            if (this.Path == null)
            {
                throw new ApiException(400, "Missing required parameter 'path' when calling GetFilesList");
            }

            var path = configuration.GetApiRootUrl() + "/words/storage/folder/{path}";

            path = Regex
                   .Replace(path, "\\*", string.Empty)
                   .Replace("&amp;", "&")
                   .Replace("/?", "?");
            path = UrlHelper.AddPathParameter(path, "path", this.Path);
            path = UrlHelper.AddQueryParameterToUrl(path, "storageName", this.StorageName);

            var result = new HttpRequestMessage(HttpMethod.Get, path);

            return(result);
        }
        /// <summary>
        ///     Generate image with multiple barcodes and put new file on server
        /// </summary>
        /// <param name="request">Request. <see cref="PutGenerateMultipleRequest" /></param>
        /// <returns>
        ///     <see cref="ResultImageInfo" />
        /// </returns>
        public ResultImageInfo PutGenerateMultiple(PutGenerateMultipleRequest request)
        {
            // verify the required parameter 'name' is set
            if (request.name == null)
            {
                throw new ApiException(400, "Missing required parameter 'name' when calling PutGenerateMultiple");
            }
            // verify the required parameter 'generatorParamsList' is set
            if (request.generatorParamsList == null)
            {
                throw new ApiException(400, "Missing required parameter 'generatorParamsList' when calling PutGenerateMultiple");
            }
            // create path and map variables
            string resourcePath = _configuration.GetApiRootUrl() + "/barcode/{name}/generateMultiple";

            resourcePath = Regex
                           .Replace(resourcePath, "\\*", string.Empty)
                           .Replace("&amp;", "&")
                           .Replace("/?", "?");
            resourcePath = UrlHelper.AddPathParameter(resourcePath, "name", request.name);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "format", request.format);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "folder", request.folder);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "storage", request.storage);


            string postBody = SerializationHelper.Serialize(request.generatorParamsList); // http body (model) parameter
            string response = _apiInvoker.InvokeApi(
                resourcePath,
                "PUT",
                postBody,
                null,
                null);

            if (response != null)
            {
                return((ResultImageInfo)SerializationHelper.Deserialize(response, typeof(ResultImageInfo)));
            }

            return(null);
        }
        /// <summary>
        /// Creates the http request based on this request.
        /// </summary>
        /// <param name="configuration">SDK configuration.</param>
        /// <returns>The http request instance.</returns>
        public HttpRequestMessage CreateHttpRequest(Configuration configuration)
        {
            // verify the required parameter 'name' is set
            if (this.Name == null)
            {
                throw new ApiException(400, "Missing required parameter 'name' when calling ExecuteMailMerge");
            }

            var path = configuration.GetApiRootUrl() + "/words/{name}/MailMerge";

            path = Regex
                   .Replace(path, "\\*", string.Empty)
                   .Replace("&amp;", "&")
                   .Replace("/?", "?");
            path = UrlHelper.AddPathParameter(path, "name", this.Name);
            path = UrlHelper.AddQueryParameterToUrl(path, "folder", this.Folder);
            path = UrlHelper.AddQueryParameterToUrl(path, "storage", this.Storage);
            path = UrlHelper.AddQueryParameterToUrl(path, "loadEncoding", this.LoadEncoding);
            path = UrlHelper.AddQueryParameterToUrl(path, "password", this.Password);
            path = UrlHelper.AddQueryParameterToUrl(path, "withRegions", this.WithRegions);
            path = UrlHelper.AddQueryParameterToUrl(path, "mailMergeDataFile", this.MailMergeDataFile);
            path = UrlHelper.AddQueryParameterToUrl(path, "cleanup", this.Cleanup);
            path = UrlHelper.AddQueryParameterToUrl(path, "useWholeParagraphAsRegion", this.UseWholeParagraphAsRegion);
            path = UrlHelper.AddQueryParameterToUrl(path, "destFileName", this.DestFileName);

            var result   = new HttpRequestMessage(HttpMethod.Put, path);
            var formData = new Dictionary <string, object>();

            if (this.Data != null)
            {
                formData.Add("Data", this.Data);
            }

            if (formData.Count > 0)
            {
                result.Content = ApiInvoker.GetMultipartFormData(formData);
            }

            return(result);
        }