/// <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 GetStyleOnline");
            }

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

            var path = configuration.GetApiRootUrl() + "/words/online/get/styles/{styleName}";

            path = Regex
                   .Replace(path, "\\*", string.Empty)
                   .Replace("&amp;", "&")
                   .Replace("/?", "?");
            path = UrlHelper.AddPathParameter(path, "styleName", this.StyleName);
            path = UrlHelper.AddQueryParameterToUrl(path, "loadEncoding", this.LoadEncoding);
            path = UrlHelper.AddQueryParameterToUrl(path, "password", this.Password);

            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>
        /// 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.GetApiRootUrl() + "/classification/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);

            try
            {
                var response = this.apiInvoker.InvokeApi(
                    resourcePath,
                    "GET",
                    null,
                    null,
                    null);
                if (response != null)
                {
                    return((ObjectExist)SerializationHelper.Deserialize(response, typeof(ObjectExist)));
                }
                return(null);
            }
            catch (ApiException ex)
            {
                if (ex.ErrorCode == 404)
                {
                    return(null);
                }
                throw;
            }
        }
Exemplo n.º 3
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 UpdateBookmark");
            }

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

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

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

            path = Regex
                   .Replace(path, "\\*", string.Empty)
                   .Replace("&amp;", "&")
                   .Replace("/?", "?");
            path = UrlHelper.AddPathParameter(path, "name", this.Name);
            path = UrlHelper.AddPathParameter(path, "bookmarkName", this.BookmarkName);
            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.BookmarkData);
            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 'text' is set
            if (this.Text == null)
            {
                throw new ApiException(400, "Missing required parameter 'text' when calling Classify");
            }

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

            path = Regex
                   .Replace(path, "\\*", string.Empty)
                   .Replace("&amp;", "&")
                   .Replace("/?", "?");
            path = UrlHelper.AddQueryParameterToUrl(path, "bestClassesCount", this.BestClassesCount);

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

            result.Content = ApiInvoker.GetBodyParameterData(this.Text);
            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);
        }
Exemplo n.º 6
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 'data' is set
            if (this.Data == null)
            {
                throw new ApiException(400, "Missing required parameter 'data' when calling LoadWebDocument");
            }

            var path = configuration.GetApiRootUrl() + "/words/loadWebDocument";

            path = Regex
                   .Replace(path, "\\*", string.Empty)
                   .Replace("&amp;", "&")
                   .Replace("/?", "?");
            path = UrlHelper.AddQueryParameterToUrl(path, "storage", this.Storage);

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

            result.Content = ApiInvoker.GetBodyParameterData(this.Data);
            return(result);
        }
        /// <summary>
        ///     Recognition of a barcode from file on server with parameters in body.
        /// </summary>
        /// <param name="request">Request. <see cref="PutBarcodeRecognizeFromBodyRequest" /></param>
        /// <returns>
        ///     <see cref="BarcodeResponseList" />
        /// </returns>
        public BarcodeResponseList PutBarcodeRecognizeFromBody(PutBarcodeRecognizeFromBodyRequest request)
        {
            // verify the required parameter 'name' is set
            if (request.name == null)
            {
                throw new ApiException(400, "Missing required parameter 'name' when calling PutBarcodeRecognizeFromBody");
            }
            // verify the required parameter 'readerParams' is set
            if (request.readerParams == null)
            {
                throw new ApiException(400, "Missing required parameter 'readerParams' when calling PutBarcodeRecognizeFromBody");
            }
            // create path and map variables
            string resourcePath = _configuration.GetApiRootUrl() + "/barcode/{name}/recognize";

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


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

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

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

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

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

            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.Post, path);

            result.Content = ApiInvoker.GetBodyParameterData(this.RangeText);
            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 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);
        }
        /// <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>
        /// Converts input document file to format specified
        /// </summary>
        /// <param name="request">Request. <see cref="ConvertDocumentDirectRequest" /></param>
        /// <returns><see cref="System.IO.Stream"/></returns>
        public System.IO.Stream ConvertDocumentDirect(ConvertDocumentDirectRequest request)
        {
            // verify the required parameter 'format' is set
            if (request.format == null)
            {
                throw new ApiException(400, "Missing required parameter 'format' when calling ConvertDocumentDirect");
            }

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

            // create path and map variables
            var resourcePath = this.configuration.GetServerUrl() + "/conversion";

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

            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "format", request.format);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "fromPage", request.fromPage);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "pagesCount", request.pagesCount);

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

            return(this.apiInvoker.InvokeBinaryApi(
                       resourcePath,
                       "PUT",
                       null,
                       null,
                       formParams));
        }
Exemplo n.º 12
0
        /// <summary>
        /// Download a specific file
        /// </summary>
        /// <param name="request">Request. <see cref="GetDownloadRequest" /></param>
        /// <returns><see cref="System.IO.Stream"/></returns>
        public System.IO.Stream GetDownload(GetDownloadRequest request)
        {
            // verify the required parameter 'path' is set
            if (request.Path == null)
            {
                throw new ApiException(400, "Missing required parameter 'path' when calling GetDownload");
            }

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

            resourcePath = Regex
                           .Replace(resourcePath, "\\*", string.Empty)
                           .Replace("&amp;", "&")
                           .Replace("/?", "?");
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "path", request.Path);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "versionId", request.VersionId);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "storage", request.Storage);

            try
            {
                return(this.apiInvoker.InvokeBinaryApi(
                           resourcePath,
                           "GET",
                           null,
                           null,
                           null));
            }
            catch (ApiException ex)
            {
                if (ex.ErrorCode == 404)
                {
                    return(null);
                }

                throw;
            }
        }
        /// <summary>
        /// Get the file listing of a specific folder
        /// </summary>
        /// <param name="request">Request. <see cref="GetListFilesRequest" /></param>
        /// <returns><see cref="FilesResponse"/></returns>
        public FilesResponse GetListFiles(GetListFilesRequest request)
        {
            // create path and map variables
            var resourcePath = this.configuration.GetApiRootUrl() + "/storage/folder";

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

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

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

                throw;
            }
        }
Exemplo n.º 14
0
        /// <summary>
        /// Posts the categories changes.
        /// </summary>
        /// <param name="request">Request. <see cref="PostCategoriesChangesRequest" /></param>
        /// <returns><see cref="List<ComparisonChangesCategoryDto>"/></returns>
        public List <ComparisonChangesCategoryDto> PostCategoriesChanges(PostCategoriesChangesRequest request)
        {
            // create path and map variables
            var resourcePath = this.configuration.GetApiRootUrl() + "/comparison/compareDocuments/changes/categories";

            resourcePath = Regex
                           .Replace(resourcePath, "\\*", string.Empty)
                           .Replace("&amp;", "&")
                           .Replace("/?", "?");
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "categoriesType", request.CategoriesType);
            var postBody = SerializationHelper.Serialize(request.Request); // http body (model) parameter

            try
            {
                var response = this.apiInvoker.InvokeApi(
                    resourcePath,
                    "POST",
                    postBody,
                    null,
                    null);
                if (response != null)
                {
                    return((List <ComparisonChangesCategoryDto>)SerializationHelper.Deserialize(response, typeof(List <ComparisonChangesCategoryDto>)));
                }

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

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

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

            path = Regex
                   .Replace(path, "\\*", string.Empty)
                   .Replace("&amp;", "&")
                   .Replace("/?", "?");
            path = UrlHelper.AddPathParameter(path, "name", this.Name);
            path = UrlHelper.AddQueryParameterToUrl(path, "format", this.Format);
            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, "from", this.From);
            path = UrlHelper.AddQueryParameterToUrl(path, "to", this.To);
            path = UrlHelper.AddQueryParameterToUrl(path, "zipOutput", this.ZipOutput);
            path = UrlHelper.AddQueryParameterToUrl(path, "fontsLocation", this.FontsLocation);

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

            return(result);
        }
Exemplo n.º 16
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 'documentName' is set
            if (this.DocumentName == null)
            {
                throw new ApiException(400, "Missing required parameter 'documentName' when calling GetDocument");
            }

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

            path = Regex
                   .Replace(path, "\\*", string.Empty)
                   .Replace("&amp;", "&")
                   .Replace("/?", "?");
            path = UrlHelper.AddPathParameter(path, "documentName", this.DocumentName);
            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);

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

            return(result);
        }
Exemplo n.º 17
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 'srcPath' is set
            if (this.SrcPath == null)
            {
                throw new ApiException(400, "Missing required parameter 'srcPath' when calling CopyFile");
            }

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

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

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

            return(result);
        }
        /// <summary>
        /// Insert Digital Signature into the Document
        /// </summary>
        /// <param name="request">Request. <see cref="PostDigitalRequest" /></param>
        /// <returns><see cref="SignatureDocumentResponse"/></returns>
        public SignatureDocumentResponse PostDigital(PostDigitalRequest request)
        {
            // verify the required parameter 'name' is set
            if (request.Name == null)
            {
                throw new ApiException(400, "Missing required parameter 'name' when calling PostDigital");
            }

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

            resourcePath = Regex
                           .Replace(resourcePath, "\\*", string.Empty)
                           .Replace("&amp;", "&")
                           .Replace("/?", "?");
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "name", request.Name);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "password", request.Password);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "folder", request.Folder);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "certificateFile", request.CertificateFile);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "imageFile", request.ImageFile);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "storage", request.Storage);
            var postBody = SerializationHelper.Serialize(request.SignOptionsData); // http body (model) parameter
            var response = this.apiInvoker.InvokeApi(
                resourcePath,
                "POST",
                postBody,
                null,
                null);

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

            return(null);
        }
        /// <summary>
        ///     Generate barcode and save on server (from query params or from file with json or xml content)
        /// </summary>
        /// <param name="request">Request. <see cref="PutBarcodeGenerateFileRequest" /></param>
        /// <returns>
        ///     <see cref="ResultImageInfo" />
        /// </returns>
        public ResultImageInfo PutBarcodeGenerateFile(PutBarcodeGenerateFileRequest request)
        {
            // verify the required parameter 'name' is set
            if (request.name == null)
            {
                throw new ApiException(400, "Missing required parameter 'name' when calling PutBarcodeGenerateFile");
            }
            // verify the required parameter 'type' is set
            if (request.Type == null)
            {
                throw new ApiException(400, "Missing required parameter 'type' when calling PutBarcodeGenerateFile");
            }
            // verify the required parameter 'text' is set
            if (request.Text == null)
            {
                throw new ApiException(400, "Missing required parameter 'text' when calling PutBarcodeGenerateFile");
            }
            // create path and map variables
            string resourcePath = _configuration.GetApiRootUrl() + "/barcode/{name}/generate";

            resourcePath = Regex
                           .Replace(resourcePath, "\\*", string.Empty)
                           .Replace("&amp;", "&")
                           .Replace("/?", "?");
            resourcePath = UrlHelper.AddPathParameter(resourcePath, "name", request.name);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "type", request.Type);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "text", request.Text);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "twoDDisplayText", request.TwoDDisplayText);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "textLocation", request.TextLocation);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "textAlignment", request.TextAlignment);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "textColor", request.TextColor);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "fontSizeMode", request.FontSizeMode);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "noWrap", request.NoWrap);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "resolution", request.Resolution);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "resolutionX", request.ResolutionX);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "resolutionY", request.ResolutionY);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "dimensionX", request.DimensionX);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "textSpace", request.TextSpace);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "units", request.Units);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "sizeMode", request.SizeMode);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "barHeight", request.BarHeight);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "imageHeight", request.ImageHeight);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "imageWidth", request.ImageWidth);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "rotationAngle", request.RotationAngle);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "backColor", request.BackColor);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "barColor", request.BarColor);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "borderColor", request.BorderColor);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "borderWidth", request.BorderWidth);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "borderDashStyle", request.BorderDashStyle);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "borderVisible", request.BorderVisible);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "enableChecksum", request.EnableChecksum);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "enableEscape", request.EnableEscape);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "filledBars", request.FilledBars);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "alwaysShowChecksum", request.AlwaysShowChecksum);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "wideNarrowRatio", request.WideNarrowRatio);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "validateText", request.ValidateText);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "supplementData", request.SupplementData);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "supplementSpace", request.SupplementSpace);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "barWidthReduction", request.BarWidthReduction);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "storage", request.storage);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "folder", request.folder);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "format", request.format);



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

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

            return(null);
        }
        /// <summary>
        ///     Recognize barcode from an url or from request body. Request body can contain raw data bytes of the image or encoded with base64.
        /// </summary>
        /// <param name="request">Request. <see cref="PostBarcodeRecognizeFromUrlOrContentRequest" /></param>
        /// <returns>
        ///     <see cref="BarcodeResponseList" />
        /// </returns>
        public BarcodeResponseList PostBarcodeRecognizeFromUrlOrContent(PostBarcodeRecognizeFromUrlOrContentRequest request)
        {
            // create path and map variables
            string resourcePath = _configuration.GetApiRootUrl() + "/barcode/recognize";

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

            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "type", request.Type);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "checksumValidation", request.ChecksumValidation);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "detectEncoding", request.DetectEncoding);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "preset", request.Preset);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "rectX", request.RectX);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "rectY", request.RectY);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "rectWidth", request.RectWidth);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "rectHeight", request.RectHeight);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "stripFNC", request.StripFNC);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "timeout", request.Timeout);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "medianSmoothingWindowSize", request.MedianSmoothingWindowSize);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "allowMedianSmoothing", request.AllowMedianSmoothing);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "allowComplexBackground", request.AllowComplexBackground);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "allowDatamatrixIndustrialBarcodes", request.AllowDatamatrixIndustrialBarcodes);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "allowDecreasedImage", request.AllowDecreasedImage);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "allowDetectScanGap", request.AllowDetectScanGap);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "allowIncorrectBarcodes", request.AllowIncorrectBarcodes);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "allowInvertImage", request.AllowInvertImage);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "allowMicroWhiteSpotsRemoving", request.AllowMicroWhiteSpotsRemoving);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "allowOneDFastBarcodesDetector", request.AllowOneDFastBarcodesDetector);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "allowOneDWipedBarsRestoration", request.AllowOneDWipedBarsRestoration);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "allowQRMicroQrRestoration", request.AllowQRMicroQrRestoration);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "allowRegularImage", request.AllowRegularImage);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "allowSaltAndPepperFiltering", request.AllowSaltAndPepperFiltering);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "allowWhiteSpotsRemoving", request.AllowWhiteSpotsRemoving);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "checkMore1DVariants", request.CheckMore1DVariants);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "fastScanOnly", request.FastScanOnly);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "regionLikelihoodThresholdPercent", request.RegionLikelihoodThresholdPercent);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "scanWindowSizes", request.ScanWindowSizes);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "similarity", request.Similarity);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "skipDiagonalSearch", request.SkipDiagonalSearch);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "readTinyBarcodes", request.ReadTinyBarcodes);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "australianPostEncodingTable", request.AustralianPostEncodingTable);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "ignoreEndingFillingPatternsForCTable", request.IgnoreEndingFillingPatternsForCTable);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "rectangleRegion", request.RectangleRegion);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "url", request.url);



            if (request.image != null)
            {
                formParams.Add("image", ApiInvoker.ToFileInfo(request.image, "image"));
            }
            string response = _apiInvoker.InvokeApi(
                resourcePath,
                "POST",
                null,
                null,
                formParams);

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

            return(null);
        }
Exemplo n.º 21
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 'document' is set
            if (this.Document == null)
            {
                throw new ApiException(400, "Missing required parameter 'document' when calling UpdateDrawingObjectOnline");
            }

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

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

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

            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);
            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.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>
        ///     Recognize barcode from a file on server.
        /// </summary>
        /// <param name="request">Request. <see cref="GetBarcodeRecognizeRequest" /></param>
        /// <returns>
        ///     <see cref="BarcodeResponseList" />
        /// </returns>
        public BarcodeResponseList GetBarcodeRecognize(GetBarcodeRecognizeRequest request)
        {
            // verify the required parameter 'name' is set
            if (request.name == null)
            {
                throw new ApiException(400, "Missing required parameter 'name' when calling GetBarcodeRecognize");
            }
            // create path and map variables
            string resourcePath = _configuration.GetApiRootUrl() + "/barcode/{name}/recognize";

            resourcePath = Regex
                           .Replace(resourcePath, "\\*", string.Empty)
                           .Replace("&amp;", "&")
                           .Replace("/?", "?");
            resourcePath = UrlHelper.AddPathParameter(resourcePath, "name", request.name);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "type", request.Type);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "checksumValidation", request.ChecksumValidation);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "detectEncoding", request.DetectEncoding);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "preset", request.Preset);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "rectX", request.RectX);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "rectY", request.RectY);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "rectWidth", request.RectWidth);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "rectHeight", request.RectHeight);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "stripFNC", request.StripFNC);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "timeout", request.Timeout);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "medianSmoothingWindowSize", request.MedianSmoothingWindowSize);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "allowMedianSmoothing", request.AllowMedianSmoothing);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "allowComplexBackground", request.AllowComplexBackground);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "allowDatamatrixIndustrialBarcodes", request.AllowDatamatrixIndustrialBarcodes);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "allowDecreasedImage", request.AllowDecreasedImage);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "allowDetectScanGap", request.AllowDetectScanGap);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "allowIncorrectBarcodes", request.AllowIncorrectBarcodes);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "allowInvertImage", request.AllowInvertImage);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "allowMicroWhiteSpotsRemoving", request.AllowMicroWhiteSpotsRemoving);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "allowOneDFastBarcodesDetector", request.AllowOneDFastBarcodesDetector);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "allowOneDWipedBarsRestoration", request.AllowOneDWipedBarsRestoration);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "allowQRMicroQrRestoration", request.AllowQRMicroQrRestoration);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "allowRegularImage", request.AllowRegularImage);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "allowSaltAndPepperFiltering", request.AllowSaltAndPepperFiltering);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "allowWhiteSpotsRemoving", request.AllowWhiteSpotsRemoving);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "checkMore1DVariants", request.CheckMore1DVariants);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "fastScanOnly", request.FastScanOnly);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "regionLikelihoodThresholdPercent", request.RegionLikelihoodThresholdPercent);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "scanWindowSizes", request.ScanWindowSizes);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "similarity", request.Similarity);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "skipDiagonalSearch", request.SkipDiagonalSearch);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "readTinyBarcodes", request.ReadTinyBarcodes);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "australianPostEncodingTable", request.AustralianPostEncodingTable);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "ignoreEndingFillingPatternsForCTable", request.IgnoreEndingFillingPatternsForCTable);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "rectangleRegion", request.RectangleRegion);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "storage", request.storage);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "folder", request.folder);



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

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

            return(null);
        }
Exemplo n.º 23
0
        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 = _configuration.GetApiRootUrl() + "/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("file", _apiInvoker.ToFileInfo(request.File, "File"));
            }

            try
            {
                var response = _apiInvoker.InvokeApi(
                    resourcePath,
                    "PUT",
                    null,
                    null,
                    formParams);
                if (response != null)
                {
                    return((FilesUploadResult)SerializationHelper.Deserialize(response, typeof(FilesUploadResult)));
                }

                var errors = new List <Error> {
                    new Error {
                        Code = "500", Message = "response null"
                    }
                };
                return(new FilesUploadResult {
                    Errors = errors
                });
            }
            catch (ApiException ex)
            {
                var errors = new List <Error> {
                    new Error {
                        Code = ex.ErrorCode.ToString(), Message = ex.Message, Description = ex.StackTrace
                    }
                };
                return(new FilesUploadResult {
                    Errors = errors
                });
            }
        }