diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..07c26b1 --- /dev/null +++ b/.gitignore @@ -0,0 +1,26 @@ +*.class + +# Mobile Tools for Java (J2ME) +.mtj.tmp/ + +# Package Files # +*.jar +*.war +*.ear + +# exclude jar for gradle wrapper +!gradle/wrapper/*.jar + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* + +# build files +**/target +target +.gradle +build + +#IDE +.idea + +local.properties \ No newline at end of file diff --git a/.swagger-codegen-ignore b/.swagger-codegen-ignore new file mode 100644 index 0000000..df01cd2 --- /dev/null +++ b/.swagger-codegen-ignore @@ -0,0 +1,29 @@ +# Swagger Codegen Ignore +# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md +docs/*.* +src/main/java/com/aspose/asposecloudpdf/auth/*.* +.gitignore +git_push.sh +README.md + diff --git a/.swagger-codegen/VERSION b/.swagger-codegen/VERSION new file mode 100644 index 0000000..a625450 --- /dev/null +++ b/.swagger-codegen/VERSION @@ -0,0 +1 @@ +2.3.1 \ No newline at end of file diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..8af5b78 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,32 @@ +# +# Copyright (c) 2018 Aspose.Pdf for Cloud +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. +# +language: java +jdk: + - oraclejdk8 + - oraclejdk7 +before_install: + # ensure gradlew has proper permission + - chmod a+x ./gradlew +script: + # test using maven + - mvn test + # uncomment below to test using gradle + # - gradle test + # uncomment below to test using sbt + # - sbt test diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..fedba38 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2018 Aspose.Pdf for Cloud + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md index b513781..5203e3d 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,109 @@ -# aspose-pdf-cloud-java -Java library for communicating with the Aspose.Pdf for Cloud API +# Aspose.Pdf for Cloud +[Aspose.Pdf for Cloud](https://products.aspose.cloud/pdf/cloud) is a true REST API that enables you to perform a wide range of document processing operations including creation, manipulation, conversion and rendering of Pdf documents in the cloud. + +Our Cloud SDKs are wrappers around REST API in various programming languages, allowing you to process documents in language of your choice quickly and easily, gaining all benefits of strong types and IDE highlights. This repository contains new generation SDKs for Aspose.Pdf for Cloud and examples. + +These SDKs are now fully supported. If you have any questions, see any bugs or have enhancement request, feel free to reach out to us at [Free Support Forums](https://forum.aspose.cloud/c/pdf). + + +## Requirements + +Building the API client library requires [Maven](https://maven.apache.org/) to be installed. + +## Installation + +To install the API client library to your local Maven repository, simply execute: + +```shell +mvn install +``` + +To deploy it to a remote Maven repository instead, configure the settings of the repository and execute: + +```shell +mvn deploy +``` + +Refer to the [official documentation](https://maven.apache.org/plugins/maven-deploy-plugin/usage.html) for more information. + +### Maven users + +Add this dependency to your project's POM: + +```xml + + com.aspose + aspose-cloud-pdf + 18.5.0 + compile + +``` + +### Gradle users + +Add this dependency to your project's build file: + +```groovy +compile "com.aspose:aspose-cloud-pdf:18.5.0" +``` + +### Others + +At first generate the JAR by executing: + + mvn package + +Then manually install the following JARs: + +* target/aspose-cloud-pdf-18.5.0.jar +* target/lib/*.jar + +## Getting Started + +Please follow the [installation](#installation) instruction and execute the following Java code: + +```java + +import com.aspose.asposecloudpdf.*; +import com.aspose.asposecloudpdf.model.*; +import com.aspose.asposecloudpdf.api.PdfApi; + +import java.io.File; +import java.util.*; + +public class PdfApiExample { + + public static void main(String[] args) { + // Get App key and App SID from https://cloud.aspose.com + PdfApi apiInstance = new PdfApi("app_key", "app_sid"); + String name = "name_example"; // String | The document name. + String fieldName = "fieldName_example"; // String | The field name/ + String storage = "storage_example"; // String | The document storage. + String folder = "folder_example"; // String | The document folder. + try { + SaaSposeResponse result = apiInstance.deleteField(name, fieldName, storage, folder); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling PdfApi#deleteField"); + e.printStackTrace(); + } + } +} + +``` + +## Unit Tests +Aspose PDF SDK includes a suite of unit tests within the "test" subdirectory. These Unit Tests also serves as examples of how to use the Aspose PDF SDK. + +## Licensing +All Aspose.Pdf for Cloud SDKs are licensed under [MIT License](LICENSE). + +## Resources ++ [**Website**](https://www.aspose.cloud) ++ [**Product Home**](https://products.aspose.cloud/pdf/cloud) ++ [**Documentation**](https://docs.aspose.cloud/display/pdfcloud/Home) ++ [**Free Support Forum**](https://forum.aspose.cloud/c/pdf) ++ [**Paid Support Helpdesk**](https://helpdesk.aspose.cloud/) ++ [**Blog**](https://blog.aspose.cloud/category/aspose-products/aspose-pdf-product-family/) + + diff --git a/build.gradle b/build.gradle new file mode 100644 index 0000000..5c5d915 --- /dev/null +++ b/build.gradle @@ -0,0 +1,79 @@ +/** + * Copyright (c) 2018 Aspose.Pdf for Cloud + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. +*/ +apply plugin: 'idea' +apply plugin: 'eclipse' + +group = 'com.aspose' +version = '18.5.0' + +buildscript { + repositories { + jcenter() + } + dependencies { + classpath 'com.android.tools.build:gradle:2.3.+' + classpath 'com.novoda:bintray-release:0.3.4' + } +} + +repositories { + jcenter() +} + +apply plugin: 'java' +apply plugin: 'maven' +apply plugin: 'com.novoda.bintray-release' + +sourceCompatibility = JavaVersion.VERSION_1_7 +targetCompatibility = JavaVersion.VERSION_1_7 + +install { + repositories.mavenInstaller { + pom.artifactId = 'aspose-cloud-pdf' + } +} + +task execute(type:JavaExec) { + main = System.getProperty('mainClass') + classpath = sourceSets.main.runtimeClasspath +} + + + +dependencies { + compile 'io.swagger:swagger-annotations:1.5.15' + compile 'com.squareup.okhttp:okhttp:2.7.5' + compile 'com.squareup.okhttp:logging-interceptor:2.7.5' + compile 'com.google.code.gson:gson:2.8.1' + compile 'io.gsonfire:gson-fire:1.8.0' + compile 'org.threeten:threetenbp:1.3.5' + testCompile 'junit:junit:4.12' +} + +// bintray-release +// https://github.com/novoda/bintray-release/wiki/Configuration-of-the-publish-closure +publish { + groupId = 'com.aspose' + artifactId = 'aspose-cloud-pdf' + publishVersion = '18.5.0' + desc = 'Aspose.PDF for Cloud is a REST API for creating and editing PDF files. It can also be used to convert PDF files to different formats like DOC, HTML, XPS, TIFF and many more. Aspose.Pdf for Cloud gives you control: create PDFs from scratch or from HTML, XML, template, database, XPS or an image. Render PDFs to image formats such as JPEG, PNG, GIF, BMP, TIFF and many others. Aspose.Pdf for Cloud helps you manipulate elements of a PDF file like text, annotations, watermarks, signatures, bookmarks, stamps and so on. Its REST API also allows you to manage PDF pages by using features like merging, splitting, and inserting. Add images to a PDF file or convert PDF pages to images.' + licences = ['MIT'] + website = 'https://products.aspose.cloud/pdf/cloud' + repository = 'https://github.com/aspose-pdf-cloud/aspose-pdf-cloud.git' +} \ No newline at end of file diff --git a/build.sbt b/build.sbt new file mode 100644 index 0000000..7f737be --- /dev/null +++ b/build.sbt @@ -0,0 +1,21 @@ +lazy val root = (project in file(".")). + settings( + organization := "com.aspose", + name := "aspose-cloud-pdf", + version := "18.5.0", + scalaVersion := "2.11.4", + scalacOptions ++= Seq("-feature"), + javacOptions in compile ++= Seq("-Xlint:deprecation"), + publishArtifact in (Compile, packageDoc) := false, + resolvers += Resolver.mavenLocal, + libraryDependencies ++= Seq( + "io.swagger" % "swagger-annotations" % "1.5.15", + "com.squareup.okhttp" % "okhttp" % "2.7.5", + "com.squareup.okhttp" % "logging-interceptor" % "2.7.5", + "com.google.code.gson" % "gson" % "2.8.1", + "org.threeten" % "threetenbp" % "1.3.5" % "compile", + "io.gsonfire" % "gson-fire" % "1.8.0" % "compile", + "junit" % "junit" % "4.12" % "test", + "com.novocode" % "junit-interface" % "0.10" % "test" + ) + ) diff --git a/gradle.properties b/gradle.properties new file mode 100644 index 0000000..1465129 --- /dev/null +++ b/gradle.properties @@ -0,0 +1,18 @@ +# +# Copyright (c) 2018 Aspose.Pdf for Cloud +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. +# diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000..2c6137b Binary files /dev/null and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000..2c6932d --- /dev/null +++ b/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,6 @@ +#Tue May 17 23:08:05 CST 2016 +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-bin.zip diff --git a/gradlew b/gradlew new file mode 100644 index 0000000..2ae440d --- /dev/null +++ b/gradlew @@ -0,0 +1,178 @@ +#!/usr/bin/env bash + +############################################################################## +## +## Gradle start up script for UN*X +## +## Copyright (c) 2018 Aspose.Pdf for Cloud +## Permission is hereby granted, free of charge, to any person obtaining a copy +## of this software and associated documentation files (the "Software"), to deal +## in the Software without restriction, including without limitation the rights +## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +## copies of the Software, and to permit persons to whom the Software is +## furnished to do so, subject to the following conditions: +## The above copyright notice and this permission notice shall be included in all +## copies or substantial portions of the Software. +## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +## IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +## AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +## SOFTWARE. +## +## +############################################################################## + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS="" + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn ( ) { + echo "$*" +} + +die ( ) { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; +esac + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >/dev/null +APP_HOME="`pwd -P`" +cd "$SAVED" >/dev/null + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin, switch paths to Windows format before running java +if $cygwin ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + JAVACMD=`cygpath --unix "$JAVACMD"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=$((i+1)) + done + case $i in + (0) set -- ;; + (1) set -- "$args0" ;; + (2) set -- "$args0" "$args1" ;; + (3) set -- "$args0" "$args1" "$args2" ;; + (4) set -- "$args0" "$args1" "$args2" "$args3" ;; + (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules +function splitJvmOpts() { + JVM_OPTS=("$@") +} +eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS +JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" + +exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" diff --git a/gradlew.bat b/gradlew.bat new file mode 100644 index 0000000..5f19212 --- /dev/null +++ b/gradlew.bat @@ -0,0 +1,90 @@ +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS= + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto init + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto init + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:init +@rem Get command-line arguments, handling Windows variants + +if not "%OS%" == "Windows_NT" goto win9xME_args +if "%@eval[2+2]" == "4" goto 4NT_args + +:win9xME_args +@rem Slurp the command line arguments. +set CMD_LINE_ARGS= +set _SKIP=2 + +:win9xME_args_slurp +if "x%~1" == "x" goto execute + +set CMD_LINE_ARGS=%* +goto execute + +:4NT_args +@rem Get arguments from the 4NT Shell from JP Software +set CMD_LINE_ARGS=%$ + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/settings.gradle b/settings.gradle new file mode 100644 index 0000000..16f897d --- /dev/null +++ b/settings.gradle @@ -0,0 +1,19 @@ +/** + * Copyright (c) 2018 Aspose.Pdf for Cloud + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. +*/ +rootProject.name = "aspose-cloud-pdf" \ No newline at end of file diff --git a/setup.json b/setup.json new file mode 100644 index 0000000..1e58a38 --- /dev/null +++ b/setup.json @@ -0,0 +1,5 @@ +{ + "app_key" : "", + "app_sid" : "", + "product_uri" : "https://api-dev.aspose.cloud/v1.1" +} \ No newline at end of file diff --git a/src/main/AndroidManifest.xml b/src/main/AndroidManifest.xml new file mode 100644 index 0000000..c8e6111 --- /dev/null +++ b/src/main/AndroidManifest.xml @@ -0,0 +1,3 @@ + + + diff --git a/src/main/java/com/aspose/asposecloudpdf/ApiCallback.java b/src/main/java/com/aspose/asposecloudpdf/ApiCallback.java new file mode 100644 index 0000000..4d5cf98 --- /dev/null +++ b/src/main/java/com/aspose/asposecloudpdf/ApiCallback.java @@ -0,0 +1,71 @@ +/** + * + * Copyright (c) 2018 Aspose.Pdf for Cloud + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + */ + + +package com.aspose.asposecloudpdf; + +import java.io.IOException; + +import java.util.Map; +import java.util.List; + +/** + * Callback for asynchronous API call. + * + * @param The return type + */ +public interface ApiCallback { + /** + * This is called when the API call fails. + * + * @param e The exception causing the failure + * @param statusCode Status code of the response if available, otherwise it would be 0 + * @param responseHeaders Headers of the response if available, otherwise it would be null + */ + void onFailure(ApiException e, int statusCode, Map> responseHeaders); + + /** + * This is called when the API call succeeded. + * + * @param result The result deserialized from response + * @param statusCode Status code of the response + * @param responseHeaders Headers of the response + */ + void onSuccess(T result, int statusCode, Map> responseHeaders); + + /** + * This is called when the API upload processing. + * + * @param bytesWritten bytes Written + * @param contentLength content length of request body + * @param done write end + */ + void onUploadProgress(long bytesWritten, long contentLength, boolean done); + + /** + * This is called when the API downlond processing. + * + * @param bytesRead bytes Read + * @param contentLength content lenngth of the response + * @param done Read end + */ + void onDownloadProgress(long bytesRead, long contentLength, boolean done); +} diff --git a/src/main/java/com/aspose/asposecloudpdf/ApiClient.java b/src/main/java/com/aspose/asposecloudpdf/ApiClient.java new file mode 100644 index 0000000..ff3563a --- /dev/null +++ b/src/main/java/com/aspose/asposecloudpdf/ApiClient.java @@ -0,0 +1,1086 @@ +/** + * + * Copyright (c) 2018 Aspose.Pdf for Cloud + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + */ + + +package com.aspose.asposecloudpdf; + +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParser; +import com.squareup.okhttp.*; +import com.squareup.okhttp.internal.http.HttpMethod; +import com.squareup.okhttp.logging.HttpLoggingInterceptor; +import com.squareup.okhttp.logging.HttpLoggingInterceptor.Level; +import okio.BufferedSink; +import okio.Okio; +import org.threeten.bp.LocalDate; +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.format.DateTimeFormatter; + +import javax.net.ssl.*; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.io.UnsupportedEncodingException; +import java.lang.reflect.Field; +import java.lang.reflect.Method; +import java.lang.reflect.ParameterizedType; +import java.lang.reflect.Type; +import java.net.URLConnection; +import java.net.URLEncoder; +import java.security.GeneralSecurityException; +import java.security.KeyStore; +import java.security.SecureRandom; +import java.security.cert.Certificate; +import java.security.cert.CertificateException; +import java.security.cert.CertificateFactory; +import java.security.cert.X509Certificate; +import java.text.DateFormat; +import java.util.*; +import java.util.Map.Entry; +import java.util.concurrent.TimeUnit; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +public class ApiClient { + + private String basePath = "https://api.aspose.cloud/v1.1"; + private boolean debugging = false; + private Map defaultHeaderMap = new HashMap(); + private String tempFolderPath = null; + + private OkHttpClient httpClient; + private JSON json; + + private HttpLoggingInterceptor loggingInterceptor; + + private String accessToken; + private String refreshToken; + private String appKey; + private String appSid; + + /* + * Constructor for ApiClient + */ + public ApiClient() { + httpClient = new OkHttpClient(); + // PDFCLOUD-419 + httpClient.setProtocols(Arrays.asList(Protocol.HTTP_1_1)); + + + json = new JSON(); + + // Set default User-Agent. + setUserAgent("aspose pdf java sdk"); + + // PDFCLOUD-418 Set default Connect Timeout + setConnectTimeout(5 * 60 * 1000); + setReadTimeout(5 * 60 * 1000); + } + + /** + * Get App Key + * + * @return App Key + */ + public String getAppKey() + { + return appKey; + } + + /** + * Set App Key + * + * @param appKey App Key + */ + public void setAppKey(String appKey) + { + this.appKey = appKey; + } + + /** + * Get App Sid + * + * @return App Sid + */ + public String getAppSid() + { + return appSid; + } + + /** + * Set App Sid + * + * @param appSid App Sid + */ + public void setAppSid(String appSid) + { + this.appSid = appSid; + } + + + /** + * Get base path + * + * @return Base path + */ + public String getBasePath() { + return basePath; + } + + /** + * Set base path + * + * @param basePath Base path of the URL (e.g https://api.aspose.cloud/v1.1 + * @return An instance of OkHttpClient + */ + public ApiClient setBasePath(String basePath) { + this.basePath = basePath; + return this; + } + + /** + * Get HTTP client + * + * @return An instance of OkHttpClient + */ + public OkHttpClient getHttpClient() { + return httpClient; + } + + /** + * Set HTTP client + * + * @param httpClient An instance of OkHttpClient + * @return Api Client + */ + public ApiClient setHttpClient(OkHttpClient httpClient) { + this.httpClient = httpClient; + return this; + } + + /** + * Get JSON + * + * @return JSON object + */ + public JSON getJSON() { + return json; + } + + /** + * Set JSON + * + * @param json JSON object + * @return Api client + */ + public ApiClient setJSON(JSON json) { + this.json = json; + return this; + } + + public ApiClient setLenientOnJson(boolean lenientOnJson) { + this.json.setLenientOnJson(lenientOnJson); + return this; + } + + /** + * Set access token for the OAuth2 authentication. + * + * @param accessToken Access token + */ + public void setAccessToken(String accessToken) + { + this.accessToken = accessToken; + } + + /** + * Set refresh token for the OAuth2 authentication. + * + * @param refreshToken Access token + */ + public void setRefreshToken(String refreshToken) + { + this.refreshToken = refreshToken; + } + + /** + * Set the User-Agent header's value (by adding to the default header map). + * + * @param userAgent HTTP request's user agent + * @return ApiClient + */ + public ApiClient setUserAgent(String userAgent) { + addDefaultHeader("User-Agent", userAgent); + return this; + } + + /** + * Add a default header. + * + * @param key The header's key + * @param value The header's value + * @return ApiClient + */ + public ApiClient addDefaultHeader(String key, String value) { + defaultHeaderMap.put(key, value); + return this; + } + + /** + * Check that whether debugging is enabled for this API client. + * + * @return True if debugging is enabled, false otherwise. + */ + public boolean isDebugging() { + return debugging; + } + + /** + * Enable/disable debugging for this API client. + * + * @param debugging To enable (true) or disable (false) debugging + * @return ApiClient + */ + public ApiClient setDebugging(boolean debugging) { + if (debugging != this.debugging) { + if (debugging) { + loggingInterceptor = new HttpLoggingInterceptor(); + loggingInterceptor.setLevel(Level.BODY); + httpClient.interceptors().add(loggingInterceptor); + } else { + httpClient.interceptors().remove(loggingInterceptor); + loggingInterceptor = null; + } + } + this.debugging = debugging; + return this; + } + + /** + * The path of temporary folder used to store downloaded files from endpoints + * with file response. The default value is null, i.e. using + * the system's default tempopary folder. + * + * @see createTempFile + * @return Temporary folder path + */ + public String getTempFolderPath() { + return tempFolderPath; + } + + /** + * Set the temporary folder path (for downloading files) + * + * @param tempFolderPath Temporary folder path + * @return ApiClient + */ + public ApiClient setTempFolderPath(String tempFolderPath) { + this.tempFolderPath = tempFolderPath; + return this; + } + + /** + * Get connection timeout (in milliseconds). + * + * @return Timeout in milliseconds + */ + public int getConnectTimeout() { + return httpClient.getConnectTimeout(); + } + + /** + * Sets the connect timeout (in milliseconds). + * A value of 0 means no timeout, otherwise values must be between 1 and + * {@link Integer#MAX_VALUE}. + * + * @param connectionTimeout connection timeout in milliseconds + * @return Api client + */ + public ApiClient setConnectTimeout(int connectionTimeout) { + httpClient.setConnectTimeout(connectionTimeout, TimeUnit.MILLISECONDS); + return this; + } + + /** + * Get read timeout (in milliseconds). + * + * @return Timeout in milliseconds + */ + public int getReadTimeout() { + return httpClient.getReadTimeout(); + } + + /** + * Sets the read timeout (in milliseconds). + * A value of 0 means no timeout, otherwise values must be between 1 and + * {@link Integer#MAX_VALUE}. + * + * @param readTimeout read timeout in milliseconds + * @return Api client + */ + public ApiClient setReadTimeout(int readTimeout) { + httpClient.setReadTimeout(readTimeout, TimeUnit.MILLISECONDS); + return this; + } + + /** + * Get write timeout (in milliseconds). + * + * @return Timeout in milliseconds + */ + public int getWriteTimeout() { + return httpClient.getWriteTimeout(); + } + + /** + * Sets the write timeout (in milliseconds). + * A value of 0 means no timeout, otherwise values must be between 1 and + * {@link Integer#MAX_VALUE}. + * + * @param writeTimeout connection timeout in milliseconds + * @return Api client + */ + public ApiClient setWriteTimeout(int writeTimeout) { + httpClient.setWriteTimeout(writeTimeout, TimeUnit.MILLISECONDS); + return this; + } + + /** + * Format the given parameter object into string. + * + * @param param Parameter + * @return String representation of the parameter + */ + public String parameterToString(Object param) { + if (param == null) { + return ""; + } else if (param instanceof Date || param instanceof OffsetDateTime || param instanceof LocalDate) { + //Serialize to json string and remove the " enclosing characters + String jsonStr = json.serialize(param); + return jsonStr.substring(1, jsonStr.length() - 1); + } else if (param instanceof Collection) { + StringBuilder b = new StringBuilder(); + for (Object o : (Collection)param) { + if (b.length() > 0) { + b.append(","); + } + b.append(String.valueOf(o)); + } + return b.toString(); + } else { + return String.valueOf(param); + } + } + + /** + * Formats the specified query parameter to a list containing a single {@code Pair} object. + * + * Note that {@code value} must not be a collection. + * + * @param name The name of the parameter. + * @param value The value of the parameter. + * @return A list containing a single {@code Pair} object. + */ + public List parameterToPair(String name, Object value) { + List params = new ArrayList(); + + // preconditions + if (name == null || name.isEmpty() || value == null || value instanceof Collection) return params; + + params.add(new Pair(name, parameterToString(value))); + return params; + } + + /** + * Formats the specified collection query parameters to a list of {@code Pair} objects. + * + * Note that the values of each of the returned Pair objects are percent-encoded. + * + * @param collectionFormat The collection format of the parameter. + * @param name The name of the parameter. + * @param value The value of the parameter. + * @return A list of {@code Pair} objects. + */ + public List parameterToPairs(String collectionFormat, String name, Collection value) { + List params = new ArrayList(); + + // preconditions + if (name == null || name.isEmpty() || value == null || value.isEmpty()) { + return params; + } + + // create the params based on the collection format + if ("multi".equals(collectionFormat)) { + for (Object item : value) { + params.add(new Pair(name, escapeString(parameterToString(item)))); + } + return params; + } + + // collectionFormat is assumed to be "csv" by default + String delimiter = ","; + + // escape all delimiters except commas, which are URI reserved + // characters + if ("ssv".equals(collectionFormat)) { + delimiter = escapeString(" "); + } else if ("tsv".equals(collectionFormat)) { + delimiter = escapeString("\t"); + } else if ("pipes".equals(collectionFormat)) { + delimiter = escapeString("|"); + } + + StringBuilder sb = new StringBuilder() ; + for (Object item : value) { + sb.append(delimiter); + sb.append(escapeString(parameterToString(item))); + } + + params.add(new Pair(name, sb.substring(delimiter.length()))); + + return params; + } + + /** + * Sanitize filename by removing path. + * e.g. ../../sun.gif becomes sun.gif + * + * @param filename The filename to be sanitized + * @return The sanitized filename + */ + public String sanitizeFilename(String filename) { + return filename.replaceAll(".*[/\\\\]", ""); + } + + /** + * Check if the given MIME is a JSON MIME. + * JSON MIME examples: + * application/json + * application/json; charset=UTF8 + * APPLICATION/JSON + * application/vnd.company+json + * "* / *" is also default to JSON + * @param mime MIME (Multipurpose Internet Mail Extensions) + * @return True if the given MIME is JSON, false otherwise. + */ + public boolean isJsonMime(String mime) { + String jsonMime = "(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"; + return mime != null && (mime.matches(jsonMime) || mime.equals("*/*")); + } + + /** + * Select the Accept header's value from the given accepts array: + * if JSON exists in the given array, use it; + * otherwise use all of them (joining into a string) + * + * @param accepts The accepts array to select from + * @return The Accept header to use. If the given array is empty, + * null will be returned (not to set the Accept header explicitly). + */ + public String selectHeaderAccept(String[] accepts) { + if (accepts.length == 0) { + return null; + } + for (String accept : accepts) { + if (isJsonMime(accept)) { + return accept; + } + } + return StringUtil.join(accepts, ","); + } + + /** + * Select the Content-Type header's value from the given array: + * if JSON exists in the given array, use it; + * otherwise use the first one of the array. + * + * @param contentTypes The Content-Type array to select from + * @return The Content-Type header to use. If the given array is empty, + * or matches "any", JSON will be used. + */ + public String selectHeaderContentType(String[] contentTypes) { + if (contentTypes.length == 0 || contentTypes[0].equals("*/*")) { + return "application/json"; + } + for (String contentType : contentTypes) { + if (isJsonMime(contentType)) { + return contentType; + } + } + return contentTypes[0]; + } + + /** + * Escape the given string to be used as URL query value. + * + * @param str String to be escaped + * @return Escaped string + */ + public String escapeString(String str) { + try { + return URLEncoder.encode(str, "utf8").replaceAll("\\+", "%20"); + } catch (UnsupportedEncodingException e) { + return str; + } + } + + /** + * Deserialize response body to Java object, according to the return type and + * the Content-Type response header. + * + * @param Type + * @param response HTTP response + * @param returnType The type of the Java object + * @return The deserialized Java object + * @throws ApiException If fail to deserialize response body, i.e. cannot read response body + * or the Content-Type of the response is not supported. + */ + @SuppressWarnings("unchecked") + public T deserialize(Response response, Type returnType) throws ApiException { + if (response == null || returnType == null) { + return null; + } + + if ("byte[]".equals(returnType.toString())) { + // Handle binary response (byte array). + try { + return (T) response.body().bytes(); + } catch (IOException e) { + throw new ApiException(e); + } + } else if (returnType.equals(File.class)) { + // Handle file downloading. + return (T) downloadFileFromResponse(response); + } + + String respBody; + try { + if (response.body() != null) + respBody = response.body().string(); + else + respBody = null; + } catch (IOException e) { + throw new ApiException(e); + } + + if (respBody == null || "".equals(respBody)) { + return null; + } + + String contentType = response.headers().get("Content-Type"); + if (contentType == null) { + // ensuring a default content type + contentType = "application/json"; + } + if (isJsonMime(contentType)) { + return json.deserialize(respBody, returnType); + } else if (returnType.equals(String.class)) { + // Expecting string, return the raw response body. + return (T) respBody; + } else { + throw new ApiException( + "Content type \"" + contentType + "\" is not supported for type: " + returnType, + response.code(), + response.headers().toMultimap(), + respBody); + } + } + + /** + * Serialize the given Java object into request body according to the object's + * class and the request Content-Type. + * + * @param obj The Java object + * @param contentType The request Content-Type + * @return The serialized request body + * @throws ApiException If fail to serialize the given object + */ + public RequestBody serialize(Object obj, String contentType) throws ApiException { + if (obj instanceof byte[]) { + // Binary (byte array) body parameter support. + return RequestBody.create(MediaType.parse(contentType), (byte[]) obj); + } else if (obj instanceof File) { + // File body parameter support. + return RequestBody.create(MediaType.parse(contentType), (File) obj); + } else if (isJsonMime(contentType)) { + String content; + if (obj != null) { + content = json.serialize(obj); + } else { + content = null; + } + return RequestBody.create(MediaType.parse(contentType), content); + } else { + throw new ApiException("Content type \"" + contentType + "\" is not supported"); + } + } + + /** + * Download file from the given response. + * + * @param response An instance of the Response object + * @throws ApiException If fail to read file content from response and write to disk + * @return Downloaded file + */ + public File downloadFileFromResponse(Response response) throws ApiException { + try { + File file = prepareDownloadFile(response); + BufferedSink sink = Okio.buffer(Okio.sink(file)); + sink.writeAll(response.body().source()); + sink.close(); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + * Prepare file for download + * + * @param response An instance of the Response object + * @throws IOException If fail to prepare file for download + * @return Prepared file for the download + */ + public File prepareDownloadFile(Response response) throws IOException { + String filename = null; + String contentDisposition = response.header("Content-Disposition"); + if (contentDisposition != null && !"".equals(contentDisposition)) { + // Get filename from the Content-Disposition header. + Pattern pattern = Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + Matcher matcher = pattern.matcher(contentDisposition); + if (matcher.find()) { + filename = sanitizeFilename(matcher.group(1)); + } + } + + String prefix = null; + String suffix = null; + if (filename == null) { + prefix = "download-"; + suffix = ""; + } else { + int pos = filename.lastIndexOf("."); + if (pos == -1) { + prefix = filename + "-"; + } else { + prefix = filename.substring(0, pos) + "-"; + suffix = filename.substring(pos); + } + // File.createTempFile requires the prefix to be at least three characters long + if (prefix.length() < 3) + prefix = "download-"; + } + + if (tempFolderPath == null) + return File.createTempFile(prefix, suffix); + else + return File.createTempFile(prefix, suffix, new File(tempFolderPath)); + } + + /** + * {@link #execute(Call, Type)} + * + * @param Type + * @param call An instance of the Call object + * @throws ApiException If fail to execute the call + * @return ApiResponse<T> + */ + public ApiResponse execute(Call call) throws ApiException { + return execute(call, null); + } + + /** + * Execute HTTP call and deserialize the HTTP response body into the given return type. + * + * @param returnType The return type used to deserialize HTTP response body + * @param The return type corresponding to (same with) returnType + * @param call Call + * @return ApiResponse object containing response status, headers and + * data, which is a Java object deserialized from response body and would be null + * when returnType is null. + * @throws ApiException If fail to execute the call + */ + public ApiResponse execute(Call call, Type returnType) throws ApiException { + try { + Response response = call.execute(); + T data = handleResponse(response, returnType); + return new ApiResponse(response.code(), response.headers().toMultimap(), data); + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + * {@link #executeAsync(Call, Type, ApiCallback)} + * + * @param Type + * @param call An instance of the Call object + * @param callback ApiCallback<T> + */ + public void executeAsync(Call call, ApiCallback callback) { + executeAsync(call, null, callback); + } + + /** + * Execute HTTP call asynchronously. + * + * @see #execute(Call, Type) + * @param Type + * @param call The callback to be executed when the API call finishes + * @param returnType Return type + * @param callback ApiCallback + */ + @SuppressWarnings("unchecked") + public void executeAsync(Call call, final Type returnType, final ApiCallback callback) { + call.enqueue(new Callback() { + @Override + public void onFailure(Request request, IOException e) { + callback.onFailure(new ApiException(e), 0, null); + } + + @Override + public void onResponse(Response response) throws IOException { + T result; + try { + result = (T) handleResponse(response, returnType); + } catch (ApiException e) { + callback.onFailure(e, response.code(), response.headers().toMultimap()); + return; + } + callback.onSuccess(result, response.code(), response.headers().toMultimap()); + } + }); + } + + /** + * Handle the given response, return the deserialized object when the response is successful. + * + * @param Type + * @param response Response + * @param returnType Return type + * @throws ApiException If the response has a unsuccessful status code or + * fail to deserialize the response body + * @return Type + */ + public T handleResponse(Response response, Type returnType) throws ApiException { + if (response.isSuccessful()) { + if (returnType == null || response.code() == 204) { + // returning null if the returnType is not defined, + // or the status code is 204 (No Content) + if (response.body() != null) { + try { + response.body().close(); + } catch (IOException e) { + throw new ApiException(response.message(), e, response.code(), response.headers().toMultimap()); + } + } + return null; + } else { + return deserialize(response, returnType); + } + } else { + String respBody = null; + if (response.body() != null) { + try { + respBody = response.body().string(); + } catch (IOException e) { + throw new ApiException(response.message(), e, response.code(), response.headers().toMultimap()); + } + } + throw new ApiException(response.message(), response.code(), response.headers().toMultimap(), respBody); + } + } + + /** + * Build HTTP call with the given options. + * + * @param path The sub-path of the HTTP URL + * @param method The request method, one of "GET", "HEAD", "OPTIONS", "POST", "PUT", "PATCH" and "DELETE" + * @param queryParams The query parameters + * @param collectionQueryParams The collection query parameters + * @param body The request body object + * @param headerParams The header parameters + * @param formParams The form parameters + * @param authNames The authentications to apply + * @param progressRequestListener Progress request listener + * @return The HTTP call + * @throws ApiException If fail to serialize the request body object + */ + public Call buildCall(String path, String method, List queryParams, List collectionQueryParams, Object body, Map headerParams, Map formParams, String[] authNames, ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Request request = buildRequest(path, method, queryParams, collectionQueryParams, body, headerParams, formParams, authNames, progressRequestListener); + + return httpClient.newCall(request); + } + + /** + * Build an HTTP request with the given options. + * + * @param path The sub-path of the HTTP URL + * @param method The request method, one of "GET", "HEAD", "OPTIONS", "POST", "PUT", "PATCH" and "DELETE" + * @param queryParams The query parameters + * @param collectionQueryParams The collection query parameters + * @param body The request body object + * @param headerParams The header parameters + * @param formParams The form parameters + * @param authNames The authentications to apply + * @param progressRequestListener Progress request listener + * @return The HTTP request + * @throws ApiException If fail to serialize the request body object + */ + public Request buildRequest(String path, String method, List queryParams, List collectionQueryParams, Object body, Map headerParams, Map formParams, String[] authNames, ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + addOAuthAuthentication(headerParams); + final String url = buildUrl(path, queryParams, collectionQueryParams); + final Request.Builder reqBuilder = new Request.Builder().url(url); + processHeaderParams(headerParams, reqBuilder); + + String contentType = (String) headerParams.get("Content-Type"); + // ensuring a default content type + if (contentType == null) { + contentType = "application/json"; + } + + RequestBody reqBody; + if (!HttpMethod.permitsRequestBody(method)) { + reqBody = null; + } else if ("application/x-www-form-urlencoded".equals(contentType)) { + reqBody = buildRequestBodyFormEncoding(formParams); + } else if ("multipart/form-data".equals(contentType)) { + reqBody = buildRequestBodyMultipart(formParams); + } else if (body == null) { + if ("DELETE".equals(method)) { + // allow calling DELETE without sending a request body + reqBody = null; + } else { + // use an empty request body (for POST, PUT and PATCH) + reqBody = RequestBody.create(MediaType.parse(contentType), ""); + } + } else { + reqBody = serialize(body, contentType); + } + + Request request = null; + + if(progressRequestListener != null && reqBody != null) { + ProgressRequestBody progressRequestBody = new ProgressRequestBody(reqBody, progressRequestListener); + request = reqBuilder.method(method, progressRequestBody).build(); + } else { + request = reqBuilder.method(method, reqBody).build(); + } + + return request; + } + + /** + * Build full URL by concatenating base path, the given sub path and query parameters. + * + * @param path The sub path + * @param queryParams The query parameters + * @param collectionQueryParams The collection query parameters + * @return The full URL + */ + public String buildUrl(String path, List queryParams, List collectionQueryParams) { + final StringBuilder url = new StringBuilder(); + url.append(basePath).append(path); + + if (queryParams != null && !queryParams.isEmpty()) { + // support (constant) query string in `path`, e.g. "/posts?draft=1" + String prefix = path.contains("?") ? "&" : "?"; + for (Pair param : queryParams) { + if (param.getValue() != null) { + if (prefix != null) { + url.append(prefix); + prefix = null; + } else { + url.append("&"); + } + String value = parameterToString(param.getValue()); + url.append(escapeString(param.getName())).append("=").append(escapeString(value)); + } + } + } + + if (collectionQueryParams != null && !collectionQueryParams.isEmpty()) { + String prefix = url.toString().contains("?") ? "&" : "?"; + for (Pair param : collectionQueryParams) { + if (param.getValue() != null) { + if (prefix != null) { + url.append(prefix); + prefix = null; + } else { + url.append("&"); + } + String value = parameterToString(param.getValue()); + // collection query parameter value already escaped as part of parameterToPairs + url.append(escapeString(param.getName())).append("=").append(value); + } + } + } + + return url.toString(); + } + + /** + * Set header parameters to the request builder, including default headers. + * + * @param headerParams Header parameters in the ofrm of Map + * @param reqBuilder Reqeust.Builder + */ + public void processHeaderParams(Map headerParams, Request.Builder reqBuilder) { + for (Entry param : headerParams.entrySet()) { + reqBuilder.header(param.getKey(), parameterToString(param.getValue())); + } + for (Entry header : defaultHeaderMap.entrySet()) { + if (!headerParams.containsKey(header.getKey())) { + reqBuilder.header(header.getKey(), parameterToString(header.getValue())); + } + } + } + + /** + * Build a form-encoding request body with the given form parameters. + * + * @param formParams Form parameters in the form of Map + * @return RequestBody + */ + public RequestBody buildRequestBodyFormEncoding(Map formParams) { + FormEncodingBuilder formBuilder = new FormEncodingBuilder(); + for (Entry param : formParams.entrySet()) { + formBuilder.add(param.getKey(), parameterToString(param.getValue())); + } + return formBuilder.build(); + } + + /** + * Build a multipart (file uploading) request body with the given form parameters, + * which could contain text fields and file fields. + * + * @param formParams Form parameters in the form of Map + * @return RequestBody + */ + public RequestBody buildRequestBodyMultipart(Map formParams) { + MultipartBuilder mpBuilder = new MultipartBuilder().type(MultipartBuilder.FORM); + for (Entry param : formParams.entrySet()) { + if (param.getValue() instanceof File) { + File file = (File) param.getValue(); + Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + param.getKey() + "\"; filename=\"" + file.getName() + "\""); + MediaType mediaType = MediaType.parse(guessContentTypeFromFile(file)); + mpBuilder.addPart(partHeaders, RequestBody.create(mediaType, file)); + } else { + Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + param.getKey() + "\""); + mpBuilder.addPart(partHeaders, RequestBody.create(null, parameterToString(param.getValue()))); + } + } + return mpBuilder.build(); + } + + /** + * Guess Content-Type header from the given file (defaults to "application/octet-stream"). + * + * @param file The given file + * @return The guessed Content-Type + */ + public String guessContentTypeFromFile(File file) { + String contentType = URLConnection.guessContentTypeFromName(file.getName()); + if (contentType == null) { + return "application/octet-stream"; + } else { + return contentType; + } + } + + /** + * Request OAuth token + */ + private void requestToken() throws IOException + { + RequestBody requestBody = new FormEncodingBuilder() + .addEncoded("grant_type", "client_credentials") + .addEncoded("client_id", getAppSid()) + .addEncoded("client_secret", getAppKey()) + .build(); + + String url = basePath.replace("/v1.1", "") + "/oauth2/token"; + Request request = new Request.Builder() + .url(url) + .post(requestBody) + .addHeader("Content-Type", " application/x-www-form-urlencoded") + .build(); + + Response response = httpClient.newCall(request).execute(); + GetAccessTokenResult result = json.deserialize(response.body().string(), GetAccessTokenResult.class); + setAccessToken(result.access_token); + setRefreshToken(result.refresh_token); + } + + /** + * Refresh OAuth token + */ + private void refreshToken() throws IOException + { + RequestBody requestBody = new FormEncodingBuilder() + .addEncoded("grant_type", "refresh_token") + .addEncoded("refresh_token", this.refreshToken) + .build(); + + String url = basePath.replace("/v1.1", "") + "/oauth2/token"; + Request request = new Request.Builder() + .url(url) + .post(requestBody) + .addHeader("Content-Type", " application/x-www-form-urlencoded") + .build(); + + Response response = httpClient.newCall(request).execute(); + GetAccessTokenResult result = json.deserialize(response.body().string(), GetAccessTokenResult.class); + setAccessToken(result.access_token); + setRefreshToken(result.refresh_token); + } + + + /** + * Add OAuth2 header + * + * @param headerParams Map of request headers + */ + private void addOAuthAuthentication(Map headerParams) throws ApiException + { + try { + if (null == accessToken) { + requestToken(); + } + headerParams.put("Authorization", "Bearer " + accessToken); + } + catch (IOException ex) + { + throw new ApiException(ex); + } + } + + + /** + * GetAccessTokenResult class + */ + private class GetAccessTokenResult + { + public String access_token; + public String refresh_token; + } +} diff --git a/src/main/java/com/aspose/asposecloudpdf/ApiException.java b/src/main/java/com/aspose/asposecloudpdf/ApiException.java new file mode 100644 index 0000000..ed8bc28 --- /dev/null +++ b/src/main/java/com/aspose/asposecloudpdf/ApiException.java @@ -0,0 +1,100 @@ +/** + * + * Copyright (c) 2018 Aspose.Pdf for Cloud + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + */ + + +package com.aspose.asposecloudpdf; + +import java.util.Map; +import java.util.List; + + +public class ApiException extends Exception { + private int code = 0; + private Map> responseHeaders = null; + private String responseBody = null; + + public ApiException() {} + + public ApiException(Throwable throwable) { + super(throwable); + } + + public ApiException(String message) { + super(message); + } + + public ApiException(String message, Throwable throwable, int code, Map> responseHeaders, String responseBody) { + super(message, throwable); + this.code = code; + this.responseHeaders = responseHeaders; + this.responseBody = responseBody; + } + + public ApiException(String message, int code, Map> responseHeaders, String responseBody) { + this(message, (Throwable) null, code, responseHeaders, responseBody); + } + + public ApiException(String message, Throwable throwable, int code, Map> responseHeaders) { + this(message, throwable, code, responseHeaders, null); + } + + public ApiException(int code, Map> responseHeaders, String responseBody) { + this((String) null, (Throwable) null, code, responseHeaders, responseBody); + } + + public ApiException(int code, String message) { + super(message); + this.code = code; + } + + public ApiException(int code, String message, Map> responseHeaders, String responseBody) { + this(code, message); + this.responseHeaders = responseHeaders; + this.responseBody = responseBody; + } + + /** + * Get the HTTP status code. + * + * @return HTTP status code + */ + public int getCode() { + return code; + } + + /** + * Get the HTTP response headers. + * + * @return A map of list of string + */ + public Map> getResponseHeaders() { + return responseHeaders; + } + + /** + * Get the HTTP response body. + * + * @return Response body in the form of string + */ + public String getResponseBody() { + return responseBody; + } +} diff --git a/src/main/java/com/aspose/asposecloudpdf/ApiResponse.java b/src/main/java/com/aspose/asposecloudpdf/ApiResponse.java new file mode 100644 index 0000000..eda417a --- /dev/null +++ b/src/main/java/com/aspose/asposecloudpdf/ApiResponse.java @@ -0,0 +1,68 @@ +/** + * + * Copyright (c) 2018 Aspose.Pdf for Cloud + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + */ + + +package com.aspose.asposecloudpdf; + +import java.util.List; +import java.util.Map; + +/** + * API response returned by API call. + * + * @param The type of data that is deserialized from response body + */ +public class ApiResponse { + final private int statusCode; + final private Map> headers; + final private T data; + + /** + * @param statusCode The status code of HTTP response + * @param headers The headers of HTTP response + */ + public ApiResponse(int statusCode, Map> headers) { + this(statusCode, headers, null); + } + + /** + * @param statusCode The status code of HTTP response + * @param headers The headers of HTTP response + * @param data The object deserialized from response bod + */ + public ApiResponse(int statusCode, Map> headers, T data) { + this.statusCode = statusCode; + this.headers = headers; + this.data = data; + } + + public int getStatusCode() { + return statusCode; + } + + public Map> getHeaders() { + return headers; + } + + public T getData() { + return data; + } +} diff --git a/src/main/java/com/aspose/asposecloudpdf/Configuration.java b/src/main/java/com/aspose/asposecloudpdf/Configuration.java new file mode 100644 index 0000000..7c3cd11 --- /dev/null +++ b/src/main/java/com/aspose/asposecloudpdf/Configuration.java @@ -0,0 +1,48 @@ +/** + * + * Copyright (c) 2018 Aspose.Pdf for Cloud + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + */ + + +package com.aspose.asposecloudpdf; + + +public class Configuration { + private static ApiClient defaultApiClient = new ApiClient(); + + /** + * Get the default API client, which would be used when creating API + * instances without providing an API client. + * + * @return Default API client + */ + public static ApiClient getDefaultApiClient() { + return defaultApiClient; + } + + /** + * Set the default API client, which would be used when creating API + * instances without providing an API client. + * + * @param apiClient API client + */ + public static void setDefaultApiClient(ApiClient apiClient) { + defaultApiClient = apiClient; + } +} diff --git a/src/main/java/com/aspose/asposecloudpdf/GzipRequestInterceptor.java b/src/main/java/com/aspose/asposecloudpdf/GzipRequestInterceptor.java new file mode 100644 index 0000000..8d21e3a --- /dev/null +++ b/src/main/java/com/aspose/asposecloudpdf/GzipRequestInterceptor.java @@ -0,0 +1,90 @@ +/** + * + * Copyright (c) 2018 Aspose.Pdf for Cloud + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + */ + + +package com.aspose.asposecloudpdf; + +import com.squareup.okhttp.*; +import okio.Buffer; +import okio.BufferedSink; +import okio.GzipSink; +import okio.Okio; + +import java.io.IOException; + +/** + * Encodes request bodies using gzip. + * + * Taken from https://github.com/square/okhttp/issues/350 + */ +class GzipRequestInterceptor implements Interceptor { + @Override public Response intercept(Chain chain) throws IOException { + Request originalRequest = chain.request(); + if (originalRequest.body() == null || originalRequest.header("Content-Encoding") != null) { + return chain.proceed(originalRequest); + } + + Request compressedRequest = originalRequest.newBuilder() + .header("Content-Encoding", "gzip") + .method(originalRequest.method(), forceContentLength(gzip(originalRequest.body()))) + .build(); + return chain.proceed(compressedRequest); + } + + private RequestBody forceContentLength(final RequestBody requestBody) throws IOException { + final Buffer buffer = new Buffer(); + requestBody.writeTo(buffer); + return new RequestBody() { + @Override + public MediaType contentType() { + return requestBody.contentType(); + } + + @Override + public long contentLength() { + return buffer.size(); + } + + @Override + public void writeTo(BufferedSink sink) throws IOException { + sink.write(buffer.snapshot()); + } + }; + } + + private RequestBody gzip(final RequestBody body) { + return new RequestBody() { + @Override public MediaType contentType() { + return body.contentType(); + } + + @Override public long contentLength() { + return -1; // We don't know the compressed length in advance! + } + + @Override public void writeTo(BufferedSink sink) throws IOException { + BufferedSink gzipSink = Okio.buffer(new GzipSink(sink)); + body.writeTo(gzipSink); + gzipSink.close(); + } + }; + } +} \ No newline at end of file diff --git a/src/main/java/com/aspose/asposecloudpdf/JSON.java b/src/main/java/com/aspose/asposecloudpdf/JSON.java new file mode 100644 index 0000000..bc2d468 --- /dev/null +++ b/src/main/java/com/aspose/asposecloudpdf/JSON.java @@ -0,0 +1,370 @@ +/** + * + * Copyright (c) 2018 Aspose.Pdf for Cloud + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + */ + + +package com.aspose.asposecloudpdf; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.internal.bind.util.ISO8601Utils; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonElement; +import io.gsonfire.GsonFireBuilder; +import io.gsonfire.TypeSelector; +import org.threeten.bp.LocalDate; +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.format.DateTimeFormatter; + +import com.aspose.asposecloudpdf.model.*; + +import java.io.IOException; +import java.io.StringReader; +import java.lang.reflect.Type; +import java.text.DateFormat; +import java.text.ParseException; +import java.text.ParsePosition; +import java.util.Date; +import java.util.Map; +import java.util.HashMap; + +public class JSON { + private Gson gson; + private boolean isLenientOnJson = false; + private DateTypeAdapter dateTypeAdapter = new DateTypeAdapter(); + private SqlDateTypeAdapter sqlDateTypeAdapter = new SqlDateTypeAdapter(); + private OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = new OffsetDateTimeTypeAdapter(); + private LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter(); + + public static GsonBuilder createGson() { + GsonFireBuilder fireBuilder = new GsonFireBuilder(); + return fireBuilder.createGsonBuilder(); + } + + private static String getDiscriminatorValue(JsonElement readElement, String discriminatorField) { + JsonElement element = readElement.getAsJsonObject().get(discriminatorField); + if(null == element) { + throw new IllegalArgumentException("missing discriminator field: <" + discriminatorField + ">"); + } + return element.getAsString(); + } + + private static Class getClassByDiscriminator(Map classByDiscriminatorValue, String discriminatorValue) { + Class clazz = (Class) classByDiscriminatorValue.get(discriminatorValue.toUpperCase()); + if(null == clazz) { + throw new IllegalArgumentException("cannot determine model class of name: <" + discriminatorValue + ">"); + } + return clazz; + } + + public JSON() { + gson = createGson() + .registerTypeAdapter(Date.class, dateTypeAdapter) + .registerTypeAdapter(java.sql.Date.class, sqlDateTypeAdapter) + .registerTypeAdapter(OffsetDateTime.class, offsetDateTimeTypeAdapter) + .registerTypeAdapter(LocalDate.class, localDateTypeAdapter) + .create(); + } + + /** + * Get Gson. + * + * @return Gson + */ + public Gson getGson() { + return gson; + } + + /** + * Set Gson. + * + * @param gson Gson + * @return JSON + */ + public JSON setGson(Gson gson) { + this.gson = gson; + return this; + } + + public JSON setLenientOnJson(boolean lenientOnJson) { + isLenientOnJson = lenientOnJson; + return this; + } + + /** + * Serialize the given Java object into JSON string. + * + * @param obj Object + * @return String representation of the JSON + */ + public String serialize(Object obj) { + return gson.toJson(obj); + } + + /** + * Deserialize the given JSON string to Java object. + * + * @param Type + * @param body The JSON string + * @param returnType The type to deserialize into + * @return The deserialized Java object + */ + @SuppressWarnings("unchecked") + public T deserialize(String body, Type returnType) { + try { + if (isLenientOnJson) { + JsonReader jsonReader = new JsonReader(new StringReader(body)); + // see https://google-gson.googlecode.com/svn/trunk/gson/docs/javadocs/com/google/gson/stream/JsonReader.html#setLenient(boolean) + jsonReader.setLenient(true); + return gson.fromJson(jsonReader, returnType); + } else { + return gson.fromJson(body, returnType); + } + } catch (JsonParseException e) { + // Fallback processing when failed to parse JSON form response body: + // return the response body string directly for the String return type; + if (returnType.equals(String.class)) + return (T) body; + else throw (e); + } + } + + /** + * Gson TypeAdapter for JSR310 OffsetDateTime type + */ + public static class OffsetDateTimeTypeAdapter extends TypeAdapter { + + private DateTimeFormatter formatter; + + public OffsetDateTimeTypeAdapter() { + this(DateTimeFormatter.ISO_OFFSET_DATE_TIME); + } + + public OffsetDateTimeTypeAdapter(DateTimeFormatter formatter) { + this.formatter = formatter; + } + + public void setFormat(DateTimeFormatter dateFormat) { + this.formatter = dateFormat; + } + + @Override + public void write(JsonWriter out, OffsetDateTime date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + out.value(formatter.format(date)); + } + } + + @Override + public OffsetDateTime read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + if (date.endsWith("+0000")) { + date = date.substring(0, date.length()-5) + "Z"; + } + return OffsetDateTime.parse(date, formatter); + } + } + } + + /** + * Gson TypeAdapter for JSR310 LocalDate type + */ + public class LocalDateTypeAdapter extends TypeAdapter { + + private DateTimeFormatter formatter; + + public LocalDateTypeAdapter() { + this(DateTimeFormatter.ISO_LOCAL_DATE); + } + + public LocalDateTypeAdapter(DateTimeFormatter formatter) { + this.formatter = formatter; + } + + public void setFormat(DateTimeFormatter dateFormat) { + this.formatter = dateFormat; + } + + @Override + public void write(JsonWriter out, LocalDate date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + out.value(formatter.format(date)); + } + } + + @Override + public LocalDate read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + return LocalDate.parse(date, formatter); + } + } + } + + public JSON setOffsetDateTimeFormat(DateTimeFormatter dateFormat) { + offsetDateTimeTypeAdapter.setFormat(dateFormat); + return this; + } + + public JSON setLocalDateFormat(DateTimeFormatter dateFormat) { + localDateTypeAdapter.setFormat(dateFormat); + return this; + } + + /** + * Gson TypeAdapter for java.sql.Date type + * If the dateFormat is null, a simple "yyyy-MM-dd" format will be used + * (more efficient than SimpleDateFormat). + */ + public static class SqlDateTypeAdapter extends TypeAdapter { + + private DateFormat dateFormat; + + public SqlDateTypeAdapter() { + } + + public SqlDateTypeAdapter(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + public void setFormat(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + @Override + public void write(JsonWriter out, java.sql.Date date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + String value; + if (dateFormat != null) { + value = dateFormat.format(date); + } else { + value = date.toString(); + } + out.value(value); + } + } + + @Override + public java.sql.Date read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + try { + if (dateFormat != null) { + return new java.sql.Date(dateFormat.parse(date).getTime()); + } + return new java.sql.Date(ISO8601Utils.parse(date, new ParsePosition(0)).getTime()); + } catch (ParseException e) { + throw new JsonParseException(e); + } + } + } + } + + /** + * Gson TypeAdapter for java.util.Date type + * If the dateFormat is null, ISO8601Utils will be used. + */ + public static class DateTypeAdapter extends TypeAdapter { + + private DateFormat dateFormat; + + public DateTypeAdapter() { + } + + public DateTypeAdapter(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + public void setFormat(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + @Override + public void write(JsonWriter out, Date date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + String value; + if (dateFormat != null) { + value = dateFormat.format(date); + } else { + value = ISO8601Utils.format(date, true); + } + out.value(value); + } + } + + @Override + public Date read(JsonReader in) throws IOException { + try { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + try { + if (dateFormat != null) { + return dateFormat.parse(date); + } + return ISO8601Utils.parse(date, new ParsePosition(0)); + } catch (ParseException e) { + throw new JsonParseException(e); + } + } + } catch (IllegalArgumentException e) { + throw new JsonParseException(e); + } + } + } + + public JSON setDateFormat(DateFormat dateFormat) { + dateTypeAdapter.setFormat(dateFormat); + return this; + } + + public JSON setSqlDateFormat(DateFormat dateFormat) { + sqlDateTypeAdapter.setFormat(dateFormat); + return this; + } + +} diff --git a/src/main/java/com/aspose/asposecloudpdf/Pair.java b/src/main/java/com/aspose/asposecloudpdf/Pair.java new file mode 100644 index 0000000..fadad61 --- /dev/null +++ b/src/main/java/com/aspose/asposecloudpdf/Pair.java @@ -0,0 +1,61 @@ +/** + * + * Copyright (c) 2018 Aspose.Pdf for Cloud + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + */ + + +package com.aspose.asposecloudpdf; + + +public class Pair { + private String name = ""; + private String value = ""; + + public Pair (String name, String value) { + setName(name); + setValue(value); + } + + private void setName(String name) { + if (!isValidString(name)) return; + + this.name = name; + } + + private void setValue(String value) { + if (!isValidString(value)) return; + + this.value = value; + } + + public String getName() { + return this.name; + } + + public String getValue() { + return this.value; + } + + private boolean isValidString(String arg) { + if (arg == null) return false; + if (arg.trim().isEmpty()) return false; + + return true; + } +} diff --git a/src/main/java/com/aspose/asposecloudpdf/ProgressRequestBody.java b/src/main/java/com/aspose/asposecloudpdf/ProgressRequestBody.java new file mode 100644 index 0000000..44e8992 --- /dev/null +++ b/src/main/java/com/aspose/asposecloudpdf/ProgressRequestBody.java @@ -0,0 +1,86 @@ +/** + * + * Copyright (c) 2018 Aspose.Pdf for Cloud + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + */ + + +package com.aspose.asposecloudpdf; + +import com.squareup.okhttp.MediaType; +import com.squareup.okhttp.RequestBody; + +import java.io.IOException; + +import okio.Buffer; +import okio.BufferedSink; +import okio.ForwardingSink; +import okio.Okio; +import okio.Sink; + +public class ProgressRequestBody extends RequestBody { + + public interface ProgressRequestListener { + void onRequestProgress(long bytesWritten, long contentLength, boolean done); + } + + private final RequestBody requestBody; + + private final ProgressRequestListener progressListener; + + public ProgressRequestBody(RequestBody requestBody, ProgressRequestListener progressListener) { + this.requestBody = requestBody; + this.progressListener = progressListener; + } + + @Override + public MediaType contentType() { + return requestBody.contentType(); + } + + @Override + public long contentLength() throws IOException { + return requestBody.contentLength(); + } + + @Override + public void writeTo(BufferedSink sink) throws IOException { + BufferedSink bufferedSink = Okio.buffer(sink(sink)); + requestBody.writeTo(bufferedSink); + bufferedSink.flush(); + } + + private Sink sink(Sink sink) { + return new ForwardingSink(sink) { + + long bytesWritten = 0L; + long contentLength = 0L; + + @Override + public void write(Buffer source, long byteCount) throws IOException { + super.write(source, byteCount); + if (contentLength == 0) { + contentLength = contentLength(); + } + + bytesWritten += byteCount; + progressListener.onRequestProgress(bytesWritten, contentLength, bytesWritten == contentLength); + } + }; + } +} diff --git a/src/main/java/com/aspose/asposecloudpdf/ProgressResponseBody.java b/src/main/java/com/aspose/asposecloudpdf/ProgressResponseBody.java new file mode 100644 index 0000000..6882140 --- /dev/null +++ b/src/main/java/com/aspose/asposecloudpdf/ProgressResponseBody.java @@ -0,0 +1,85 @@ +/** + * + * Copyright (c) 2018 Aspose.Pdf for Cloud + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + */ + + +package com.aspose.asposecloudpdf; + +import com.squareup.okhttp.MediaType; +import com.squareup.okhttp.ResponseBody; + +import java.io.IOException; + +import okio.Buffer; +import okio.BufferedSource; +import okio.ForwardingSource; +import okio.Okio; +import okio.Source; + +public class ProgressResponseBody extends ResponseBody { + + public interface ProgressListener { + void update(long bytesRead, long contentLength, boolean done); + } + + private final ResponseBody responseBody; + private final ProgressListener progressListener; + private BufferedSource bufferedSource; + + public ProgressResponseBody(ResponseBody responseBody, ProgressListener progressListener) { + this.responseBody = responseBody; + this.progressListener = progressListener; + } + + @Override + public MediaType contentType() { + return responseBody.contentType(); + } + + @Override + public long contentLength() throws IOException { + return responseBody.contentLength(); + } + + @Override + public BufferedSource source() throws IOException { + if (bufferedSource == null) { + bufferedSource = Okio.buffer(source(responseBody.source())); + } + return bufferedSource; + } + + private Source source(Source source) { + return new ForwardingSource(source) { + long totalBytesRead = 0L; + + @Override + public long read(Buffer sink, long byteCount) throws IOException { + long bytesRead = super.read(sink, byteCount); + // read() returns the number of bytes read, or -1 if this source is exhausted. + totalBytesRead += bytesRead != -1 ? bytesRead : 0; + progressListener.update(totalBytesRead, responseBody.contentLength(), bytesRead == -1); + return bytesRead; + } + }; + } +} + + diff --git a/src/main/java/com/aspose/asposecloudpdf/StringUtil.java b/src/main/java/com/aspose/asposecloudpdf/StringUtil.java new file mode 100644 index 0000000..ad8cea0 --- /dev/null +++ b/src/main/java/com/aspose/asposecloudpdf/StringUtil.java @@ -0,0 +1,64 @@ +/** + * + * Copyright (c) 2018 Aspose.Pdf for Cloud + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + */ + + +package com.aspose.asposecloudpdf; + + +public class StringUtil { + /** + * Check if the given array contains the given value (with case-insensitive comparison). + * + * @param array The array + * @param value The value to search + * @return true if the array contains the value + */ + public static boolean containsIgnoreCase(String[] array, String value) { + for (String str : array) { + if (value == null && str == null) return true; + if (value != null && value.equalsIgnoreCase(str)) return true; + } + return false; + } + + /** + * Join an array of strings with the given separator. + *

+ * Note: This might be replaced by utility method from commons-lang or guava someday + * if one of those libraries is added as dependency. + *

+ * + * @param array The array of strings + * @param separator The separator + * @return the resulting string + */ + public static String join(String[] array, String separator) { + int len = array.length; + if (len == 0) return ""; + + StringBuilder out = new StringBuilder(); + out.append(array[0]); + for (int i = 1; i < len; i++) { + out.append(separator).append(array[i]); + } + return out.toString(); + } +} diff --git a/src/main/java/com/aspose/asposecloudpdf/api/PdfApi.java b/src/main/java/com/aspose/asposecloudpdf/api/PdfApi.java new file mode 100644 index 0000000..d5b89c4 --- /dev/null +++ b/src/main/java/com/aspose/asposecloudpdf/api/PdfApi.java @@ -0,0 +1,19074 @@ +/** + * + * Copyright (c) 2018 Aspose.Pdf for Cloud + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + */ + + +package com.aspose.asposecloudpdf.api; + +import com.aspose.asposecloudpdf.ApiCallback; +import com.aspose.asposecloudpdf.ApiClient; +import com.aspose.asposecloudpdf.ApiException; +import com.aspose.asposecloudpdf.ApiResponse; +import com.aspose.asposecloudpdf.Configuration; +import com.aspose.asposecloudpdf.Pair; +import com.aspose.asposecloudpdf.ProgressRequestBody; +import com.aspose.asposecloudpdf.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import com.aspose.asposecloudpdf.model.AnnotationResponse; +import com.aspose.asposecloudpdf.model.AnnotationsResponse; +import com.aspose.asposecloudpdf.model.AppendDocument; +import com.aspose.asposecloudpdf.model.AttachmentResponse; +import com.aspose.asposecloudpdf.model.AttachmentsResponse; +import com.aspose.asposecloudpdf.model.DocumentPagesResponse; +import com.aspose.asposecloudpdf.model.DocumentPrivilege; +import com.aspose.asposecloudpdf.model.DocumentPropertiesResponse; +import com.aspose.asposecloudpdf.model.DocumentProperty; +import com.aspose.asposecloudpdf.model.DocumentPropertyResponse; +import com.aspose.asposecloudpdf.model.DocumentResponse; +import com.aspose.asposecloudpdf.model.DocumentTextReplaceResponse; +import com.aspose.asposecloudpdf.model.Field; +import com.aspose.asposecloudpdf.model.FieldResponse; +import com.aspose.asposecloudpdf.model.Fields; +import com.aspose.asposecloudpdf.model.FieldsResponse; +import java.io.File; +import com.aspose.asposecloudpdf.model.ImageResponse; +import com.aspose.asposecloudpdf.model.ImagesListRequest; +import com.aspose.asposecloudpdf.model.ImagesResponse; +import com.aspose.asposecloudpdf.model.LinkAnnotationResponse; +import com.aspose.asposecloudpdf.model.LinkAnnotationsResponse; +import com.aspose.asposecloudpdf.model.MergeDocuments; +import com.aspose.asposecloudpdf.model.OptimizeOptions; +import com.aspose.asposecloudpdf.model.PageTextReplaceResponse; +import com.aspose.asposecloudpdf.model.Paragraph; +import com.aspose.asposecloudpdf.model.SaaSposeResponse; +import com.aspose.asposecloudpdf.model.Signature; +import com.aspose.asposecloudpdf.model.SignatureVerifyResponse; +import com.aspose.asposecloudpdf.model.SplitResultResponse; +import com.aspose.asposecloudpdf.model.Stamp; +import com.aspose.asposecloudpdf.model.TextFormatResponse; +import com.aspose.asposecloudpdf.model.TextItemResponse; +import com.aspose.asposecloudpdf.model.TextItemsResponse; +import com.aspose.asposecloudpdf.model.TextRectsResponse; +import com.aspose.asposecloudpdf.model.TextReplaceListRequest; +import com.aspose.asposecloudpdf.model.TextReplaceRequest; +import com.aspose.asposecloudpdf.model.TextReplaceResponse; +import com.aspose.asposecloudpdf.model.TiffExportOptions; +import com.aspose.asposecloudpdf.model.WordCountResponse; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class PdfApi { + private ApiClient apiClient; + + public PdfApi(String appKey, String appSid) { + this(Configuration.getDefaultApiClient()); + apiClient.setAppKey(appKey); + apiClient.setAppSid(appSid); + } + + public PdfApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + public ApiClient getApiClient() { + return apiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Build call for deleteField + * @param name The document name. (required) + * @param fieldName The field name/ (required) + * @param storage The document storage. (optional) + * @param folder The document folder. (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call deleteFieldCall(String name, String fieldName, String storage, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/pdf/{name}/fields/{fieldName}" + .replaceAll("\\{" + "name" + "\\}", apiClient.escapeString(name.toString())) + .replaceAll("\\{" + "fieldName" + "\\}", apiClient.escapeString(fieldName.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (storage != null) + localVarQueryParams.addAll(apiClient.parameterToPair("storage", storage)); + if (folder != null) + localVarQueryParams.addAll(apiClient.parameterToPair("folder", folder)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call deleteFieldValidateBeforeCall(String name, String fieldName, String storage, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException("Missing the required parameter 'name' when calling deleteField(Async)"); + } + + // verify the required parameter 'fieldName' is set + if (fieldName == null) { + throw new ApiException("Missing the required parameter 'fieldName' when calling deleteField(Async)"); + } + + + com.squareup.okhttp.Call call = deleteFieldCall(name, fieldName, storage, folder, progressListener, progressRequestListener); + return call; + + } + + /** + * Delete document field by name. + * + * @param name The document name. (required) + * @param fieldName The field name/ (required) + * @param storage The document storage. (optional) + * @param folder The document folder. (optional) + * @return SaaSposeResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public SaaSposeResponse deleteField(String name, String fieldName, String storage, String folder) throws ApiException { + ApiResponse resp = deleteFieldWithHttpInfo(name, fieldName, storage, folder); + return resp.getData(); + } + + /** + * Delete document field by name. + * + * @param name The document name. (required) + * @param fieldName The field name/ (required) + * @param storage The document storage. (optional) + * @param folder The document folder. (optional) + * @return ApiResponse<SaaSposeResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse deleteFieldWithHttpInfo(String name, String fieldName, String storage, String folder) throws ApiException { + com.squareup.okhttp.Call call = deleteFieldValidateBeforeCall(name, fieldName, storage, folder, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Delete document field by name. (asynchronously) + * + * @param name The document name. (required) + * @param fieldName The field name/ (required) + * @param storage The document storage. (optional) + * @param folder The document folder. (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call deleteFieldAsync(String name, String fieldName, String storage, String folder, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = deleteFieldValidateBeforeCall(name, fieldName, storage, folder, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for deletePage + * @param name The document name. (required) + * @param pageNumber The page number. (required) + * @param storage The document storage. (optional) + * @param folder The document folder. (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call deletePageCall(String name, Integer pageNumber, String storage, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/pdf/{name}/pages/{pageNumber}" + .replaceAll("\\{" + "name" + "\\}", apiClient.escapeString(name.toString())) + .replaceAll("\\{" + "pageNumber" + "\\}", apiClient.escapeString(pageNumber.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (storage != null) + localVarQueryParams.addAll(apiClient.parameterToPair("storage", storage)); + if (folder != null) + localVarQueryParams.addAll(apiClient.parameterToPair("folder", folder)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call deletePageValidateBeforeCall(String name, Integer pageNumber, String storage, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException("Missing the required parameter 'name' when calling deletePage(Async)"); + } + + // verify the required parameter 'pageNumber' is set + if (pageNumber == null) { + throw new ApiException("Missing the required parameter 'pageNumber' when calling deletePage(Async)"); + } + + + com.squareup.okhttp.Call call = deletePageCall(name, pageNumber, storage, folder, progressListener, progressRequestListener); + return call; + + } + + /** + * Delete document page by its number. + * + * @param name The document name. (required) + * @param pageNumber The page number. (required) + * @param storage The document storage. (optional) + * @param folder The document folder. (optional) + * @return SaaSposeResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public SaaSposeResponse deletePage(String name, Integer pageNumber, String storage, String folder) throws ApiException { + ApiResponse resp = deletePageWithHttpInfo(name, pageNumber, storage, folder); + return resp.getData(); + } + + /** + * Delete document page by its number. + * + * @param name The document name. (required) + * @param pageNumber The page number. (required) + * @param storage The document storage. (optional) + * @param folder The document folder. (optional) + * @return ApiResponse<SaaSposeResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse deletePageWithHttpInfo(String name, Integer pageNumber, String storage, String folder) throws ApiException { + com.squareup.okhttp.Call call = deletePageValidateBeforeCall(name, pageNumber, storage, folder, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Delete document page by its number. (asynchronously) + * + * @param name The document name. (required) + * @param pageNumber The page number. (required) + * @param storage The document storage. (optional) + * @param folder The document folder. (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call deletePageAsync(String name, Integer pageNumber, String storage, String folder, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = deletePageValidateBeforeCall(name, pageNumber, storage, folder, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for deleteProperties + * @param name (required) + * @param storage (optional) + * @param folder (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call deletePropertiesCall(String name, String storage, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/pdf/{name}/documentproperties" + .replaceAll("\\{" + "name" + "\\}", apiClient.escapeString(name.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (storage != null) + localVarQueryParams.addAll(apiClient.parameterToPair("storage", storage)); + if (folder != null) + localVarQueryParams.addAll(apiClient.parameterToPair("folder", folder)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call deletePropertiesValidateBeforeCall(String name, String storage, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException("Missing the required parameter 'name' when calling deleteProperties(Async)"); + } + + + com.squareup.okhttp.Call call = deletePropertiesCall(name, storage, folder, progressListener, progressRequestListener); + return call; + + } + + /** + * Delete custom document properties. + * + * @param name (required) + * @param storage (optional) + * @param folder (optional) + * @return SaaSposeResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public SaaSposeResponse deleteProperties(String name, String storage, String folder) throws ApiException { + ApiResponse resp = deletePropertiesWithHttpInfo(name, storage, folder); + return resp.getData(); + } + + /** + * Delete custom document properties. + * + * @param name (required) + * @param storage (optional) + * @param folder (optional) + * @return ApiResponse<SaaSposeResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse deletePropertiesWithHttpInfo(String name, String storage, String folder) throws ApiException { + com.squareup.okhttp.Call call = deletePropertiesValidateBeforeCall(name, storage, folder, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Delete custom document properties. (asynchronously) + * + * @param name (required) + * @param storage (optional) + * @param folder (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call deletePropertiesAsync(String name, String storage, String folder, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = deletePropertiesValidateBeforeCall(name, storage, folder, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for deleteProperty + * @param name (required) + * @param propertyName (required) + * @param storage (optional) + * @param folder (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call deletePropertyCall(String name, String propertyName, String storage, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/pdf/{name}/documentproperties/{propertyName}" + .replaceAll("\\{" + "name" + "\\}", apiClient.escapeString(name.toString())) + .replaceAll("\\{" + "propertyName" + "\\}", apiClient.escapeString(propertyName.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (storage != null) + localVarQueryParams.addAll(apiClient.parameterToPair("storage", storage)); + if (folder != null) + localVarQueryParams.addAll(apiClient.parameterToPair("folder", folder)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call deletePropertyValidateBeforeCall(String name, String propertyName, String storage, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException("Missing the required parameter 'name' when calling deleteProperty(Async)"); + } + + // verify the required parameter 'propertyName' is set + if (propertyName == null) { + throw new ApiException("Missing the required parameter 'propertyName' when calling deleteProperty(Async)"); + } + + + com.squareup.okhttp.Call call = deletePropertyCall(name, propertyName, storage, folder, progressListener, progressRequestListener); + return call; + + } + + /** + * Delete document property. + * + * @param name (required) + * @param propertyName (required) + * @param storage (optional) + * @param folder (optional) + * @return SaaSposeResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public SaaSposeResponse deleteProperty(String name, String propertyName, String storage, String folder) throws ApiException { + ApiResponse resp = deletePropertyWithHttpInfo(name, propertyName, storage, folder); + return resp.getData(); + } + + /** + * Delete document property. + * + * @param name (required) + * @param propertyName (required) + * @param storage (optional) + * @param folder (optional) + * @return ApiResponse<SaaSposeResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse deletePropertyWithHttpInfo(String name, String propertyName, String storage, String folder) throws ApiException { + com.squareup.okhttp.Call call = deletePropertyValidateBeforeCall(name, propertyName, storage, folder, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Delete document property. (asynchronously) + * + * @param name (required) + * @param propertyName (required) + * @param storage (optional) + * @param folder (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call deletePropertyAsync(String name, String propertyName, String storage, String folder, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = deletePropertyValidateBeforeCall(name, propertyName, storage, folder, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for getDocument + * @param name The document name. (required) + * @param format The format to convert. (optional) + * @param storage The document storage. (optional) + * @param folder The document folder. (optional) + * @param outPath Path to save result (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @deprecated + */ + @Deprecated + public com.squareup.okhttp.Call getDocumentCall(String name, String format, String storage, String folder, String outPath, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/pdf/{name}" + .replaceAll("\\{" + "name" + "\\}", apiClient.escapeString(name.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (format != null) + localVarQueryParams.addAll(apiClient.parameterToPair("format", format)); + if (storage != null) + localVarQueryParams.addAll(apiClient.parameterToPair("storage", storage)); + if (folder != null) + localVarQueryParams.addAll(apiClient.parameterToPair("folder", folder)); + if (outPath != null) + localVarQueryParams.addAll(apiClient.parameterToPair("outPath", outPath)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "multipart/form-data" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @Deprecated + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call getDocumentValidateBeforeCall(String name, String format, String storage, String folder, String outPath, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException("Missing the required parameter 'name' when calling getDocument(Async)"); + } + + + com.squareup.okhttp.Call call = getDocumentCall(name, format, storage, folder, outPath, progressListener, progressRequestListener); + return call; + + } + + /** + * Read common document info or convert to some format if the format specified. + * + * @param name The document name. (required) + * @param format The format to convert. (optional) + * @param storage The document storage. (optional) + * @param folder The document folder. (optional) + * @param outPath Path to save result (optional) + * @return File + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @deprecated + */ + @Deprecated + public File getDocument(String name, String format, String storage, String folder, String outPath) throws ApiException { + ApiResponse resp = getDocumentWithHttpInfo(name, format, storage, folder, outPath); + return resp.getData(); + } + + /** + * Read common document info or convert to some format if the format specified. + * + * @param name The document name. (required) + * @param format The format to convert. (optional) + * @param storage The document storage. (optional) + * @param folder The document folder. (optional) + * @param outPath Path to save result (optional) + * @return ApiResponse<File> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @deprecated + */ + @Deprecated + public ApiResponse getDocumentWithHttpInfo(String name, String format, String storage, String folder, String outPath) throws ApiException { + com.squareup.okhttp.Call call = getDocumentValidateBeforeCall(name, format, storage, folder, outPath, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Read common document info or convert to some format if the format specified. (asynchronously) + * + * @param name The document name. (required) + * @param format The format to convert. (optional) + * @param storage The document storage. (optional) + * @param folder The document folder. (optional) + * @param outPath Path to save result (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @deprecated + */ + @Deprecated + public com.squareup.okhttp.Call getDocumentAsync(String name, String format, String storage, String folder, String outPath, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = getDocumentValidateBeforeCall(name, format, storage, folder, outPath, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for getDocumentAttachmentByIndex + * @param name The document name. (required) + * @param attachmentIndex The attachment index. (required) + * @param storage The document storage. (optional) + * @param folder The document folder. (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call getDocumentAttachmentByIndexCall(String name, Integer attachmentIndex, String storage, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/pdf/{name}/attachments/{attachmentIndex}" + .replaceAll("\\{" + "name" + "\\}", apiClient.escapeString(name.toString())) + .replaceAll("\\{" + "attachmentIndex" + "\\}", apiClient.escapeString(attachmentIndex.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (storage != null) + localVarQueryParams.addAll(apiClient.parameterToPair("storage", storage)); + if (folder != null) + localVarQueryParams.addAll(apiClient.parameterToPair("folder", folder)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call getDocumentAttachmentByIndexValidateBeforeCall(String name, Integer attachmentIndex, String storage, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException("Missing the required parameter 'name' when calling getDocumentAttachmentByIndex(Async)"); + } + + // verify the required parameter 'attachmentIndex' is set + if (attachmentIndex == null) { + throw new ApiException("Missing the required parameter 'attachmentIndex' when calling getDocumentAttachmentByIndex(Async)"); + } + + + com.squareup.okhttp.Call call = getDocumentAttachmentByIndexCall(name, attachmentIndex, storage, folder, progressListener, progressRequestListener); + return call; + + } + + /** + * Read document attachment info by its index. + * + * @param name The document name. (required) + * @param attachmentIndex The attachment index. (required) + * @param storage The document storage. (optional) + * @param folder The document folder. (optional) + * @return AttachmentResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public AttachmentResponse getDocumentAttachmentByIndex(String name, Integer attachmentIndex, String storage, String folder) throws ApiException { + ApiResponse resp = getDocumentAttachmentByIndexWithHttpInfo(name, attachmentIndex, storage, folder); + return resp.getData(); + } + + /** + * Read document attachment info by its index. + * + * @param name The document name. (required) + * @param attachmentIndex The attachment index. (required) + * @param storage The document storage. (optional) + * @param folder The document folder. (optional) + * @return ApiResponse<AttachmentResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse getDocumentAttachmentByIndexWithHttpInfo(String name, Integer attachmentIndex, String storage, String folder) throws ApiException { + com.squareup.okhttp.Call call = getDocumentAttachmentByIndexValidateBeforeCall(name, attachmentIndex, storage, folder, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Read document attachment info by its index. (asynchronously) + * + * @param name The document name. (required) + * @param attachmentIndex The attachment index. (required) + * @param storage The document storage. (optional) + * @param folder The document folder. (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call getDocumentAttachmentByIndexAsync(String name, Integer attachmentIndex, String storage, String folder, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = getDocumentAttachmentByIndexValidateBeforeCall(name, attachmentIndex, storage, folder, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for getDocumentAttachments + * @param name The document name. (required) + * @param storage The document storage. (optional) + * @param folder The document folder. (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call getDocumentAttachmentsCall(String name, String storage, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/pdf/{name}/attachments" + .replaceAll("\\{" + "name" + "\\}", apiClient.escapeString(name.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (storage != null) + localVarQueryParams.addAll(apiClient.parameterToPair("storage", storage)); + if (folder != null) + localVarQueryParams.addAll(apiClient.parameterToPair("folder", folder)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call getDocumentAttachmentsValidateBeforeCall(String name, String storage, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException("Missing the required parameter 'name' when calling getDocumentAttachments(Async)"); + } + + + com.squareup.okhttp.Call call = getDocumentAttachmentsCall(name, storage, folder, progressListener, progressRequestListener); + return call; + + } + + /** + * Read document attachments info. + * + * @param name The document name. (required) + * @param storage The document storage. (optional) + * @param folder The document folder. (optional) + * @return AttachmentsResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public AttachmentsResponse getDocumentAttachments(String name, String storage, String folder) throws ApiException { + ApiResponse resp = getDocumentAttachmentsWithHttpInfo(name, storage, folder); + return resp.getData(); + } + + /** + * Read document attachments info. + * + * @param name The document name. (required) + * @param storage The document storage. (optional) + * @param folder The document folder. (optional) + * @return ApiResponse<AttachmentsResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse getDocumentAttachmentsWithHttpInfo(String name, String storage, String folder) throws ApiException { + com.squareup.okhttp.Call call = getDocumentAttachmentsValidateBeforeCall(name, storage, folder, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Read document attachments info. (asynchronously) + * + * @param name The document name. (required) + * @param storage The document storage. (optional) + * @param folder The document folder. (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call getDocumentAttachmentsAsync(String name, String storage, String folder, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = getDocumentAttachmentsValidateBeforeCall(name, storage, folder, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for getDocumentBookmarks + * @param name The document name. (required) + * @param bookmarkPath The bookmark path. Leave it empty if you want to get all the bookmarks in the document. (optional) + * @param storage The document storage. (optional) + * @param folder The document folder. (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call getDocumentBookmarksCall(String name, String bookmarkPath, String storage, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/pdf/{name}/bookmarks" + .replaceAll("\\{" + "name" + "\\}", apiClient.escapeString(name.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (bookmarkPath != null) + localVarQueryParams.addAll(apiClient.parameterToPair("bookmarkPath", bookmarkPath)); + if (storage != null) + localVarQueryParams.addAll(apiClient.parameterToPair("storage", storage)); + if (folder != null) + localVarQueryParams.addAll(apiClient.parameterToPair("folder", folder)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "multipart/form-data" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call getDocumentBookmarksValidateBeforeCall(String name, String bookmarkPath, String storage, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException("Missing the required parameter 'name' when calling getDocumentBookmarks(Async)"); + } + + + com.squareup.okhttp.Call call = getDocumentBookmarksCall(name, bookmarkPath, storage, folder, progressListener, progressRequestListener); + return call; + + } + + /** + * Read document bookmark/bookmarks (including children). + * + * @param name The document name. (required) + * @param bookmarkPath The bookmark path. Leave it empty if you want to get all the bookmarks in the document. (optional) + * @param storage The document storage. (optional) + * @param folder The document folder. (optional) + * @return File + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public File getDocumentBookmarks(String name, String bookmarkPath, String storage, String folder) throws ApiException { + ApiResponse resp = getDocumentBookmarksWithHttpInfo(name, bookmarkPath, storage, folder); + return resp.getData(); + } + + /** + * Read document bookmark/bookmarks (including children). + * + * @param name The document name. (required) + * @param bookmarkPath The bookmark path. Leave it empty if you want to get all the bookmarks in the document. (optional) + * @param storage The document storage. (optional) + * @param folder The document folder. (optional) + * @return ApiResponse<File> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse getDocumentBookmarksWithHttpInfo(String name, String bookmarkPath, String storage, String folder) throws ApiException { + com.squareup.okhttp.Call call = getDocumentBookmarksValidateBeforeCall(name, bookmarkPath, storage, folder, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Read document bookmark/bookmarks (including children). (asynchronously) + * + * @param name The document name. (required) + * @param bookmarkPath The bookmark path. Leave it empty if you want to get all the bookmarks in the document. (optional) + * @param storage The document storage. (optional) + * @param folder The document folder. (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call getDocumentBookmarksAsync(String name, String bookmarkPath, String storage, String folder, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = getDocumentBookmarksValidateBeforeCall(name, bookmarkPath, storage, folder, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for getDocumentProperties + * @param name (required) + * @param storage (optional) + * @param folder (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call getDocumentPropertiesCall(String name, String storage, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/pdf/{name}/documentproperties" + .replaceAll("\\{" + "name" + "\\}", apiClient.escapeString(name.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (storage != null) + localVarQueryParams.addAll(apiClient.parameterToPair("storage", storage)); + if (folder != null) + localVarQueryParams.addAll(apiClient.parameterToPair("folder", folder)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call getDocumentPropertiesValidateBeforeCall(String name, String storage, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException("Missing the required parameter 'name' when calling getDocumentProperties(Async)"); + } + + + com.squareup.okhttp.Call call = getDocumentPropertiesCall(name, storage, folder, progressListener, progressRequestListener); + return call; + + } + + /** + * Read document properties. + * + * @param name (required) + * @param storage (optional) + * @param folder (optional) + * @return DocumentPropertiesResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public DocumentPropertiesResponse getDocumentProperties(String name, String storage, String folder) throws ApiException { + ApiResponse resp = getDocumentPropertiesWithHttpInfo(name, storage, folder); + return resp.getData(); + } + + /** + * Read document properties. + * + * @param name (required) + * @param storage (optional) + * @param folder (optional) + * @return ApiResponse<DocumentPropertiesResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse getDocumentPropertiesWithHttpInfo(String name, String storage, String folder) throws ApiException { + com.squareup.okhttp.Call call = getDocumentPropertiesValidateBeforeCall(name, storage, folder, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Read document properties. (asynchronously) + * + * @param name (required) + * @param storage (optional) + * @param folder (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call getDocumentPropertiesAsync(String name, String storage, String folder, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = getDocumentPropertiesValidateBeforeCall(name, storage, folder, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for getDocumentProperty + * @param name (required) + * @param propertyName (required) + * @param storage (optional) + * @param folder (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call getDocumentPropertyCall(String name, String propertyName, String storage, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/pdf/{name}/documentproperties/{propertyName}" + .replaceAll("\\{" + "name" + "\\}", apiClient.escapeString(name.toString())) + .replaceAll("\\{" + "propertyName" + "\\}", apiClient.escapeString(propertyName.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (storage != null) + localVarQueryParams.addAll(apiClient.parameterToPair("storage", storage)); + if (folder != null) + localVarQueryParams.addAll(apiClient.parameterToPair("folder", folder)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call getDocumentPropertyValidateBeforeCall(String name, String propertyName, String storage, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException("Missing the required parameter 'name' when calling getDocumentProperty(Async)"); + } + + // verify the required parameter 'propertyName' is set + if (propertyName == null) { + throw new ApiException("Missing the required parameter 'propertyName' when calling getDocumentProperty(Async)"); + } + + + com.squareup.okhttp.Call call = getDocumentPropertyCall(name, propertyName, storage, folder, progressListener, progressRequestListener); + return call; + + } + + /** + * Read document property by name. + * + * @param name (required) + * @param propertyName (required) + * @param storage (optional) + * @param folder (optional) + * @return DocumentPropertyResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public DocumentPropertyResponse getDocumentProperty(String name, String propertyName, String storage, String folder) throws ApiException { + ApiResponse resp = getDocumentPropertyWithHttpInfo(name, propertyName, storage, folder); + return resp.getData(); + } + + /** + * Read document property by name. + * + * @param name (required) + * @param propertyName (required) + * @param storage (optional) + * @param folder (optional) + * @return ApiResponse<DocumentPropertyResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse getDocumentPropertyWithHttpInfo(String name, String propertyName, String storage, String folder) throws ApiException { + com.squareup.okhttp.Call call = getDocumentPropertyValidateBeforeCall(name, propertyName, storage, folder, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Read document property by name. (asynchronously) + * + * @param name (required) + * @param propertyName (required) + * @param storage (optional) + * @param folder (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call getDocumentPropertyAsync(String name, String propertyName, String storage, String folder, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = getDocumentPropertyValidateBeforeCall(name, propertyName, storage, folder, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for getDownload + * @param path Path of the file including the file name and extension e.g. /file.ext (required) + * @param versionId File's version (optional) + * @param storage User's storage name (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call getDownloadCall(String path, String versionId, String storage, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/storage/file"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (path != null) + localVarQueryParams.addAll(apiClient.parameterToPair("path", path)); + if (versionId != null) + localVarQueryParams.addAll(apiClient.parameterToPair("versionId", versionId)); + if (storage != null) + localVarQueryParams.addAll(apiClient.parameterToPair("storage", storage)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "multipart/form-data" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call getDownloadValidateBeforeCall(String path, String versionId, String storage, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + // verify the required parameter 'path' is set + if (path == null) { + throw new ApiException("Missing the required parameter 'path' when calling getDownload(Async)"); + } + + + com.squareup.okhttp.Call call = getDownloadCall(path, versionId, storage, progressListener, progressRequestListener); + return call; + + } + + /** + * Download a specific file + * + * @param path Path of the file including the file name and extension e.g. /file.ext (required) + * @param versionId File's version (optional) + * @param storage User's storage name (optional) + * @return File + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public File getDownload(String path, String versionId, String storage) throws ApiException { + ApiResponse resp = getDownloadWithHttpInfo(path, versionId, storage); + return resp.getData(); + } + + /** + * Download a specific file + * + * @param path Path of the file including the file name and extension e.g. /file.ext (required) + * @param versionId File's version (optional) + * @param storage User's storage name (optional) + * @return ApiResponse<File> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse getDownloadWithHttpInfo(String path, String versionId, String storage) throws ApiException { + com.squareup.okhttp.Call call = getDownloadValidateBeforeCall(path, versionId, storage, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Download a specific file (asynchronously) + * + * @param path Path of the file including the file name and extension e.g. /file.ext (required) + * @param versionId File's version (optional) + * @param storage User's storage name (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call getDownloadAsync(String path, String versionId, String storage, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = getDownloadValidateBeforeCall(path, versionId, storage, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for getDownloadDocumentAttachmentByIndex + * @param name The document name. (required) + * @param attachmentIndex The attachment index. (required) + * @param storage The document storage. (optional) + * @param folder The document folder. (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call getDownloadDocumentAttachmentByIndexCall(String name, Integer attachmentIndex, String storage, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/pdf/{name}/attachments/{attachmentIndex}/download" + .replaceAll("\\{" + "name" + "\\}", apiClient.escapeString(name.toString())) + .replaceAll("\\{" + "attachmentIndex" + "\\}", apiClient.escapeString(attachmentIndex.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (storage != null) + localVarQueryParams.addAll(apiClient.parameterToPair("storage", storage)); + if (folder != null) + localVarQueryParams.addAll(apiClient.parameterToPair("folder", folder)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "multipart/form-data" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call getDownloadDocumentAttachmentByIndexValidateBeforeCall(String name, Integer attachmentIndex, String storage, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException("Missing the required parameter 'name' when calling getDownloadDocumentAttachmentByIndex(Async)"); + } + + // verify the required parameter 'attachmentIndex' is set + if (attachmentIndex == null) { + throw new ApiException("Missing the required parameter 'attachmentIndex' when calling getDownloadDocumentAttachmentByIndex(Async)"); + } + + + com.squareup.okhttp.Call call = getDownloadDocumentAttachmentByIndexCall(name, attachmentIndex, storage, folder, progressListener, progressRequestListener); + return call; + + } + + /** + * Download document attachment content by its index. + * + * @param name The document name. (required) + * @param attachmentIndex The attachment index. (required) + * @param storage The document storage. (optional) + * @param folder The document folder. (optional) + * @return File + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public File getDownloadDocumentAttachmentByIndex(String name, Integer attachmentIndex, String storage, String folder) throws ApiException { + ApiResponse resp = getDownloadDocumentAttachmentByIndexWithHttpInfo(name, attachmentIndex, storage, folder); + return resp.getData(); + } + + /** + * Download document attachment content by its index. + * + * @param name The document name. (required) + * @param attachmentIndex The attachment index. (required) + * @param storage The document storage. (optional) + * @param folder The document folder. (optional) + * @return ApiResponse<File> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse getDownloadDocumentAttachmentByIndexWithHttpInfo(String name, Integer attachmentIndex, String storage, String folder) throws ApiException { + com.squareup.okhttp.Call call = getDownloadDocumentAttachmentByIndexValidateBeforeCall(name, attachmentIndex, storage, folder, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Download document attachment content by its index. (asynchronously) + * + * @param name The document name. (required) + * @param attachmentIndex The attachment index. (required) + * @param storage The document storage. (optional) + * @param folder The document folder. (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call getDownloadDocumentAttachmentByIndexAsync(String name, Integer attachmentIndex, String storage, String folder, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = getDownloadDocumentAttachmentByIndexValidateBeforeCall(name, attachmentIndex, storage, folder, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for getEpubInStorageToPdf + * @param srcPath Full source filename (ex. /folder1/folder2/template.epub) (required) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call getEpubInStorageToPdfCall(String srcPath, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/pdf/create/epub"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (srcPath != null) + localVarQueryParams.addAll(apiClient.parameterToPair("srcPath", srcPath)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "multipart/form-data" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call getEpubInStorageToPdfValidateBeforeCall(String srcPath, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + // verify the required parameter 'srcPath' is set + if (srcPath == null) { + throw new ApiException("Missing the required parameter 'srcPath' when calling getEpubInStorageToPdf(Async)"); + } + + + com.squareup.okhttp.Call call = getEpubInStorageToPdfCall(srcPath, progressListener, progressRequestListener); + return call; + + } + + /** + * Convert EPUB file (located on storage) to PDF format and return resulting file in response. + * + * @param srcPath Full source filename (ex. /folder1/folder2/template.epub) (required) + * @return File + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public File getEpubInStorageToPdf(String srcPath) throws ApiException { + ApiResponse resp = getEpubInStorageToPdfWithHttpInfo(srcPath); + return resp.getData(); + } + + /** + * Convert EPUB file (located on storage) to PDF format and return resulting file in response. + * + * @param srcPath Full source filename (ex. /folder1/folder2/template.epub) (required) + * @return ApiResponse<File> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse getEpubInStorageToPdfWithHttpInfo(String srcPath) throws ApiException { + com.squareup.okhttp.Call call = getEpubInStorageToPdfValidateBeforeCall(srcPath, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Convert EPUB file (located on storage) to PDF format and return resulting file in response. (asynchronously) + * + * @param srcPath Full source filename (ex. /folder1/folder2/template.epub) (required) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call getEpubInStorageToPdfAsync(String srcPath, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = getEpubInStorageToPdfValidateBeforeCall(srcPath, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for getField + * @param name The document name. (required) + * @param fieldName The field name/ (required) + * @param storage The document storage. (optional) + * @param folder The document folder. (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call getFieldCall(String name, String fieldName, String storage, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/pdf/{name}/fields/{fieldName}" + .replaceAll("\\{" + "name" + "\\}", apiClient.escapeString(name.toString())) + .replaceAll("\\{" + "fieldName" + "\\}", apiClient.escapeString(fieldName.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (storage != null) + localVarQueryParams.addAll(apiClient.parameterToPair("storage", storage)); + if (folder != null) + localVarQueryParams.addAll(apiClient.parameterToPair("folder", folder)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call getFieldValidateBeforeCall(String name, String fieldName, String storage, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException("Missing the required parameter 'name' when calling getField(Async)"); + } + + // verify the required parameter 'fieldName' is set + if (fieldName == null) { + throw new ApiException("Missing the required parameter 'fieldName' when calling getField(Async)"); + } + + + com.squareup.okhttp.Call call = getFieldCall(name, fieldName, storage, folder, progressListener, progressRequestListener); + return call; + + } + + /** + * Get document field by name. + * + * @param name The document name. (required) + * @param fieldName The field name/ (required) + * @param storage The document storage. (optional) + * @param folder The document folder. (optional) + * @return FieldResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public FieldResponse getField(String name, String fieldName, String storage, String folder) throws ApiException { + ApiResponse resp = getFieldWithHttpInfo(name, fieldName, storage, folder); + return resp.getData(); + } + + /** + * Get document field by name. + * + * @param name The document name. (required) + * @param fieldName The field name/ (required) + * @param storage The document storage. (optional) + * @param folder The document folder. (optional) + * @return ApiResponse<FieldResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse getFieldWithHttpInfo(String name, String fieldName, String storage, String folder) throws ApiException { + com.squareup.okhttp.Call call = getFieldValidateBeforeCall(name, fieldName, storage, folder, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Get document field by name. (asynchronously) + * + * @param name The document name. (required) + * @param fieldName The field name/ (required) + * @param storage The document storage. (optional) + * @param folder The document folder. (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call getFieldAsync(String name, String fieldName, String storage, String folder, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = getFieldValidateBeforeCall(name, fieldName, storage, folder, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for getFields + * @param name The document name. (required) + * @param storage The document storage. (optional) + * @param folder The document folder. (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call getFieldsCall(String name, String storage, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/pdf/{name}/fields" + .replaceAll("\\{" + "name" + "\\}", apiClient.escapeString(name.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (storage != null) + localVarQueryParams.addAll(apiClient.parameterToPair("storage", storage)); + if (folder != null) + localVarQueryParams.addAll(apiClient.parameterToPair("folder", folder)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call getFieldsValidateBeforeCall(String name, String storage, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException("Missing the required parameter 'name' when calling getFields(Async)"); + } + + + com.squareup.okhttp.Call call = getFieldsCall(name, storage, folder, progressListener, progressRequestListener); + return call; + + } + + /** + * Get document fields. + * + * @param name The document name. (required) + * @param storage The document storage. (optional) + * @param folder The document folder. (optional) + * @return FieldsResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public FieldsResponse getFields(String name, String storage, String folder) throws ApiException { + ApiResponse resp = getFieldsWithHttpInfo(name, storage, folder); + return resp.getData(); + } + + /** + * Get document fields. + * + * @param name The document name. (required) + * @param storage The document storage. (optional) + * @param folder The document folder. (optional) + * @return ApiResponse<FieldsResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse getFieldsWithHttpInfo(String name, String storage, String folder) throws ApiException { + com.squareup.okhttp.Call call = getFieldsValidateBeforeCall(name, storage, folder, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Get document fields. (asynchronously) + * + * @param name The document name. (required) + * @param storage The document storage. (optional) + * @param folder The document folder. (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call getFieldsAsync(String name, String storage, String folder, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = getFieldsValidateBeforeCall(name, storage, folder, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for getFragment + * @param name (required) + * @param pageNumber (required) + * @param fragmentNumber (required) + * @param withEmpty (optional) + * @param storage (optional) + * @param folder (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @deprecated + */ + @Deprecated + public com.squareup.okhttp.Call getFragmentCall(String name, Integer pageNumber, Integer fragmentNumber, String withEmpty, String storage, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/pdf/{name}/pages/{pageNumber}/fragments/{fragmentNumber}" + .replaceAll("\\{" + "name" + "\\}", apiClient.escapeString(name.toString())) + .replaceAll("\\{" + "pageNumber" + "\\}", apiClient.escapeString(pageNumber.toString())) + .replaceAll("\\{" + "fragmentNumber" + "\\}", apiClient.escapeString(fragmentNumber.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (withEmpty != null) + localVarQueryParams.addAll(apiClient.parameterToPair("withEmpty", withEmpty)); + if (storage != null) + localVarQueryParams.addAll(apiClient.parameterToPair("storage", storage)); + if (folder != null) + localVarQueryParams.addAll(apiClient.parameterToPair("folder", folder)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @Deprecated + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call getFragmentValidateBeforeCall(String name, Integer pageNumber, Integer fragmentNumber, String withEmpty, String storage, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException("Missing the required parameter 'name' when calling getFragment(Async)"); + } + + // verify the required parameter 'pageNumber' is set + if (pageNumber == null) { + throw new ApiException("Missing the required parameter 'pageNumber' when calling getFragment(Async)"); + } + + // verify the required parameter 'fragmentNumber' is set + if (fragmentNumber == null) { + throw new ApiException("Missing the required parameter 'fragmentNumber' when calling getFragment(Async)"); + } + + + com.squareup.okhttp.Call call = getFragmentCall(name, pageNumber, fragmentNumber, withEmpty, storage, folder, progressListener, progressRequestListener); + return call; + + } + + /** + * Read page fragment. + * + * @param name (required) + * @param pageNumber (required) + * @param fragmentNumber (required) + * @param withEmpty (optional) + * @param storage (optional) + * @param folder (optional) + * @return TextItemsResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @deprecated + */ + @Deprecated + public TextItemsResponse getFragment(String name, Integer pageNumber, Integer fragmentNumber, String withEmpty, String storage, String folder) throws ApiException { + ApiResponse resp = getFragmentWithHttpInfo(name, pageNumber, fragmentNumber, withEmpty, storage, folder); + return resp.getData(); + } + + /** + * Read page fragment. + * + * @param name (required) + * @param pageNumber (required) + * @param fragmentNumber (required) + * @param withEmpty (optional) + * @param storage (optional) + * @param folder (optional) + * @return ApiResponse<TextItemsResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @deprecated + */ + @Deprecated + public ApiResponse getFragmentWithHttpInfo(String name, Integer pageNumber, Integer fragmentNumber, String withEmpty, String storage, String folder) throws ApiException { + com.squareup.okhttp.Call call = getFragmentValidateBeforeCall(name, pageNumber, fragmentNumber, withEmpty, storage, folder, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Read page fragment. (asynchronously) + * + * @param name (required) + * @param pageNumber (required) + * @param fragmentNumber (required) + * @param withEmpty (optional) + * @param storage (optional) + * @param folder (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @deprecated + */ + @Deprecated + public com.squareup.okhttp.Call getFragmentAsync(String name, Integer pageNumber, Integer fragmentNumber, String withEmpty, String storage, String folder, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = getFragmentValidateBeforeCall(name, pageNumber, fragmentNumber, withEmpty, storage, folder, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for getFragmentTextFormat + * @param name (required) + * @param pageNumber (required) + * @param fragmentNumber (required) + * @param storage (optional) + * @param folder (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @deprecated + */ + @Deprecated + public com.squareup.okhttp.Call getFragmentTextFormatCall(String name, Integer pageNumber, Integer fragmentNumber, String storage, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/pdf/{name}/pages/{pageNumber}/fragments/{fragmentNumber}/textFormat" + .replaceAll("\\{" + "name" + "\\}", apiClient.escapeString(name.toString())) + .replaceAll("\\{" + "pageNumber" + "\\}", apiClient.escapeString(pageNumber.toString())) + .replaceAll("\\{" + "fragmentNumber" + "\\}", apiClient.escapeString(fragmentNumber.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (storage != null) + localVarQueryParams.addAll(apiClient.parameterToPair("storage", storage)); + if (folder != null) + localVarQueryParams.addAll(apiClient.parameterToPair("folder", folder)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @Deprecated + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call getFragmentTextFormatValidateBeforeCall(String name, Integer pageNumber, Integer fragmentNumber, String storage, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException("Missing the required parameter 'name' when calling getFragmentTextFormat(Async)"); + } + + // verify the required parameter 'pageNumber' is set + if (pageNumber == null) { + throw new ApiException("Missing the required parameter 'pageNumber' when calling getFragmentTextFormat(Async)"); + } + + // verify the required parameter 'fragmentNumber' is set + if (fragmentNumber == null) { + throw new ApiException("Missing the required parameter 'fragmentNumber' when calling getFragmentTextFormat(Async)"); + } + + + com.squareup.okhttp.Call call = getFragmentTextFormatCall(name, pageNumber, fragmentNumber, storage, folder, progressListener, progressRequestListener); + return call; + + } + + /** + * Read page fragment text format. + * + * @param name (required) + * @param pageNumber (required) + * @param fragmentNumber (required) + * @param storage (optional) + * @param folder (optional) + * @return TextFormatResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @deprecated + */ + @Deprecated + public TextFormatResponse getFragmentTextFormat(String name, Integer pageNumber, Integer fragmentNumber, String storage, String folder) throws ApiException { + ApiResponse resp = getFragmentTextFormatWithHttpInfo(name, pageNumber, fragmentNumber, storage, folder); + return resp.getData(); + } + + /** + * Read page fragment text format. + * + * @param name (required) + * @param pageNumber (required) + * @param fragmentNumber (required) + * @param storage (optional) + * @param folder (optional) + * @return ApiResponse<TextFormatResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @deprecated + */ + @Deprecated + public ApiResponse getFragmentTextFormatWithHttpInfo(String name, Integer pageNumber, Integer fragmentNumber, String storage, String folder) throws ApiException { + com.squareup.okhttp.Call call = getFragmentTextFormatValidateBeforeCall(name, pageNumber, fragmentNumber, storage, folder, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Read page fragment text format. (asynchronously) + * + * @param name (required) + * @param pageNumber (required) + * @param fragmentNumber (required) + * @param storage (optional) + * @param folder (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @deprecated + */ + @Deprecated + public com.squareup.okhttp.Call getFragmentTextFormatAsync(String name, Integer pageNumber, Integer fragmentNumber, String storage, String folder, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = getFragmentTextFormatValidateBeforeCall(name, pageNumber, fragmentNumber, storage, folder, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for getFragments + * @param name (required) + * @param pageNumber (required) + * @param withEmpty (optional) + * @param storage (optional) + * @param folder (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @deprecated + */ + @Deprecated + public com.squareup.okhttp.Call getFragmentsCall(String name, Integer pageNumber, String withEmpty, String storage, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/pdf/{name}/pages/{pageNumber}/fragments" + .replaceAll("\\{" + "name" + "\\}", apiClient.escapeString(name.toString())) + .replaceAll("\\{" + "pageNumber" + "\\}", apiClient.escapeString(pageNumber.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (withEmpty != null) + localVarQueryParams.addAll(apiClient.parameterToPair("withEmpty", withEmpty)); + if (storage != null) + localVarQueryParams.addAll(apiClient.parameterToPair("storage", storage)); + if (folder != null) + localVarQueryParams.addAll(apiClient.parameterToPair("folder", folder)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @Deprecated + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call getFragmentsValidateBeforeCall(String name, Integer pageNumber, String withEmpty, String storage, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException("Missing the required parameter 'name' when calling getFragments(Async)"); + } + + // verify the required parameter 'pageNumber' is set + if (pageNumber == null) { + throw new ApiException("Missing the required parameter 'pageNumber' when calling getFragments(Async)"); + } + + + com.squareup.okhttp.Call call = getFragmentsCall(name, pageNumber, withEmpty, storage, folder, progressListener, progressRequestListener); + return call; + + } + + /** + * Read page fragments. + * + * @param name (required) + * @param pageNumber (required) + * @param withEmpty (optional) + * @param storage (optional) + * @param folder (optional) + * @return TextItemsResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @deprecated + */ + @Deprecated + public TextItemsResponse getFragments(String name, Integer pageNumber, String withEmpty, String storage, String folder) throws ApiException { + ApiResponse resp = getFragmentsWithHttpInfo(name, pageNumber, withEmpty, storage, folder); + return resp.getData(); + } + + /** + * Read page fragments. + * + * @param name (required) + * @param pageNumber (required) + * @param withEmpty (optional) + * @param storage (optional) + * @param folder (optional) + * @return ApiResponse<TextItemsResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @deprecated + */ + @Deprecated + public ApiResponse getFragmentsWithHttpInfo(String name, Integer pageNumber, String withEmpty, String storage, String folder) throws ApiException { + com.squareup.okhttp.Call call = getFragmentsValidateBeforeCall(name, pageNumber, withEmpty, storage, folder, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Read page fragments. (asynchronously) + * + * @param name (required) + * @param pageNumber (required) + * @param withEmpty (optional) + * @param storage (optional) + * @param folder (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @deprecated + */ + @Deprecated + public com.squareup.okhttp.Call getFragmentsAsync(String name, Integer pageNumber, String withEmpty, String storage, String folder, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = getFragmentsValidateBeforeCall(name, pageNumber, withEmpty, storage, folder, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for getHtmlInStorageToPdf + * @param srcPath Full source filename (ex. /folder1/folder2/template.zip) (required) + * @param htmlFileName Name of HTML file in ZIP. (required) + * @param height Page height (optional) + * @param width Page width (optional) + * @param isLandscape Is page landscaped (optional) + * @param marginLeft Page margin left (optional) + * @param marginBottom Page margin bottom (optional) + * @param marginRight Page margin right (optional) + * @param marginTop Page margin top (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call getHtmlInStorageToPdfCall(String srcPath, String htmlFileName, Double height, Double width, Boolean isLandscape, Double marginLeft, Double marginBottom, Double marginRight, Double marginTop, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/pdf/create/html"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (srcPath != null) + localVarQueryParams.addAll(apiClient.parameterToPair("srcPath", srcPath)); + if (htmlFileName != null) + localVarQueryParams.addAll(apiClient.parameterToPair("htmlFileName", htmlFileName)); + if (height != null) + localVarQueryParams.addAll(apiClient.parameterToPair("height", height)); + if (width != null) + localVarQueryParams.addAll(apiClient.parameterToPair("width", width)); + if (isLandscape != null) + localVarQueryParams.addAll(apiClient.parameterToPair("isLandscape", isLandscape)); + if (marginLeft != null) + localVarQueryParams.addAll(apiClient.parameterToPair("marginLeft", marginLeft)); + if (marginBottom != null) + localVarQueryParams.addAll(apiClient.parameterToPair("marginBottom", marginBottom)); + if (marginRight != null) + localVarQueryParams.addAll(apiClient.parameterToPair("marginRight", marginRight)); + if (marginTop != null) + localVarQueryParams.addAll(apiClient.parameterToPair("marginTop", marginTop)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "multipart/form-data" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call getHtmlInStorageToPdfValidateBeforeCall(String srcPath, String htmlFileName, Double height, Double width, Boolean isLandscape, Double marginLeft, Double marginBottom, Double marginRight, Double marginTop, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + // verify the required parameter 'srcPath' is set + if (srcPath == null) { + throw new ApiException("Missing the required parameter 'srcPath' when calling getHtmlInStorageToPdf(Async)"); + } + + // verify the required parameter 'htmlFileName' is set + if (htmlFileName == null) { + throw new ApiException("Missing the required parameter 'htmlFileName' when calling getHtmlInStorageToPdf(Async)"); + } + + + com.squareup.okhttp.Call call = getHtmlInStorageToPdfCall(srcPath, htmlFileName, height, width, isLandscape, marginLeft, marginBottom, marginRight, marginTop, progressListener, progressRequestListener); + return call; + + } + + /** + * Convert HTML file (located on storage) to PDF format and return resulting file in response. + * + * @param srcPath Full source filename (ex. /folder1/folder2/template.zip) (required) + * @param htmlFileName Name of HTML file in ZIP. (required) + * @param height Page height (optional) + * @param width Page width (optional) + * @param isLandscape Is page landscaped (optional) + * @param marginLeft Page margin left (optional) + * @param marginBottom Page margin bottom (optional) + * @param marginRight Page margin right (optional) + * @param marginTop Page margin top (optional) + * @return File + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public File getHtmlInStorageToPdf(String srcPath, String htmlFileName, Double height, Double width, Boolean isLandscape, Double marginLeft, Double marginBottom, Double marginRight, Double marginTop) throws ApiException { + ApiResponse resp = getHtmlInStorageToPdfWithHttpInfo(srcPath, htmlFileName, height, width, isLandscape, marginLeft, marginBottom, marginRight, marginTop); + return resp.getData(); + } + + /** + * Convert HTML file (located on storage) to PDF format and return resulting file in response. + * + * @param srcPath Full source filename (ex. /folder1/folder2/template.zip) (required) + * @param htmlFileName Name of HTML file in ZIP. (required) + * @param height Page height (optional) + * @param width Page width (optional) + * @param isLandscape Is page landscaped (optional) + * @param marginLeft Page margin left (optional) + * @param marginBottom Page margin bottom (optional) + * @param marginRight Page margin right (optional) + * @param marginTop Page margin top (optional) + * @return ApiResponse<File> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse getHtmlInStorageToPdfWithHttpInfo(String srcPath, String htmlFileName, Double height, Double width, Boolean isLandscape, Double marginLeft, Double marginBottom, Double marginRight, Double marginTop) throws ApiException { + com.squareup.okhttp.Call call = getHtmlInStorageToPdfValidateBeforeCall(srcPath, htmlFileName, height, width, isLandscape, marginLeft, marginBottom, marginRight, marginTop, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Convert HTML file (located on storage) to PDF format and return resulting file in response. (asynchronously) + * + * @param srcPath Full source filename (ex. /folder1/folder2/template.zip) (required) + * @param htmlFileName Name of HTML file in ZIP. (required) + * @param height Page height (optional) + * @param width Page width (optional) + * @param isLandscape Is page landscaped (optional) + * @param marginLeft Page margin left (optional) + * @param marginBottom Page margin bottom (optional) + * @param marginRight Page margin right (optional) + * @param marginTop Page margin top (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call getHtmlInStorageToPdfAsync(String srcPath, String htmlFileName, Double height, Double width, Boolean isLandscape, Double marginLeft, Double marginBottom, Double marginRight, Double marginTop, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = getHtmlInStorageToPdfValidateBeforeCall(srcPath, htmlFileName, height, width, isLandscape, marginLeft, marginBottom, marginRight, marginTop, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for getImage + * @param name The document name. (required) + * @param pageNumber The page number. (required) + * @param imageNumber The image format. (required) + * @param format Image format to convert, if not specified the common image data is read. (optional) + * @param width The converted image width. (optional, default to 0) + * @param height The converted image height. (optional, default to 0) + * @param storage The document storage. (optional) + * @param folder The document folder. (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call getImageCall(String name, Integer pageNumber, Integer imageNumber, String format, Integer width, Integer height, String storage, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/pdf/{name}/pages/{pageNumber}/images/{imageNumber}" + .replaceAll("\\{" + "name" + "\\}", apiClient.escapeString(name.toString())) + .replaceAll("\\{" + "pageNumber" + "\\}", apiClient.escapeString(pageNumber.toString())) + .replaceAll("\\{" + "imageNumber" + "\\}", apiClient.escapeString(imageNumber.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (format != null) + localVarQueryParams.addAll(apiClient.parameterToPair("format", format)); + if (width != null) + localVarQueryParams.addAll(apiClient.parameterToPair("width", width)); + if (height != null) + localVarQueryParams.addAll(apiClient.parameterToPair("height", height)); + if (storage != null) + localVarQueryParams.addAll(apiClient.parameterToPair("storage", storage)); + if (folder != null) + localVarQueryParams.addAll(apiClient.parameterToPair("folder", folder)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "multipart/form-data" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call getImageValidateBeforeCall(String name, Integer pageNumber, Integer imageNumber, String format, Integer width, Integer height, String storage, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException("Missing the required parameter 'name' when calling getImage(Async)"); + } + + // verify the required parameter 'pageNumber' is set + if (pageNumber == null) { + throw new ApiException("Missing the required parameter 'pageNumber' when calling getImage(Async)"); + } + + // verify the required parameter 'imageNumber' is set + if (imageNumber == null) { + throw new ApiException("Missing the required parameter 'imageNumber' when calling getImage(Async)"); + } + + + com.squareup.okhttp.Call call = getImageCall(name, pageNumber, imageNumber, format, width, height, storage, folder, progressListener, progressRequestListener); + return call; + + } + + /** + * Extract document image in format specified. + * + * @param name The document name. (required) + * @param pageNumber The page number. (required) + * @param imageNumber The image format. (required) + * @param format Image format to convert, if not specified the common image data is read. (optional) + * @param width The converted image width. (optional, default to 0) + * @param height The converted image height. (optional, default to 0) + * @param storage The document storage. (optional) + * @param folder The document folder. (optional) + * @return File + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public File getImage(String name, Integer pageNumber, Integer imageNumber, String format, Integer width, Integer height, String storage, String folder) throws ApiException { + ApiResponse resp = getImageWithHttpInfo(name, pageNumber, imageNumber, format, width, height, storage, folder); + return resp.getData(); + } + + /** + * Extract document image in format specified. + * + * @param name The document name. (required) + * @param pageNumber The page number. (required) + * @param imageNumber The image format. (required) + * @param format Image format to convert, if not specified the common image data is read. (optional) + * @param width The converted image width. (optional, default to 0) + * @param height The converted image height. (optional, default to 0) + * @param storage The document storage. (optional) + * @param folder The document folder. (optional) + * @return ApiResponse<File> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse getImageWithHttpInfo(String name, Integer pageNumber, Integer imageNumber, String format, Integer width, Integer height, String storage, String folder) throws ApiException { + com.squareup.okhttp.Call call = getImageValidateBeforeCall(name, pageNumber, imageNumber, format, width, height, storage, folder, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Extract document image in format specified. (asynchronously) + * + * @param name The document name. (required) + * @param pageNumber The page number. (required) + * @param imageNumber The image format. (required) + * @param format Image format to convert, if not specified the common image data is read. (optional) + * @param width The converted image width. (optional, default to 0) + * @param height The converted image height. (optional, default to 0) + * @param storage The document storage. (optional) + * @param folder The document folder. (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call getImageAsync(String name, Integer pageNumber, Integer imageNumber, String format, Integer width, Integer height, String storage, String folder, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = getImageValidateBeforeCall(name, pageNumber, imageNumber, format, width, height, storage, folder, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for getImages + * @param name The document name. (required) + * @param pageNumber The page number. (required) + * @param storage The document storage. (optional) + * @param folder The document folder. (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call getImagesCall(String name, Integer pageNumber, String storage, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/pdf/{name}/pages/{pageNumber}/images" + .replaceAll("\\{" + "name" + "\\}", apiClient.escapeString(name.toString())) + .replaceAll("\\{" + "pageNumber" + "\\}", apiClient.escapeString(pageNumber.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (storage != null) + localVarQueryParams.addAll(apiClient.parameterToPair("storage", storage)); + if (folder != null) + localVarQueryParams.addAll(apiClient.parameterToPair("folder", folder)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call getImagesValidateBeforeCall(String name, Integer pageNumber, String storage, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException("Missing the required parameter 'name' when calling getImages(Async)"); + } + + // verify the required parameter 'pageNumber' is set + if (pageNumber == null) { + throw new ApiException("Missing the required parameter 'pageNumber' when calling getImages(Async)"); + } + + + com.squareup.okhttp.Call call = getImagesCall(name, pageNumber, storage, folder, progressListener, progressRequestListener); + return call; + + } + + /** + * Read document images. + * + * @param name The document name. (required) + * @param pageNumber The page number. (required) + * @param storage The document storage. (optional) + * @param folder The document folder. (optional) + * @return ImagesResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ImagesResponse getImages(String name, Integer pageNumber, String storage, String folder) throws ApiException { + ApiResponse resp = getImagesWithHttpInfo(name, pageNumber, storage, folder); + return resp.getData(); + } + + /** + * Read document images. + * + * @param name The document name. (required) + * @param pageNumber The page number. (required) + * @param storage The document storage. (optional) + * @param folder The document folder. (optional) + * @return ApiResponse<ImagesResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse getImagesWithHttpInfo(String name, Integer pageNumber, String storage, String folder) throws ApiException { + com.squareup.okhttp.Call call = getImagesValidateBeforeCall(name, pageNumber, storage, folder, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Read document images. (asynchronously) + * + * @param name The document name. (required) + * @param pageNumber The page number. (required) + * @param storage The document storage. (optional) + * @param folder The document folder. (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call getImagesAsync(String name, Integer pageNumber, String storage, String folder, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = getImagesValidateBeforeCall(name, pageNumber, storage, folder, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for getLaTeXInStorageToPdf + * @param srcPath Full source filename (ex. /folder1/folder2/template.tex) (required) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call getLaTeXInStorageToPdfCall(String srcPath, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/pdf/create/latex"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (srcPath != null) + localVarQueryParams.addAll(apiClient.parameterToPair("srcPath", srcPath)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "multipart/form-data" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call getLaTeXInStorageToPdfValidateBeforeCall(String srcPath, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + // verify the required parameter 'srcPath' is set + if (srcPath == null) { + throw new ApiException("Missing the required parameter 'srcPath' when calling getLaTeXInStorageToPdf(Async)"); + } + + + com.squareup.okhttp.Call call = getLaTeXInStorageToPdfCall(srcPath, progressListener, progressRequestListener); + return call; + + } + + /** + * Convert LaTeX file (located on storage) to PDF format and return resulting file in response. + * + * @param srcPath Full source filename (ex. /folder1/folder2/template.tex) (required) + * @return File + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public File getLaTeXInStorageToPdf(String srcPath) throws ApiException { + ApiResponse resp = getLaTeXInStorageToPdfWithHttpInfo(srcPath); + return resp.getData(); + } + + /** + * Convert LaTeX file (located on storage) to PDF format and return resulting file in response. + * + * @param srcPath Full source filename (ex. /folder1/folder2/template.tex) (required) + * @return ApiResponse<File> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse getLaTeXInStorageToPdfWithHttpInfo(String srcPath) throws ApiException { + com.squareup.okhttp.Call call = getLaTeXInStorageToPdfValidateBeforeCall(srcPath, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Convert LaTeX file (located on storage) to PDF format and return resulting file in response. (asynchronously) + * + * @param srcPath Full source filename (ex. /folder1/folder2/template.tex) (required) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call getLaTeXInStorageToPdfAsync(String srcPath, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = getLaTeXInStorageToPdfValidateBeforeCall(srcPath, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for getMhtInStorageToPdf + * @param srcPath Full source filename (ex. /folder1/folder2/template.mht) (required) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call getMhtInStorageToPdfCall(String srcPath, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/pdf/create/mht"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (srcPath != null) + localVarQueryParams.addAll(apiClient.parameterToPair("srcPath", srcPath)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "multipart/form-data" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call getMhtInStorageToPdfValidateBeforeCall(String srcPath, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + // verify the required parameter 'srcPath' is set + if (srcPath == null) { + throw new ApiException("Missing the required parameter 'srcPath' when calling getMhtInStorageToPdf(Async)"); + } + + + com.squareup.okhttp.Call call = getMhtInStorageToPdfCall(srcPath, progressListener, progressRequestListener); + return call; + + } + + /** + * Convert MHT file (located on storage) to PDF format and return resulting file in response. + * + * @param srcPath Full source filename (ex. /folder1/folder2/template.mht) (required) + * @return File + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public File getMhtInStorageToPdf(String srcPath) throws ApiException { + ApiResponse resp = getMhtInStorageToPdfWithHttpInfo(srcPath); + return resp.getData(); + } + + /** + * Convert MHT file (located on storage) to PDF format and return resulting file in response. + * + * @param srcPath Full source filename (ex. /folder1/folder2/template.mht) (required) + * @return ApiResponse<File> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse getMhtInStorageToPdfWithHttpInfo(String srcPath) throws ApiException { + com.squareup.okhttp.Call call = getMhtInStorageToPdfValidateBeforeCall(srcPath, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Convert MHT file (located on storage) to PDF format and return resulting file in response. (asynchronously) + * + * @param srcPath Full source filename (ex. /folder1/folder2/template.mht) (required) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call getMhtInStorageToPdfAsync(String srcPath, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = getMhtInStorageToPdfValidateBeforeCall(srcPath, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for getPage + * @param name The document name. (required) + * @param pageNumber The page number. (required) + * @param format The format to convert if specified. (optional) + * @param width The converted image width. (optional, default to 0) + * @param height The converted image height. (optional, default to 0) + * @param storage The document storage. (optional) + * @param folder The document folder. (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call getPageCall(String name, Integer pageNumber, String format, Integer width, Integer height, String storage, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/pdf/{name}/pages/{pageNumber}" + .replaceAll("\\{" + "name" + "\\}", apiClient.escapeString(name.toString())) + .replaceAll("\\{" + "pageNumber" + "\\}", apiClient.escapeString(pageNumber.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (format != null) + localVarQueryParams.addAll(apiClient.parameterToPair("format", format)); + if (width != null) + localVarQueryParams.addAll(apiClient.parameterToPair("width", width)); + if (height != null) + localVarQueryParams.addAll(apiClient.parameterToPair("height", height)); + if (storage != null) + localVarQueryParams.addAll(apiClient.parameterToPair("storage", storage)); + if (folder != null) + localVarQueryParams.addAll(apiClient.parameterToPair("folder", folder)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call getPageValidateBeforeCall(String name, Integer pageNumber, String format, Integer width, Integer height, String storage, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException("Missing the required parameter 'name' when calling getPage(Async)"); + } + + // verify the required parameter 'pageNumber' is set + if (pageNumber == null) { + throw new ApiException("Missing the required parameter 'pageNumber' when calling getPage(Async)"); + } + + + com.squareup.okhttp.Call call = getPageCall(name, pageNumber, format, width, height, storage, folder, progressListener, progressRequestListener); + return call; + + } + + /** + * Convert document page to format specified. + * + * @param name The document name. (required) + * @param pageNumber The page number. (required) + * @param format The format to convert if specified. (optional) + * @param width The converted image width. (optional, default to 0) + * @param height The converted image height. (optional, default to 0) + * @param storage The document storage. (optional) + * @param folder The document folder. (optional) + * @return File + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public File getPage(String name, Integer pageNumber, String format, Integer width, Integer height, String storage, String folder) throws ApiException { + ApiResponse resp = getPageWithHttpInfo(name, pageNumber, format, width, height, storage, folder); + return resp.getData(); + } + + /** + * Convert document page to format specified. + * + * @param name The document name. (required) + * @param pageNumber The page number. (required) + * @param format The format to convert if specified. (optional) + * @param width The converted image width. (optional, default to 0) + * @param height The converted image height. (optional, default to 0) + * @param storage The document storage. (optional) + * @param folder The document folder. (optional) + * @return ApiResponse<File> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse getPageWithHttpInfo(String name, Integer pageNumber, String format, Integer width, Integer height, String storage, String folder) throws ApiException { + com.squareup.okhttp.Call call = getPageValidateBeforeCall(name, pageNumber, format, width, height, storage, folder, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Convert document page to format specified. (asynchronously) + * + * @param name The document name. (required) + * @param pageNumber The page number. (required) + * @param format The format to convert if specified. (optional) + * @param width The converted image width. (optional, default to 0) + * @param height The converted image height. (optional, default to 0) + * @param storage The document storage. (optional) + * @param folder The document folder. (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call getPageAsync(String name, Integer pageNumber, String format, Integer width, Integer height, String storage, String folder, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = getPageValidateBeforeCall(name, pageNumber, format, width, height, storage, folder, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for getPageAnnotation + * @param name The document name. (required) + * @param pageNumber The page number. (required) + * @param annotationNumber The annotation number. (required) + * @param storage The document storage. (optional) + * @param folder The document folder. (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call getPageAnnotationCall(String name, Integer pageNumber, Integer annotationNumber, String storage, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/pdf/{name}/pages/{pageNumber}/annotations/{annotationNumber}" + .replaceAll("\\{" + "name" + "\\}", apiClient.escapeString(name.toString())) + .replaceAll("\\{" + "pageNumber" + "\\}", apiClient.escapeString(pageNumber.toString())) + .replaceAll("\\{" + "annotationNumber" + "\\}", apiClient.escapeString(annotationNumber.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (storage != null) + localVarQueryParams.addAll(apiClient.parameterToPair("storage", storage)); + if (folder != null) + localVarQueryParams.addAll(apiClient.parameterToPair("folder", folder)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call getPageAnnotationValidateBeforeCall(String name, Integer pageNumber, Integer annotationNumber, String storage, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException("Missing the required parameter 'name' when calling getPageAnnotation(Async)"); + } + + // verify the required parameter 'pageNumber' is set + if (pageNumber == null) { + throw new ApiException("Missing the required parameter 'pageNumber' when calling getPageAnnotation(Async)"); + } + + // verify the required parameter 'annotationNumber' is set + if (annotationNumber == null) { + throw new ApiException("Missing the required parameter 'annotationNumber' when calling getPageAnnotation(Async)"); + } + + + com.squareup.okhttp.Call call = getPageAnnotationCall(name, pageNumber, annotationNumber, storage, folder, progressListener, progressRequestListener); + return call; + + } + + /** + * Read document page annotation by its number. + * + * @param name The document name. (required) + * @param pageNumber The page number. (required) + * @param annotationNumber The annotation number. (required) + * @param storage The document storage. (optional) + * @param folder The document folder. (optional) + * @return AnnotationResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public AnnotationResponse getPageAnnotation(String name, Integer pageNumber, Integer annotationNumber, String storage, String folder) throws ApiException { + ApiResponse resp = getPageAnnotationWithHttpInfo(name, pageNumber, annotationNumber, storage, folder); + return resp.getData(); + } + + /** + * Read document page annotation by its number. + * + * @param name The document name. (required) + * @param pageNumber The page number. (required) + * @param annotationNumber The annotation number. (required) + * @param storage The document storage. (optional) + * @param folder The document folder. (optional) + * @return ApiResponse<AnnotationResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse getPageAnnotationWithHttpInfo(String name, Integer pageNumber, Integer annotationNumber, String storage, String folder) throws ApiException { + com.squareup.okhttp.Call call = getPageAnnotationValidateBeforeCall(name, pageNumber, annotationNumber, storage, folder, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Read document page annotation by its number. (asynchronously) + * + * @param name The document name. (required) + * @param pageNumber The page number. (required) + * @param annotationNumber The annotation number. (required) + * @param storage The document storage. (optional) + * @param folder The document folder. (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call getPageAnnotationAsync(String name, Integer pageNumber, Integer annotationNumber, String storage, String folder, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = getPageAnnotationValidateBeforeCall(name, pageNumber, annotationNumber, storage, folder, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for getPageAnnotations + * @param name The document name. (required) + * @param pageNumber The page number. (required) + * @param storage The document storage. (optional) + * @param folder The document folder. (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call getPageAnnotationsCall(String name, Integer pageNumber, String storage, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/pdf/{name}/pages/{pageNumber}/annotations" + .replaceAll("\\{" + "name" + "\\}", apiClient.escapeString(name.toString())) + .replaceAll("\\{" + "pageNumber" + "\\}", apiClient.escapeString(pageNumber.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (storage != null) + localVarQueryParams.addAll(apiClient.parameterToPair("storage", storage)); + if (folder != null) + localVarQueryParams.addAll(apiClient.parameterToPair("folder", folder)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call getPageAnnotationsValidateBeforeCall(String name, Integer pageNumber, String storage, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException("Missing the required parameter 'name' when calling getPageAnnotations(Async)"); + } + + // verify the required parameter 'pageNumber' is set + if (pageNumber == null) { + throw new ApiException("Missing the required parameter 'pageNumber' when calling getPageAnnotations(Async)"); + } + + + com.squareup.okhttp.Call call = getPageAnnotationsCall(name, pageNumber, storage, folder, progressListener, progressRequestListener); + return call; + + } + + /** + * Read documant page annotations. + * + * @param name The document name. (required) + * @param pageNumber The page number. (required) + * @param storage The document storage. (optional) + * @param folder The document folder. (optional) + * @return AnnotationsResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public AnnotationsResponse getPageAnnotations(String name, Integer pageNumber, String storage, String folder) throws ApiException { + ApiResponse resp = getPageAnnotationsWithHttpInfo(name, pageNumber, storage, folder); + return resp.getData(); + } + + /** + * Read documant page annotations. + * + * @param name The document name. (required) + * @param pageNumber The page number. (required) + * @param storage The document storage. (optional) + * @param folder The document folder. (optional) + * @return ApiResponse<AnnotationsResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse getPageAnnotationsWithHttpInfo(String name, Integer pageNumber, String storage, String folder) throws ApiException { + com.squareup.okhttp.Call call = getPageAnnotationsValidateBeforeCall(name, pageNumber, storage, folder, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Read documant page annotations. (asynchronously) + * + * @param name The document name. (required) + * @param pageNumber The page number. (required) + * @param storage The document storage. (optional) + * @param folder The document folder. (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call getPageAnnotationsAsync(String name, Integer pageNumber, String storage, String folder, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = getPageAnnotationsValidateBeforeCall(name, pageNumber, storage, folder, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for getPageLinkAnnotationByIndex + * @param name The document name. (required) + * @param pageNumber The page number. (required) + * @param linkIndex The link index. (required) + * @param storage The document storage. (optional) + * @param folder The document folder. (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call getPageLinkAnnotationByIndexCall(String name, Integer pageNumber, Integer linkIndex, String storage, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/pdf/{name}/pages/{pageNumber}/links/{linkIndex}" + .replaceAll("\\{" + "name" + "\\}", apiClient.escapeString(name.toString())) + .replaceAll("\\{" + "pageNumber" + "\\}", apiClient.escapeString(pageNumber.toString())) + .replaceAll("\\{" + "linkIndex" + "\\}", apiClient.escapeString(linkIndex.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (storage != null) + localVarQueryParams.addAll(apiClient.parameterToPair("storage", storage)); + if (folder != null) + localVarQueryParams.addAll(apiClient.parameterToPair("folder", folder)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call getPageLinkAnnotationByIndexValidateBeforeCall(String name, Integer pageNumber, Integer linkIndex, String storage, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException("Missing the required parameter 'name' when calling getPageLinkAnnotationByIndex(Async)"); + } + + // verify the required parameter 'pageNumber' is set + if (pageNumber == null) { + throw new ApiException("Missing the required parameter 'pageNumber' when calling getPageLinkAnnotationByIndex(Async)"); + } + + // verify the required parameter 'linkIndex' is set + if (linkIndex == null) { + throw new ApiException("Missing the required parameter 'linkIndex' when calling getPageLinkAnnotationByIndex(Async)"); + } + + + com.squareup.okhttp.Call call = getPageLinkAnnotationByIndexCall(name, pageNumber, linkIndex, storage, folder, progressListener, progressRequestListener); + return call; + + } + + /** + * Read document page link annotation by its index. + * + * @param name The document name. (required) + * @param pageNumber The page number. (required) + * @param linkIndex The link index. (required) + * @param storage The document storage. (optional) + * @param folder The document folder. (optional) + * @return LinkAnnotationResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public LinkAnnotationResponse getPageLinkAnnotationByIndex(String name, Integer pageNumber, Integer linkIndex, String storage, String folder) throws ApiException { + ApiResponse resp = getPageLinkAnnotationByIndexWithHttpInfo(name, pageNumber, linkIndex, storage, folder); + return resp.getData(); + } + + /** + * Read document page link annotation by its index. + * + * @param name The document name. (required) + * @param pageNumber The page number. (required) + * @param linkIndex The link index. (required) + * @param storage The document storage. (optional) + * @param folder The document folder. (optional) + * @return ApiResponse<LinkAnnotationResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse getPageLinkAnnotationByIndexWithHttpInfo(String name, Integer pageNumber, Integer linkIndex, String storage, String folder) throws ApiException { + com.squareup.okhttp.Call call = getPageLinkAnnotationByIndexValidateBeforeCall(name, pageNumber, linkIndex, storage, folder, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Read document page link annotation by its index. (asynchronously) + * + * @param name The document name. (required) + * @param pageNumber The page number. (required) + * @param linkIndex The link index. (required) + * @param storage The document storage. (optional) + * @param folder The document folder. (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call getPageLinkAnnotationByIndexAsync(String name, Integer pageNumber, Integer linkIndex, String storage, String folder, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = getPageLinkAnnotationByIndexValidateBeforeCall(name, pageNumber, linkIndex, storage, folder, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for getPageLinkAnnotations + * @param name The document name. (required) + * @param pageNumber The page number. (required) + * @param storage The document storage. (optional) + * @param folder The document folder. (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call getPageLinkAnnotationsCall(String name, Integer pageNumber, String storage, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/pdf/{name}/pages/{pageNumber}/links" + .replaceAll("\\{" + "name" + "\\}", apiClient.escapeString(name.toString())) + .replaceAll("\\{" + "pageNumber" + "\\}", apiClient.escapeString(pageNumber.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (storage != null) + localVarQueryParams.addAll(apiClient.parameterToPair("storage", storage)); + if (folder != null) + localVarQueryParams.addAll(apiClient.parameterToPair("folder", folder)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call getPageLinkAnnotationsValidateBeforeCall(String name, Integer pageNumber, String storage, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException("Missing the required parameter 'name' when calling getPageLinkAnnotations(Async)"); + } + + // verify the required parameter 'pageNumber' is set + if (pageNumber == null) { + throw new ApiException("Missing the required parameter 'pageNumber' when calling getPageLinkAnnotations(Async)"); + } + + + com.squareup.okhttp.Call call = getPageLinkAnnotationsCall(name, pageNumber, storage, folder, progressListener, progressRequestListener); + return call; + + } + + /** + * Read document page link annotations. + * + * @param name The document name. (required) + * @param pageNumber The page number. (required) + * @param storage The document storage. (optional) + * @param folder The document folder. (optional) + * @return LinkAnnotationsResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public LinkAnnotationsResponse getPageLinkAnnotations(String name, Integer pageNumber, String storage, String folder) throws ApiException { + ApiResponse resp = getPageLinkAnnotationsWithHttpInfo(name, pageNumber, storage, folder); + return resp.getData(); + } + + /** + * Read document page link annotations. + * + * @param name The document name. (required) + * @param pageNumber The page number. (required) + * @param storage The document storage. (optional) + * @param folder The document folder. (optional) + * @return ApiResponse<LinkAnnotationsResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse getPageLinkAnnotationsWithHttpInfo(String name, Integer pageNumber, String storage, String folder) throws ApiException { + com.squareup.okhttp.Call call = getPageLinkAnnotationsValidateBeforeCall(name, pageNumber, storage, folder, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Read document page link annotations. (asynchronously) + * + * @param name The document name. (required) + * @param pageNumber The page number. (required) + * @param storage The document storage. (optional) + * @param folder The document folder. (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call getPageLinkAnnotationsAsync(String name, Integer pageNumber, String storage, String folder, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = getPageLinkAnnotationsValidateBeforeCall(name, pageNumber, storage, folder, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for getPageText + * @param name The document name. (required) + * @param pageNumber Number of page (starting from 1). (required) + * @param X (required) + * @param Y (required) + * @param width (required) + * @param height (required) + * @param format List of formats for search. (optional) + * @param regex Formats are specified as a regular expression. (optional) + * @param splitRects Split result fragments (default is true). (optional) + * @param folder The document folder. (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call getPageTextCall(String name, Integer pageNumber, Integer X, Integer Y, Integer width, Integer height, List format, String regex, Boolean splitRects, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/pdf/{name}/pages/{pageNumber}/text" + .replaceAll("\\{" + "name" + "\\}", apiClient.escapeString(name.toString())) + .replaceAll("\\{" + "pageNumber" + "\\}", apiClient.escapeString(pageNumber.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (format != null) + localVarCollectionQueryParams.addAll(apiClient.parameterToPairs("multi", "format", format)); + if (regex != null) + localVarQueryParams.addAll(apiClient.parameterToPair("regex", regex)); + if (X != null) + localVarQueryParams.addAll(apiClient.parameterToPair("X", X)); + if (Y != null) + localVarQueryParams.addAll(apiClient.parameterToPair("Y", Y)); + if (width != null) + localVarQueryParams.addAll(apiClient.parameterToPair("Width", width)); + if (height != null) + localVarQueryParams.addAll(apiClient.parameterToPair("Height", height)); + if (splitRects != null) + localVarQueryParams.addAll(apiClient.parameterToPair("splitRects", splitRects)); + if (folder != null) + localVarQueryParams.addAll(apiClient.parameterToPair("folder", folder)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call getPageTextValidateBeforeCall(String name, Integer pageNumber, Integer X, Integer Y, Integer width, Integer height, List format, String regex, Boolean splitRects, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException("Missing the required parameter 'name' when calling getPageText(Async)"); + } + + // verify the required parameter 'pageNumber' is set + if (pageNumber == null) { + throw new ApiException("Missing the required parameter 'pageNumber' when calling getPageText(Async)"); + } + + // verify the required parameter 'X' is set + if (X == null) { + throw new ApiException("Missing the required parameter 'X' when calling getPageText(Async)"); + } + + // verify the required parameter 'Y' is set + if (Y == null) { + throw new ApiException("Missing the required parameter 'Y' when calling getPageText(Async)"); + } + + // verify the required parameter 'width' is set + if (width == null) { + throw new ApiException("Missing the required parameter 'width' when calling getPageText(Async)"); + } + + // verify the required parameter 'height' is set + if (height == null) { + throw new ApiException("Missing the required parameter 'height' when calling getPageText(Async)"); + } + + + com.squareup.okhttp.Call call = getPageTextCall(name, pageNumber, X, Y, width, height, format, regex, splitRects, folder, progressListener, progressRequestListener); + return call; + + } + + /** + * Read page text items. + * + * @param name The document name. (required) + * @param pageNumber Number of page (starting from 1). (required) + * @param X (required) + * @param Y (required) + * @param width (required) + * @param height (required) + * @param format List of formats for search. (optional) + * @param regex Formats are specified as a regular expression. (optional) + * @param splitRects Split result fragments (default is true). (optional) + * @param folder The document folder. (optional) + * @return TextRectsResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public TextRectsResponse getPageText(String name, Integer pageNumber, Integer X, Integer Y, Integer width, Integer height, List format, String regex, Boolean splitRects, String folder) throws ApiException { + ApiResponse resp = getPageTextWithHttpInfo(name, pageNumber, X, Y, width, height, format, regex, splitRects, folder); + return resp.getData(); + } + + /** + * Read page text items. + * + * @param name The document name. (required) + * @param pageNumber Number of page (starting from 1). (required) + * @param X (required) + * @param Y (required) + * @param width (required) + * @param height (required) + * @param format List of formats for search. (optional) + * @param regex Formats are specified as a regular expression. (optional) + * @param splitRects Split result fragments (default is true). (optional) + * @param folder The document folder. (optional) + * @return ApiResponse<TextRectsResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse getPageTextWithHttpInfo(String name, Integer pageNumber, Integer X, Integer Y, Integer width, Integer height, List format, String regex, Boolean splitRects, String folder) throws ApiException { + com.squareup.okhttp.Call call = getPageTextValidateBeforeCall(name, pageNumber, X, Y, width, height, format, regex, splitRects, folder, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Read page text items. (asynchronously) + * + * @param name The document name. (required) + * @param pageNumber Number of page (starting from 1). (required) + * @param X (required) + * @param Y (required) + * @param width (required) + * @param height (required) + * @param format List of formats for search. (optional) + * @param regex Formats are specified as a regular expression. (optional) + * @param splitRects Split result fragments (default is true). (optional) + * @param folder The document folder. (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call getPageTextAsync(String name, Integer pageNumber, Integer X, Integer Y, Integer width, Integer height, List format, String regex, Boolean splitRects, String folder, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = getPageTextValidateBeforeCall(name, pageNumber, X, Y, width, height, format, regex, splitRects, folder, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for getPageTextItems + * @param name (required) + * @param pageNumber (required) + * @param withEmpty (optional) + * @param storage (optional) + * @param folder (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @deprecated + */ + @Deprecated + public com.squareup.okhttp.Call getPageTextItemsCall(String name, Integer pageNumber, String withEmpty, String storage, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/pdf/{name}/pages/{pageNumber}/textItems" + .replaceAll("\\{" + "name" + "\\}", apiClient.escapeString(name.toString())) + .replaceAll("\\{" + "pageNumber" + "\\}", apiClient.escapeString(pageNumber.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (withEmpty != null) + localVarQueryParams.addAll(apiClient.parameterToPair("withEmpty", withEmpty)); + if (storage != null) + localVarQueryParams.addAll(apiClient.parameterToPair("storage", storage)); + if (folder != null) + localVarQueryParams.addAll(apiClient.parameterToPair("folder", folder)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @Deprecated + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call getPageTextItemsValidateBeforeCall(String name, Integer pageNumber, String withEmpty, String storage, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException("Missing the required parameter 'name' when calling getPageTextItems(Async)"); + } + + // verify the required parameter 'pageNumber' is set + if (pageNumber == null) { + throw new ApiException("Missing the required parameter 'pageNumber' when calling getPageTextItems(Async)"); + } + + + com.squareup.okhttp.Call call = getPageTextItemsCall(name, pageNumber, withEmpty, storage, folder, progressListener, progressRequestListener); + return call; + + } + + /** + * Read page text items. + * + * @param name (required) + * @param pageNumber (required) + * @param withEmpty (optional) + * @param storage (optional) + * @param folder (optional) + * @return TextItemsResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @deprecated + */ + @Deprecated + public TextItemsResponse getPageTextItems(String name, Integer pageNumber, String withEmpty, String storage, String folder) throws ApiException { + ApiResponse resp = getPageTextItemsWithHttpInfo(name, pageNumber, withEmpty, storage, folder); + return resp.getData(); + } + + /** + * Read page text items. + * + * @param name (required) + * @param pageNumber (required) + * @param withEmpty (optional) + * @param storage (optional) + * @param folder (optional) + * @return ApiResponse<TextItemsResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @deprecated + */ + @Deprecated + public ApiResponse getPageTextItemsWithHttpInfo(String name, Integer pageNumber, String withEmpty, String storage, String folder) throws ApiException { + com.squareup.okhttp.Call call = getPageTextItemsValidateBeforeCall(name, pageNumber, withEmpty, storage, folder, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Read page text items. (asynchronously) + * + * @param name (required) + * @param pageNumber (required) + * @param withEmpty (optional) + * @param storage (optional) + * @param folder (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @deprecated + */ + @Deprecated + public com.squareup.okhttp.Call getPageTextItemsAsync(String name, Integer pageNumber, String withEmpty, String storage, String folder, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = getPageTextItemsValidateBeforeCall(name, pageNumber, withEmpty, storage, folder, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for getPages + * @param name The document name. (required) + * @param storage The document storage. (optional) + * @param folder The document folder. (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call getPagesCall(String name, String storage, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/pdf/{name}/pages" + .replaceAll("\\{" + "name" + "\\}", apiClient.escapeString(name.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (storage != null) + localVarQueryParams.addAll(apiClient.parameterToPair("storage", storage)); + if (folder != null) + localVarQueryParams.addAll(apiClient.parameterToPair("folder", folder)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call getPagesValidateBeforeCall(String name, String storage, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException("Missing the required parameter 'name' when calling getPages(Async)"); + } + + + com.squareup.okhttp.Call call = getPagesCall(name, storage, folder, progressListener, progressRequestListener); + return call; + + } + + /** + * Read document pages info. + * + * @param name The document name. (required) + * @param storage The document storage. (optional) + * @param folder The document folder. (optional) + * @return DocumentPagesResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public DocumentPagesResponse getPages(String name, String storage, String folder) throws ApiException { + ApiResponse resp = getPagesWithHttpInfo(name, storage, folder); + return resp.getData(); + } + + /** + * Read document pages info. + * + * @param name The document name. (required) + * @param storage The document storage. (optional) + * @param folder The document folder. (optional) + * @return ApiResponse<DocumentPagesResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse getPagesWithHttpInfo(String name, String storage, String folder) throws ApiException { + com.squareup.okhttp.Call call = getPagesValidateBeforeCall(name, storage, folder, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Read document pages info. (asynchronously) + * + * @param name The document name. (required) + * @param storage The document storage. (optional) + * @param folder The document folder. (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call getPagesAsync(String name, String storage, String folder, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = getPagesValidateBeforeCall(name, storage, folder, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for getPclInStorageToPdf + * @param srcPath Full source filename (ex. /folder1/folder2/template.pcl) (required) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call getPclInStorageToPdfCall(String srcPath, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/pdf/create/pcl"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (srcPath != null) + localVarQueryParams.addAll(apiClient.parameterToPair("srcPath", srcPath)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "multipart/form-data" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call getPclInStorageToPdfValidateBeforeCall(String srcPath, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + // verify the required parameter 'srcPath' is set + if (srcPath == null) { + throw new ApiException("Missing the required parameter 'srcPath' when calling getPclInStorageToPdf(Async)"); + } + + + com.squareup.okhttp.Call call = getPclInStorageToPdfCall(srcPath, progressListener, progressRequestListener); + return call; + + } + + /** + * Convert PCL file (located on storage) to PDF format and return resulting file in response. + * + * @param srcPath Full source filename (ex. /folder1/folder2/template.pcl) (required) + * @return File + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public File getPclInStorageToPdf(String srcPath) throws ApiException { + ApiResponse resp = getPclInStorageToPdfWithHttpInfo(srcPath); + return resp.getData(); + } + + /** + * Convert PCL file (located on storage) to PDF format and return resulting file in response. + * + * @param srcPath Full source filename (ex. /folder1/folder2/template.pcl) (required) + * @return ApiResponse<File> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse getPclInStorageToPdfWithHttpInfo(String srcPath) throws ApiException { + com.squareup.okhttp.Call call = getPclInStorageToPdfValidateBeforeCall(srcPath, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Convert PCL file (located on storage) to PDF format and return resulting file in response. (asynchronously) + * + * @param srcPath Full source filename (ex. /folder1/folder2/template.pcl) (required) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call getPclInStorageToPdfAsync(String srcPath, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = getPclInStorageToPdfValidateBeforeCall(srcPath, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for getPdfInStorageToDoc + * @param name The document name. (required) + * @param addReturnToLineEnd Add return to line end. (optional) + * @param format Allows to specify .doc or .docx file format. (optional) + * @param imageResolutionX Image resolution X. (optional) + * @param imageResolutionY Image resolution Y. (optional) + * @param maxDistanceBetweenTextLines Max distance between text lines. (optional) + * @param mode Allows to control how a PDF document is converted into a word processing document. (optional) + * @param recognizeBullets Recognize bullets. (optional) + * @param relativeHorizontalProximity Relative horizontal proximity. (optional) + * @param folder The document folder. (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call getPdfInStorageToDocCall(String name, Boolean addReturnToLineEnd, String format, Integer imageResolutionX, Integer imageResolutionY, Integer maxDistanceBetweenTextLines, String mode, Boolean recognizeBullets, Double relativeHorizontalProximity, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/pdf/{name}/convert/doc" + .replaceAll("\\{" + "name" + "\\}", apiClient.escapeString(name.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (addReturnToLineEnd != null) + localVarQueryParams.addAll(apiClient.parameterToPair("addReturnToLineEnd", addReturnToLineEnd)); + if (format != null) + localVarQueryParams.addAll(apiClient.parameterToPair("format", format)); + if (imageResolutionX != null) + localVarQueryParams.addAll(apiClient.parameterToPair("imageResolutionX", imageResolutionX)); + if (imageResolutionY != null) + localVarQueryParams.addAll(apiClient.parameterToPair("imageResolutionY", imageResolutionY)); + if (maxDistanceBetweenTextLines != null) + localVarQueryParams.addAll(apiClient.parameterToPair("maxDistanceBetweenTextLines", maxDistanceBetweenTextLines)); + if (mode != null) + localVarQueryParams.addAll(apiClient.parameterToPair("mode", mode)); + if (recognizeBullets != null) + localVarQueryParams.addAll(apiClient.parameterToPair("recognizeBullets", recognizeBullets)); + if (relativeHorizontalProximity != null) + localVarQueryParams.addAll(apiClient.parameterToPair("relativeHorizontalProximity", relativeHorizontalProximity)); + if (folder != null) + localVarQueryParams.addAll(apiClient.parameterToPair("folder", folder)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "multipart/form-data" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call getPdfInStorageToDocValidateBeforeCall(String name, Boolean addReturnToLineEnd, String format, Integer imageResolutionX, Integer imageResolutionY, Integer maxDistanceBetweenTextLines, String mode, Boolean recognizeBullets, Double relativeHorizontalProximity, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException("Missing the required parameter 'name' when calling getPdfInStorageToDoc(Async)"); + } + + + com.squareup.okhttp.Call call = getPdfInStorageToDocCall(name, addReturnToLineEnd, format, imageResolutionX, imageResolutionY, maxDistanceBetweenTextLines, mode, recognizeBullets, relativeHorizontalProximity, folder, progressListener, progressRequestListener); + return call; + + } + + /** + * Converts PDF document (located on storage) to DOC format and returns resulting file in response content + * + * @param name The document name. (required) + * @param addReturnToLineEnd Add return to line end. (optional) + * @param format Allows to specify .doc or .docx file format. (optional) + * @param imageResolutionX Image resolution X. (optional) + * @param imageResolutionY Image resolution Y. (optional) + * @param maxDistanceBetweenTextLines Max distance between text lines. (optional) + * @param mode Allows to control how a PDF document is converted into a word processing document. (optional) + * @param recognizeBullets Recognize bullets. (optional) + * @param relativeHorizontalProximity Relative horizontal proximity. (optional) + * @param folder The document folder. (optional) + * @return File + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public File getPdfInStorageToDoc(String name, Boolean addReturnToLineEnd, String format, Integer imageResolutionX, Integer imageResolutionY, Integer maxDistanceBetweenTextLines, String mode, Boolean recognizeBullets, Double relativeHorizontalProximity, String folder) throws ApiException { + ApiResponse resp = getPdfInStorageToDocWithHttpInfo(name, addReturnToLineEnd, format, imageResolutionX, imageResolutionY, maxDistanceBetweenTextLines, mode, recognizeBullets, relativeHorizontalProximity, folder); + return resp.getData(); + } + + /** + * Converts PDF document (located on storage) to DOC format and returns resulting file in response content + * + * @param name The document name. (required) + * @param addReturnToLineEnd Add return to line end. (optional) + * @param format Allows to specify .doc or .docx file format. (optional) + * @param imageResolutionX Image resolution X. (optional) + * @param imageResolutionY Image resolution Y. (optional) + * @param maxDistanceBetweenTextLines Max distance between text lines. (optional) + * @param mode Allows to control how a PDF document is converted into a word processing document. (optional) + * @param recognizeBullets Recognize bullets. (optional) + * @param relativeHorizontalProximity Relative horizontal proximity. (optional) + * @param folder The document folder. (optional) + * @return ApiResponse<File> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse getPdfInStorageToDocWithHttpInfo(String name, Boolean addReturnToLineEnd, String format, Integer imageResolutionX, Integer imageResolutionY, Integer maxDistanceBetweenTextLines, String mode, Boolean recognizeBullets, Double relativeHorizontalProximity, String folder) throws ApiException { + com.squareup.okhttp.Call call = getPdfInStorageToDocValidateBeforeCall(name, addReturnToLineEnd, format, imageResolutionX, imageResolutionY, maxDistanceBetweenTextLines, mode, recognizeBullets, relativeHorizontalProximity, folder, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Converts PDF document (located on storage) to DOC format and returns resulting file in response content (asynchronously) + * + * @param name The document name. (required) + * @param addReturnToLineEnd Add return to line end. (optional) + * @param format Allows to specify .doc or .docx file format. (optional) + * @param imageResolutionX Image resolution X. (optional) + * @param imageResolutionY Image resolution Y. (optional) + * @param maxDistanceBetweenTextLines Max distance between text lines. (optional) + * @param mode Allows to control how a PDF document is converted into a word processing document. (optional) + * @param recognizeBullets Recognize bullets. (optional) + * @param relativeHorizontalProximity Relative horizontal proximity. (optional) + * @param folder The document folder. (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call getPdfInStorageToDocAsync(String name, Boolean addReturnToLineEnd, String format, Integer imageResolutionX, Integer imageResolutionY, Integer maxDistanceBetweenTextLines, String mode, Boolean recognizeBullets, Double relativeHorizontalProximity, String folder, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = getPdfInStorageToDocValidateBeforeCall(name, addReturnToLineEnd, format, imageResolutionX, imageResolutionY, maxDistanceBetweenTextLines, mode, recognizeBullets, relativeHorizontalProximity, folder, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for getPdfInStorageToEpub + * @param name The document name. (required) + * @param contentRecognitionMode Рroperty tunes conversion for this or that desirable method of recognition of content. (optional) + * @param folder The document folder. (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call getPdfInStorageToEpubCall(String name, String contentRecognitionMode, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/pdf/{name}/convert/epub" + .replaceAll("\\{" + "name" + "\\}", apiClient.escapeString(name.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (contentRecognitionMode != null) + localVarQueryParams.addAll(apiClient.parameterToPair("contentRecognitionMode", contentRecognitionMode)); + if (folder != null) + localVarQueryParams.addAll(apiClient.parameterToPair("folder", folder)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "multipart/form-data" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call getPdfInStorageToEpubValidateBeforeCall(String name, String contentRecognitionMode, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException("Missing the required parameter 'name' when calling getPdfInStorageToEpub(Async)"); + } + + + com.squareup.okhttp.Call call = getPdfInStorageToEpubCall(name, contentRecognitionMode, folder, progressListener, progressRequestListener); + return call; + + } + + /** + * Converts PDF document (located on storage) to EPUB format and returns resulting file in response content + * + * @param name The document name. (required) + * @param contentRecognitionMode Рroperty tunes conversion for this or that desirable method of recognition of content. (optional) + * @param folder The document folder. (optional) + * @return File + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public File getPdfInStorageToEpub(String name, String contentRecognitionMode, String folder) throws ApiException { + ApiResponse resp = getPdfInStorageToEpubWithHttpInfo(name, contentRecognitionMode, folder); + return resp.getData(); + } + + /** + * Converts PDF document (located on storage) to EPUB format and returns resulting file in response content + * + * @param name The document name. (required) + * @param contentRecognitionMode Рroperty tunes conversion for this or that desirable method of recognition of content. (optional) + * @param folder The document folder. (optional) + * @return ApiResponse<File> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse getPdfInStorageToEpubWithHttpInfo(String name, String contentRecognitionMode, String folder) throws ApiException { + com.squareup.okhttp.Call call = getPdfInStorageToEpubValidateBeforeCall(name, contentRecognitionMode, folder, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Converts PDF document (located on storage) to EPUB format and returns resulting file in response content (asynchronously) + * + * @param name The document name. (required) + * @param contentRecognitionMode Рroperty tunes conversion for this or that desirable method of recognition of content. (optional) + * @param folder The document folder. (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call getPdfInStorageToEpubAsync(String name, String contentRecognitionMode, String folder, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = getPdfInStorageToEpubValidateBeforeCall(name, contentRecognitionMode, folder, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for getPdfInStorageToHtml + * @param name The document name. (required) + * @param additionalMarginWidthInPoints Defines width of margin that will be forcibly left around that output HTML-areas. (optional) + * @param compressSvgGraphicsIfAny The flag that indicates whether found SVG graphics(if any) will be compressed(zipped) into SVGZ format during saving. (optional) + * @param convertMarkedContentToLayers If attribute ConvertMarkedContentToLayers set to true then an all elements inside a PDF marked content (layer) will be put into an HTML div with \"data-pdflayer\" attribute specifying a layer name. This layer name will be extracted from optional properties of PDF marked content. If this attribute is false (by default) then no any layers will be created from PDF marked content. (optional) + * @param defaultFontName Specifies the name of an installed font which is used to substitute any document font that is not embedded and not installed in the system. If null then default substitution font is used. (optional) + * @param documentType Result document type. (optional) + * @param fixedLayout The value indicating whether that HTML is created as fixed layout. (optional) + * @param imageResolution Resolution for image rendering. (optional) + * @param minimalLineWidth This attribute sets minimal width of graphic path line. If thickness of line is less than 1px Adobe Acrobat rounds it to this value. So this attribute can be used to emulate this behavior for HTML browsers. (optional) + * @param preventGlyphsGrouping This attribute switch on the mode when text glyphs will not be grouped into words and strings This mode allows to keep maximum precision during positioning of glyphs on the page and it can be used for conversion documents with music notes or glyphs that should be placed separately each other. This parameter will be applied to document only when the value of FixedLayout attribute is true. (optional) + * @param splitCssIntoPages When multipage-mode selected(i.e 'SplitIntoPages' is 'true'), then this attribute defines whether should be created separate CSS-file for each result HTML page. (optional) + * @param splitIntoPages The flag that indicates whether each page of source document will be converted into it's own target HTML document, i.e whether result HTML will be splitted into several HTML-pages. (optional) + * @param useZOrder If attribute UseZORder set to true, graphics and text are added to resultant HTML document accordingly Z-order in original PDF document. If this attribute is false all graphics is put as single layer which may cause some unnecessary effects for overlapped objects. (optional) + * @param antialiasingProcessing The parameter defines required antialiasing measures during conversion of compound background images from PDF to HTML. (optional) + * @param cssClassNamesPrefix When PDFtoHTML converter generates result CSSs, CSS class names (something like \".stl_01 {}\" ... \".stl_NN {}) are generated and used in result CSS. This property allows forcibly set class name prefix. (optional) + * @param explicitListOfSavedPages With this property You can explicitely define what pages of document should be converted. Pages in this list must have 1-based numbers. I.e. valid numbers of pages must be taken from range (1...[NumberOfPagesInConvertedDocument]) Order of appearing of pages in this list does not affect their order in result HTML page(s) - in result pages allways will go in order in which they are present in source PDF. (optional) + * @param fontEncodingStrategy Defines encoding special rule to tune PDF decoding for current document. (optional) + * @param fontSavingMode Defines font saving mode that will be used during saving of PDF to desirable format. (optional) + * @param htmlMarkupGenerationMode Sometimes specific reqirments to generation of HTML markup are present. This parameter defines HTML preparing modes that can be used during conversion of PDF to HTML to match such specific requirments. (optional) + * @param lettersPositioningMethod The mode of positioning of letters in words in result HTML. (optional) + * @param pagesFlowTypeDependsOnViewersScreenSize If attribute 'SplitOnPages=false', than whole HTML representing all input PDF pages will be put into one big result HTML file. This flag defines whether result HTML will be generated in such way that flow of areas that represent PDF pages in result HTML will depend on screen resolution of viewer. (optional) + * @param partsEmbeddingMode It defines whether referenced files (HTML, Fonts,Images, CSSes) will be embedded into main HTML file or will be generated as apart binary entities. (optional) + * @param rasterImagesSavingMode Converted PDF can contain raster images This parameter defines how they should be handled during conversion of PDF to HTML. (optional) + * @param removeEmptyAreasOnTopAndBottom Defines whether in created HTML will be removed top and bottom empty area without any content (if any). (optional) + * @param saveShadowedTextsAsTransparentTexts Pdf can contain texts that are shadowed by another elements (f.e. by images) but can be selected to clipboard in Acrobat Reader (usually it happen when document contains images and OCRed texts extracted from it). This settings tells to converter whether we need save such texts as transparent selectable texts in result HTML to mimic behaviour of Acrobat Reader (othervise such texts are usually saved as hidden, not available for copying to clipboard). (optional) + * @param saveTransparentTexts Pdf can contain transparent texts that can be selected to clipboard (usually it happen when document contains images and OCRed texts extracted from it). This settings tells to converter whether we need save such texts as transparent selectable texts in result HTML. (optional) + * @param specialFolderForAllImages The path to directory to which must be saved any images if they are encountered during saving of document as HTML. If parameter is empty or null then image files(if any) wil be saved together with other files linked to HTML It does not affect anything if CustomImageSavingStrategy property was successfully used to process relevant image file. (optional) + * @param specialFolderForSvgImages The path to directory to which must be saved only SVG-images if they are encountered during saving of document as HTML. If parameter is empty or null then SVG files(if any) wil be saved together with other image-files (near to output file) or in special folder for images (if it specified in SpecialImagesFolderIfAny option). It does not affect anything if CustomImageSavingStrategy property was successfully used to process relevant image file. (optional) + * @param trySaveTextUnderliningAndStrikeoutingInCss PDF itself does not contain underlining markers for texts. It emulated with line situated under text. This option allows converter try guess that this or that line is a text's underlining and put this info into CSS instead of drawing of underlining graphically. (optional) + * @param folder The document folder. (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call getPdfInStorageToHtmlCall(String name, Integer additionalMarginWidthInPoints, Boolean compressSvgGraphicsIfAny, Boolean convertMarkedContentToLayers, String defaultFontName, String documentType, Boolean fixedLayout, Integer imageResolution, Integer minimalLineWidth, Boolean preventGlyphsGrouping, Boolean splitCssIntoPages, Boolean splitIntoPages, Boolean useZOrder, String antialiasingProcessing, String cssClassNamesPrefix, List explicitListOfSavedPages, String fontEncodingStrategy, String fontSavingMode, String htmlMarkupGenerationMode, String lettersPositioningMethod, Boolean pagesFlowTypeDependsOnViewersScreenSize, String partsEmbeddingMode, String rasterImagesSavingMode, Boolean removeEmptyAreasOnTopAndBottom, Boolean saveShadowedTextsAsTransparentTexts, Boolean saveTransparentTexts, String specialFolderForAllImages, String specialFolderForSvgImages, Boolean trySaveTextUnderliningAndStrikeoutingInCss, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/pdf/{name}/convert/html" + .replaceAll("\\{" + "name" + "\\}", apiClient.escapeString(name.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (additionalMarginWidthInPoints != null) + localVarQueryParams.addAll(apiClient.parameterToPair("additionalMarginWidthInPoints", additionalMarginWidthInPoints)); + if (compressSvgGraphicsIfAny != null) + localVarQueryParams.addAll(apiClient.parameterToPair("compressSvgGraphicsIfAny", compressSvgGraphicsIfAny)); + if (convertMarkedContentToLayers != null) + localVarQueryParams.addAll(apiClient.parameterToPair("convertMarkedContentToLayers", convertMarkedContentToLayers)); + if (defaultFontName != null) + localVarQueryParams.addAll(apiClient.parameterToPair("defaultFontName", defaultFontName)); + if (documentType != null) + localVarQueryParams.addAll(apiClient.parameterToPair("documentType", documentType)); + if (fixedLayout != null) + localVarQueryParams.addAll(apiClient.parameterToPair("fixedLayout", fixedLayout)); + if (imageResolution != null) + localVarQueryParams.addAll(apiClient.parameterToPair("imageResolution", imageResolution)); + if (minimalLineWidth != null) + localVarQueryParams.addAll(apiClient.parameterToPair("minimalLineWidth", minimalLineWidth)); + if (preventGlyphsGrouping != null) + localVarQueryParams.addAll(apiClient.parameterToPair("preventGlyphsGrouping", preventGlyphsGrouping)); + if (splitCssIntoPages != null) + localVarQueryParams.addAll(apiClient.parameterToPair("splitCssIntoPages", splitCssIntoPages)); + if (splitIntoPages != null) + localVarQueryParams.addAll(apiClient.parameterToPair("splitIntoPages", splitIntoPages)); + if (useZOrder != null) + localVarQueryParams.addAll(apiClient.parameterToPair("useZOrder", useZOrder)); + if (antialiasingProcessing != null) + localVarQueryParams.addAll(apiClient.parameterToPair("antialiasingProcessing", antialiasingProcessing)); + if (cssClassNamesPrefix != null) + localVarQueryParams.addAll(apiClient.parameterToPair("cssClassNamesPrefix", cssClassNamesPrefix)); + if (explicitListOfSavedPages != null) + localVarCollectionQueryParams.addAll(apiClient.parameterToPairs("multi", "explicitListOfSavedPages", explicitListOfSavedPages)); + if (fontEncodingStrategy != null) + localVarQueryParams.addAll(apiClient.parameterToPair("fontEncodingStrategy", fontEncodingStrategy)); + if (fontSavingMode != null) + localVarQueryParams.addAll(apiClient.parameterToPair("fontSavingMode", fontSavingMode)); + if (htmlMarkupGenerationMode != null) + localVarQueryParams.addAll(apiClient.parameterToPair("htmlMarkupGenerationMode", htmlMarkupGenerationMode)); + if (lettersPositioningMethod != null) + localVarQueryParams.addAll(apiClient.parameterToPair("lettersPositioningMethod", lettersPositioningMethod)); + if (pagesFlowTypeDependsOnViewersScreenSize != null) + localVarQueryParams.addAll(apiClient.parameterToPair("pagesFlowTypeDependsOnViewersScreenSize", pagesFlowTypeDependsOnViewersScreenSize)); + if (partsEmbeddingMode != null) + localVarQueryParams.addAll(apiClient.parameterToPair("partsEmbeddingMode", partsEmbeddingMode)); + if (rasterImagesSavingMode != null) + localVarQueryParams.addAll(apiClient.parameterToPair("rasterImagesSavingMode", rasterImagesSavingMode)); + if (removeEmptyAreasOnTopAndBottom != null) + localVarQueryParams.addAll(apiClient.parameterToPair("removeEmptyAreasOnTopAndBottom", removeEmptyAreasOnTopAndBottom)); + if (saveShadowedTextsAsTransparentTexts != null) + localVarQueryParams.addAll(apiClient.parameterToPair("saveShadowedTextsAsTransparentTexts", saveShadowedTextsAsTransparentTexts)); + if (saveTransparentTexts != null) + localVarQueryParams.addAll(apiClient.parameterToPair("saveTransparentTexts", saveTransparentTexts)); + if (specialFolderForAllImages != null) + localVarQueryParams.addAll(apiClient.parameterToPair("specialFolderForAllImages", specialFolderForAllImages)); + if (specialFolderForSvgImages != null) + localVarQueryParams.addAll(apiClient.parameterToPair("specialFolderForSvgImages", specialFolderForSvgImages)); + if (trySaveTextUnderliningAndStrikeoutingInCss != null) + localVarQueryParams.addAll(apiClient.parameterToPair("trySaveTextUnderliningAndStrikeoutingInCss", trySaveTextUnderliningAndStrikeoutingInCss)); + if (folder != null) + localVarQueryParams.addAll(apiClient.parameterToPair("folder", folder)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "multipart/form-data" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call getPdfInStorageToHtmlValidateBeforeCall(String name, Integer additionalMarginWidthInPoints, Boolean compressSvgGraphicsIfAny, Boolean convertMarkedContentToLayers, String defaultFontName, String documentType, Boolean fixedLayout, Integer imageResolution, Integer minimalLineWidth, Boolean preventGlyphsGrouping, Boolean splitCssIntoPages, Boolean splitIntoPages, Boolean useZOrder, String antialiasingProcessing, String cssClassNamesPrefix, List explicitListOfSavedPages, String fontEncodingStrategy, String fontSavingMode, String htmlMarkupGenerationMode, String lettersPositioningMethod, Boolean pagesFlowTypeDependsOnViewersScreenSize, String partsEmbeddingMode, String rasterImagesSavingMode, Boolean removeEmptyAreasOnTopAndBottom, Boolean saveShadowedTextsAsTransparentTexts, Boolean saveTransparentTexts, String specialFolderForAllImages, String specialFolderForSvgImages, Boolean trySaveTextUnderliningAndStrikeoutingInCss, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException("Missing the required parameter 'name' when calling getPdfInStorageToHtml(Async)"); + } + + + com.squareup.okhttp.Call call = getPdfInStorageToHtmlCall(name, additionalMarginWidthInPoints, compressSvgGraphicsIfAny, convertMarkedContentToLayers, defaultFontName, documentType, fixedLayout, imageResolution, minimalLineWidth, preventGlyphsGrouping, splitCssIntoPages, splitIntoPages, useZOrder, antialiasingProcessing, cssClassNamesPrefix, explicitListOfSavedPages, fontEncodingStrategy, fontSavingMode, htmlMarkupGenerationMode, lettersPositioningMethod, pagesFlowTypeDependsOnViewersScreenSize, partsEmbeddingMode, rasterImagesSavingMode, removeEmptyAreasOnTopAndBottom, saveShadowedTextsAsTransparentTexts, saveTransparentTexts, specialFolderForAllImages, specialFolderForSvgImages, trySaveTextUnderliningAndStrikeoutingInCss, folder, progressListener, progressRequestListener); + return call; + + } + + /** + * Converts PDF document (located on storage) to Html format and returns resulting file in response content + * + * @param name The document name. (required) + * @param additionalMarginWidthInPoints Defines width of margin that will be forcibly left around that output HTML-areas. (optional) + * @param compressSvgGraphicsIfAny The flag that indicates whether found SVG graphics(if any) will be compressed(zipped) into SVGZ format during saving. (optional) + * @param convertMarkedContentToLayers If attribute ConvertMarkedContentToLayers set to true then an all elements inside a PDF marked content (layer) will be put into an HTML div with \"data-pdflayer\" attribute specifying a layer name. This layer name will be extracted from optional properties of PDF marked content. If this attribute is false (by default) then no any layers will be created from PDF marked content. (optional) + * @param defaultFontName Specifies the name of an installed font which is used to substitute any document font that is not embedded and not installed in the system. If null then default substitution font is used. (optional) + * @param documentType Result document type. (optional) + * @param fixedLayout The value indicating whether that HTML is created as fixed layout. (optional) + * @param imageResolution Resolution for image rendering. (optional) + * @param minimalLineWidth This attribute sets minimal width of graphic path line. If thickness of line is less than 1px Adobe Acrobat rounds it to this value. So this attribute can be used to emulate this behavior for HTML browsers. (optional) + * @param preventGlyphsGrouping This attribute switch on the mode when text glyphs will not be grouped into words and strings This mode allows to keep maximum precision during positioning of glyphs on the page and it can be used for conversion documents with music notes or glyphs that should be placed separately each other. This parameter will be applied to document only when the value of FixedLayout attribute is true. (optional) + * @param splitCssIntoPages When multipage-mode selected(i.e 'SplitIntoPages' is 'true'), then this attribute defines whether should be created separate CSS-file for each result HTML page. (optional) + * @param splitIntoPages The flag that indicates whether each page of source document will be converted into it's own target HTML document, i.e whether result HTML will be splitted into several HTML-pages. (optional) + * @param useZOrder If attribute UseZORder set to true, graphics and text are added to resultant HTML document accordingly Z-order in original PDF document. If this attribute is false all graphics is put as single layer which may cause some unnecessary effects for overlapped objects. (optional) + * @param antialiasingProcessing The parameter defines required antialiasing measures during conversion of compound background images from PDF to HTML. (optional) + * @param cssClassNamesPrefix When PDFtoHTML converter generates result CSSs, CSS class names (something like \".stl_01 {}\" ... \".stl_NN {}) are generated and used in result CSS. This property allows forcibly set class name prefix. (optional) + * @param explicitListOfSavedPages With this property You can explicitely define what pages of document should be converted. Pages in this list must have 1-based numbers. I.e. valid numbers of pages must be taken from range (1...[NumberOfPagesInConvertedDocument]) Order of appearing of pages in this list does not affect their order in result HTML page(s) - in result pages allways will go in order in which they are present in source PDF. (optional) + * @param fontEncodingStrategy Defines encoding special rule to tune PDF decoding for current document. (optional) + * @param fontSavingMode Defines font saving mode that will be used during saving of PDF to desirable format. (optional) + * @param htmlMarkupGenerationMode Sometimes specific reqirments to generation of HTML markup are present. This parameter defines HTML preparing modes that can be used during conversion of PDF to HTML to match such specific requirments. (optional) + * @param lettersPositioningMethod The mode of positioning of letters in words in result HTML. (optional) + * @param pagesFlowTypeDependsOnViewersScreenSize If attribute 'SplitOnPages=false', than whole HTML representing all input PDF pages will be put into one big result HTML file. This flag defines whether result HTML will be generated in such way that flow of areas that represent PDF pages in result HTML will depend on screen resolution of viewer. (optional) + * @param partsEmbeddingMode It defines whether referenced files (HTML, Fonts,Images, CSSes) will be embedded into main HTML file or will be generated as apart binary entities. (optional) + * @param rasterImagesSavingMode Converted PDF can contain raster images This parameter defines how they should be handled during conversion of PDF to HTML. (optional) + * @param removeEmptyAreasOnTopAndBottom Defines whether in created HTML will be removed top and bottom empty area without any content (if any). (optional) + * @param saveShadowedTextsAsTransparentTexts Pdf can contain texts that are shadowed by another elements (f.e. by images) but can be selected to clipboard in Acrobat Reader (usually it happen when document contains images and OCRed texts extracted from it). This settings tells to converter whether we need save such texts as transparent selectable texts in result HTML to mimic behaviour of Acrobat Reader (othervise such texts are usually saved as hidden, not available for copying to clipboard). (optional) + * @param saveTransparentTexts Pdf can contain transparent texts that can be selected to clipboard (usually it happen when document contains images and OCRed texts extracted from it). This settings tells to converter whether we need save such texts as transparent selectable texts in result HTML. (optional) + * @param specialFolderForAllImages The path to directory to which must be saved any images if they are encountered during saving of document as HTML. If parameter is empty or null then image files(if any) wil be saved together with other files linked to HTML It does not affect anything if CustomImageSavingStrategy property was successfully used to process relevant image file. (optional) + * @param specialFolderForSvgImages The path to directory to which must be saved only SVG-images if they are encountered during saving of document as HTML. If parameter is empty or null then SVG files(if any) wil be saved together with other image-files (near to output file) or in special folder for images (if it specified in SpecialImagesFolderIfAny option). It does not affect anything if CustomImageSavingStrategy property was successfully used to process relevant image file. (optional) + * @param trySaveTextUnderliningAndStrikeoutingInCss PDF itself does not contain underlining markers for texts. It emulated with line situated under text. This option allows converter try guess that this or that line is a text's underlining and put this info into CSS instead of drawing of underlining graphically. (optional) + * @param folder The document folder. (optional) + * @return File + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public File getPdfInStorageToHtml(String name, Integer additionalMarginWidthInPoints, Boolean compressSvgGraphicsIfAny, Boolean convertMarkedContentToLayers, String defaultFontName, String documentType, Boolean fixedLayout, Integer imageResolution, Integer minimalLineWidth, Boolean preventGlyphsGrouping, Boolean splitCssIntoPages, Boolean splitIntoPages, Boolean useZOrder, String antialiasingProcessing, String cssClassNamesPrefix, List explicitListOfSavedPages, String fontEncodingStrategy, String fontSavingMode, String htmlMarkupGenerationMode, String lettersPositioningMethod, Boolean pagesFlowTypeDependsOnViewersScreenSize, String partsEmbeddingMode, String rasterImagesSavingMode, Boolean removeEmptyAreasOnTopAndBottom, Boolean saveShadowedTextsAsTransparentTexts, Boolean saveTransparentTexts, String specialFolderForAllImages, String specialFolderForSvgImages, Boolean trySaveTextUnderliningAndStrikeoutingInCss, String folder) throws ApiException { + ApiResponse resp = getPdfInStorageToHtmlWithHttpInfo(name, additionalMarginWidthInPoints, compressSvgGraphicsIfAny, convertMarkedContentToLayers, defaultFontName, documentType, fixedLayout, imageResolution, minimalLineWidth, preventGlyphsGrouping, splitCssIntoPages, splitIntoPages, useZOrder, antialiasingProcessing, cssClassNamesPrefix, explicitListOfSavedPages, fontEncodingStrategy, fontSavingMode, htmlMarkupGenerationMode, lettersPositioningMethod, pagesFlowTypeDependsOnViewersScreenSize, partsEmbeddingMode, rasterImagesSavingMode, removeEmptyAreasOnTopAndBottom, saveShadowedTextsAsTransparentTexts, saveTransparentTexts, specialFolderForAllImages, specialFolderForSvgImages, trySaveTextUnderliningAndStrikeoutingInCss, folder); + return resp.getData(); + } + + /** + * Converts PDF document (located on storage) to Html format and returns resulting file in response content + * + * @param name The document name. (required) + * @param additionalMarginWidthInPoints Defines width of margin that will be forcibly left around that output HTML-areas. (optional) + * @param compressSvgGraphicsIfAny The flag that indicates whether found SVG graphics(if any) will be compressed(zipped) into SVGZ format during saving. (optional) + * @param convertMarkedContentToLayers If attribute ConvertMarkedContentToLayers set to true then an all elements inside a PDF marked content (layer) will be put into an HTML div with \"data-pdflayer\" attribute specifying a layer name. This layer name will be extracted from optional properties of PDF marked content. If this attribute is false (by default) then no any layers will be created from PDF marked content. (optional) + * @param defaultFontName Specifies the name of an installed font which is used to substitute any document font that is not embedded and not installed in the system. If null then default substitution font is used. (optional) + * @param documentType Result document type. (optional) + * @param fixedLayout The value indicating whether that HTML is created as fixed layout. (optional) + * @param imageResolution Resolution for image rendering. (optional) + * @param minimalLineWidth This attribute sets minimal width of graphic path line. If thickness of line is less than 1px Adobe Acrobat rounds it to this value. So this attribute can be used to emulate this behavior for HTML browsers. (optional) + * @param preventGlyphsGrouping This attribute switch on the mode when text glyphs will not be grouped into words and strings This mode allows to keep maximum precision during positioning of glyphs on the page and it can be used for conversion documents with music notes or glyphs that should be placed separately each other. This parameter will be applied to document only when the value of FixedLayout attribute is true. (optional) + * @param splitCssIntoPages When multipage-mode selected(i.e 'SplitIntoPages' is 'true'), then this attribute defines whether should be created separate CSS-file for each result HTML page. (optional) + * @param splitIntoPages The flag that indicates whether each page of source document will be converted into it's own target HTML document, i.e whether result HTML will be splitted into several HTML-pages. (optional) + * @param useZOrder If attribute UseZORder set to true, graphics and text are added to resultant HTML document accordingly Z-order in original PDF document. If this attribute is false all graphics is put as single layer which may cause some unnecessary effects for overlapped objects. (optional) + * @param antialiasingProcessing The parameter defines required antialiasing measures during conversion of compound background images from PDF to HTML. (optional) + * @param cssClassNamesPrefix When PDFtoHTML converter generates result CSSs, CSS class names (something like \".stl_01 {}\" ... \".stl_NN {}) are generated and used in result CSS. This property allows forcibly set class name prefix. (optional) + * @param explicitListOfSavedPages With this property You can explicitely define what pages of document should be converted. Pages in this list must have 1-based numbers. I.e. valid numbers of pages must be taken from range (1...[NumberOfPagesInConvertedDocument]) Order of appearing of pages in this list does not affect their order in result HTML page(s) - in result pages allways will go in order in which they are present in source PDF. (optional) + * @param fontEncodingStrategy Defines encoding special rule to tune PDF decoding for current document. (optional) + * @param fontSavingMode Defines font saving mode that will be used during saving of PDF to desirable format. (optional) + * @param htmlMarkupGenerationMode Sometimes specific reqirments to generation of HTML markup are present. This parameter defines HTML preparing modes that can be used during conversion of PDF to HTML to match such specific requirments. (optional) + * @param lettersPositioningMethod The mode of positioning of letters in words in result HTML. (optional) + * @param pagesFlowTypeDependsOnViewersScreenSize If attribute 'SplitOnPages=false', than whole HTML representing all input PDF pages will be put into one big result HTML file. This flag defines whether result HTML will be generated in such way that flow of areas that represent PDF pages in result HTML will depend on screen resolution of viewer. (optional) + * @param partsEmbeddingMode It defines whether referenced files (HTML, Fonts,Images, CSSes) will be embedded into main HTML file or will be generated as apart binary entities. (optional) + * @param rasterImagesSavingMode Converted PDF can contain raster images This parameter defines how they should be handled during conversion of PDF to HTML. (optional) + * @param removeEmptyAreasOnTopAndBottom Defines whether in created HTML will be removed top and bottom empty area without any content (if any). (optional) + * @param saveShadowedTextsAsTransparentTexts Pdf can contain texts that are shadowed by another elements (f.e. by images) but can be selected to clipboard in Acrobat Reader (usually it happen when document contains images and OCRed texts extracted from it). This settings tells to converter whether we need save such texts as transparent selectable texts in result HTML to mimic behaviour of Acrobat Reader (othervise such texts are usually saved as hidden, not available for copying to clipboard). (optional) + * @param saveTransparentTexts Pdf can contain transparent texts that can be selected to clipboard (usually it happen when document contains images and OCRed texts extracted from it). This settings tells to converter whether we need save such texts as transparent selectable texts in result HTML. (optional) + * @param specialFolderForAllImages The path to directory to which must be saved any images if they are encountered during saving of document as HTML. If parameter is empty or null then image files(if any) wil be saved together with other files linked to HTML It does not affect anything if CustomImageSavingStrategy property was successfully used to process relevant image file. (optional) + * @param specialFolderForSvgImages The path to directory to which must be saved only SVG-images if they are encountered during saving of document as HTML. If parameter is empty or null then SVG files(if any) wil be saved together with other image-files (near to output file) or in special folder for images (if it specified in SpecialImagesFolderIfAny option). It does not affect anything if CustomImageSavingStrategy property was successfully used to process relevant image file. (optional) + * @param trySaveTextUnderliningAndStrikeoutingInCss PDF itself does not contain underlining markers for texts. It emulated with line situated under text. This option allows converter try guess that this or that line is a text's underlining and put this info into CSS instead of drawing of underlining graphically. (optional) + * @param folder The document folder. (optional) + * @return ApiResponse<File> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse getPdfInStorageToHtmlWithHttpInfo(String name, Integer additionalMarginWidthInPoints, Boolean compressSvgGraphicsIfAny, Boolean convertMarkedContentToLayers, String defaultFontName, String documentType, Boolean fixedLayout, Integer imageResolution, Integer minimalLineWidth, Boolean preventGlyphsGrouping, Boolean splitCssIntoPages, Boolean splitIntoPages, Boolean useZOrder, String antialiasingProcessing, String cssClassNamesPrefix, List explicitListOfSavedPages, String fontEncodingStrategy, String fontSavingMode, String htmlMarkupGenerationMode, String lettersPositioningMethod, Boolean pagesFlowTypeDependsOnViewersScreenSize, String partsEmbeddingMode, String rasterImagesSavingMode, Boolean removeEmptyAreasOnTopAndBottom, Boolean saveShadowedTextsAsTransparentTexts, Boolean saveTransparentTexts, String specialFolderForAllImages, String specialFolderForSvgImages, Boolean trySaveTextUnderliningAndStrikeoutingInCss, String folder) throws ApiException { + com.squareup.okhttp.Call call = getPdfInStorageToHtmlValidateBeforeCall(name, additionalMarginWidthInPoints, compressSvgGraphicsIfAny, convertMarkedContentToLayers, defaultFontName, documentType, fixedLayout, imageResolution, minimalLineWidth, preventGlyphsGrouping, splitCssIntoPages, splitIntoPages, useZOrder, antialiasingProcessing, cssClassNamesPrefix, explicitListOfSavedPages, fontEncodingStrategy, fontSavingMode, htmlMarkupGenerationMode, lettersPositioningMethod, pagesFlowTypeDependsOnViewersScreenSize, partsEmbeddingMode, rasterImagesSavingMode, removeEmptyAreasOnTopAndBottom, saveShadowedTextsAsTransparentTexts, saveTransparentTexts, specialFolderForAllImages, specialFolderForSvgImages, trySaveTextUnderliningAndStrikeoutingInCss, folder, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Converts PDF document (located on storage) to Html format and returns resulting file in response content (asynchronously) + * + * @param name The document name. (required) + * @param additionalMarginWidthInPoints Defines width of margin that will be forcibly left around that output HTML-areas. (optional) + * @param compressSvgGraphicsIfAny The flag that indicates whether found SVG graphics(if any) will be compressed(zipped) into SVGZ format during saving. (optional) + * @param convertMarkedContentToLayers If attribute ConvertMarkedContentToLayers set to true then an all elements inside a PDF marked content (layer) will be put into an HTML div with \"data-pdflayer\" attribute specifying a layer name. This layer name will be extracted from optional properties of PDF marked content. If this attribute is false (by default) then no any layers will be created from PDF marked content. (optional) + * @param defaultFontName Specifies the name of an installed font which is used to substitute any document font that is not embedded and not installed in the system. If null then default substitution font is used. (optional) + * @param documentType Result document type. (optional) + * @param fixedLayout The value indicating whether that HTML is created as fixed layout. (optional) + * @param imageResolution Resolution for image rendering. (optional) + * @param minimalLineWidth This attribute sets minimal width of graphic path line. If thickness of line is less than 1px Adobe Acrobat rounds it to this value. So this attribute can be used to emulate this behavior for HTML browsers. (optional) + * @param preventGlyphsGrouping This attribute switch on the mode when text glyphs will not be grouped into words and strings This mode allows to keep maximum precision during positioning of glyphs on the page and it can be used for conversion documents with music notes or glyphs that should be placed separately each other. This parameter will be applied to document only when the value of FixedLayout attribute is true. (optional) + * @param splitCssIntoPages When multipage-mode selected(i.e 'SplitIntoPages' is 'true'), then this attribute defines whether should be created separate CSS-file for each result HTML page. (optional) + * @param splitIntoPages The flag that indicates whether each page of source document will be converted into it's own target HTML document, i.e whether result HTML will be splitted into several HTML-pages. (optional) + * @param useZOrder If attribute UseZORder set to true, graphics and text are added to resultant HTML document accordingly Z-order in original PDF document. If this attribute is false all graphics is put as single layer which may cause some unnecessary effects for overlapped objects. (optional) + * @param antialiasingProcessing The parameter defines required antialiasing measures during conversion of compound background images from PDF to HTML. (optional) + * @param cssClassNamesPrefix When PDFtoHTML converter generates result CSSs, CSS class names (something like \".stl_01 {}\" ... \".stl_NN {}) are generated and used in result CSS. This property allows forcibly set class name prefix. (optional) + * @param explicitListOfSavedPages With this property You can explicitely define what pages of document should be converted. Pages in this list must have 1-based numbers. I.e. valid numbers of pages must be taken from range (1...[NumberOfPagesInConvertedDocument]) Order of appearing of pages in this list does not affect their order in result HTML page(s) - in result pages allways will go in order in which they are present in source PDF. (optional) + * @param fontEncodingStrategy Defines encoding special rule to tune PDF decoding for current document. (optional) + * @param fontSavingMode Defines font saving mode that will be used during saving of PDF to desirable format. (optional) + * @param htmlMarkupGenerationMode Sometimes specific reqirments to generation of HTML markup are present. This parameter defines HTML preparing modes that can be used during conversion of PDF to HTML to match such specific requirments. (optional) + * @param lettersPositioningMethod The mode of positioning of letters in words in result HTML. (optional) + * @param pagesFlowTypeDependsOnViewersScreenSize If attribute 'SplitOnPages=false', than whole HTML representing all input PDF pages will be put into one big result HTML file. This flag defines whether result HTML will be generated in such way that flow of areas that represent PDF pages in result HTML will depend on screen resolution of viewer. (optional) + * @param partsEmbeddingMode It defines whether referenced files (HTML, Fonts,Images, CSSes) will be embedded into main HTML file or will be generated as apart binary entities. (optional) + * @param rasterImagesSavingMode Converted PDF can contain raster images This parameter defines how they should be handled during conversion of PDF to HTML. (optional) + * @param removeEmptyAreasOnTopAndBottom Defines whether in created HTML will be removed top and bottom empty area without any content (if any). (optional) + * @param saveShadowedTextsAsTransparentTexts Pdf can contain texts that are shadowed by another elements (f.e. by images) but can be selected to clipboard in Acrobat Reader (usually it happen when document contains images and OCRed texts extracted from it). This settings tells to converter whether we need save such texts as transparent selectable texts in result HTML to mimic behaviour of Acrobat Reader (othervise such texts are usually saved as hidden, not available for copying to clipboard). (optional) + * @param saveTransparentTexts Pdf can contain transparent texts that can be selected to clipboard (usually it happen when document contains images and OCRed texts extracted from it). This settings tells to converter whether we need save such texts as transparent selectable texts in result HTML. (optional) + * @param specialFolderForAllImages The path to directory to which must be saved any images if they are encountered during saving of document as HTML. If parameter is empty or null then image files(if any) wil be saved together with other files linked to HTML It does not affect anything if CustomImageSavingStrategy property was successfully used to process relevant image file. (optional) + * @param specialFolderForSvgImages The path to directory to which must be saved only SVG-images if they are encountered during saving of document as HTML. If parameter is empty or null then SVG files(if any) wil be saved together with other image-files (near to output file) or in special folder for images (if it specified in SpecialImagesFolderIfAny option). It does not affect anything if CustomImageSavingStrategy property was successfully used to process relevant image file. (optional) + * @param trySaveTextUnderliningAndStrikeoutingInCss PDF itself does not contain underlining markers for texts. It emulated with line situated under text. This option allows converter try guess that this or that line is a text's underlining and put this info into CSS instead of drawing of underlining graphically. (optional) + * @param folder The document folder. (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call getPdfInStorageToHtmlAsync(String name, Integer additionalMarginWidthInPoints, Boolean compressSvgGraphicsIfAny, Boolean convertMarkedContentToLayers, String defaultFontName, String documentType, Boolean fixedLayout, Integer imageResolution, Integer minimalLineWidth, Boolean preventGlyphsGrouping, Boolean splitCssIntoPages, Boolean splitIntoPages, Boolean useZOrder, String antialiasingProcessing, String cssClassNamesPrefix, List explicitListOfSavedPages, String fontEncodingStrategy, String fontSavingMode, String htmlMarkupGenerationMode, String lettersPositioningMethod, Boolean pagesFlowTypeDependsOnViewersScreenSize, String partsEmbeddingMode, String rasterImagesSavingMode, Boolean removeEmptyAreasOnTopAndBottom, Boolean saveShadowedTextsAsTransparentTexts, Boolean saveTransparentTexts, String specialFolderForAllImages, String specialFolderForSvgImages, Boolean trySaveTextUnderliningAndStrikeoutingInCss, String folder, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = getPdfInStorageToHtmlValidateBeforeCall(name, additionalMarginWidthInPoints, compressSvgGraphicsIfAny, convertMarkedContentToLayers, defaultFontName, documentType, fixedLayout, imageResolution, minimalLineWidth, preventGlyphsGrouping, splitCssIntoPages, splitIntoPages, useZOrder, antialiasingProcessing, cssClassNamesPrefix, explicitListOfSavedPages, fontEncodingStrategy, fontSavingMode, htmlMarkupGenerationMode, lettersPositioningMethod, pagesFlowTypeDependsOnViewersScreenSize, partsEmbeddingMode, rasterImagesSavingMode, removeEmptyAreasOnTopAndBottom, saveShadowedTextsAsTransparentTexts, saveTransparentTexts, specialFolderForAllImages, specialFolderForSvgImages, trySaveTextUnderliningAndStrikeoutingInCss, folder, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for getPdfInStorageToLaTeX + * @param name The document name. (required) + * @param pagesCount Pages count. (optional) + * @param folder The document folder. (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call getPdfInStorageToLaTeXCall(String name, Integer pagesCount, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/pdf/{name}/convert/latex" + .replaceAll("\\{" + "name" + "\\}", apiClient.escapeString(name.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (pagesCount != null) + localVarQueryParams.addAll(apiClient.parameterToPair("pagesCount", pagesCount)); + if (folder != null) + localVarQueryParams.addAll(apiClient.parameterToPair("folder", folder)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "multipart/form-data" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call getPdfInStorageToLaTeXValidateBeforeCall(String name, Integer pagesCount, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException("Missing the required parameter 'name' when calling getPdfInStorageToLaTeX(Async)"); + } + + + com.squareup.okhttp.Call call = getPdfInStorageToLaTeXCall(name, pagesCount, folder, progressListener, progressRequestListener); + return call; + + } + + /** + * Converts PDF document (located on storage) to LaTeX format and returns resulting file in response content + * + * @param name The document name. (required) + * @param pagesCount Pages count. (optional) + * @param folder The document folder. (optional) + * @return File + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public File getPdfInStorageToLaTeX(String name, Integer pagesCount, String folder) throws ApiException { + ApiResponse resp = getPdfInStorageToLaTeXWithHttpInfo(name, pagesCount, folder); + return resp.getData(); + } + + /** + * Converts PDF document (located on storage) to LaTeX format and returns resulting file in response content + * + * @param name The document name. (required) + * @param pagesCount Pages count. (optional) + * @param folder The document folder. (optional) + * @return ApiResponse<File> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse getPdfInStorageToLaTeXWithHttpInfo(String name, Integer pagesCount, String folder) throws ApiException { + com.squareup.okhttp.Call call = getPdfInStorageToLaTeXValidateBeforeCall(name, pagesCount, folder, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Converts PDF document (located on storage) to LaTeX format and returns resulting file in response content (asynchronously) + * + * @param name The document name. (required) + * @param pagesCount Pages count. (optional) + * @param folder The document folder. (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call getPdfInStorageToLaTeXAsync(String name, Integer pagesCount, String folder, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = getPdfInStorageToLaTeXValidateBeforeCall(name, pagesCount, folder, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for getPdfInStorageToMobiXml + * @param name The document name. (required) + * @param folder The document folder. (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call getPdfInStorageToMobiXmlCall(String name, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/pdf/{name}/convert/mobixml" + .replaceAll("\\{" + "name" + "\\}", apiClient.escapeString(name.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (folder != null) + localVarQueryParams.addAll(apiClient.parameterToPair("folder", folder)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "multipart/form-data" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call getPdfInStorageToMobiXmlValidateBeforeCall(String name, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException("Missing the required parameter 'name' when calling getPdfInStorageToMobiXml(Async)"); + } + + + com.squareup.okhttp.Call call = getPdfInStorageToMobiXmlCall(name, folder, progressListener, progressRequestListener); + return call; + + } + + /** + * Converts PDF document (located on storage) to MOBIXML format and returns resulting file in response content + * + * @param name The document name. (required) + * @param folder The document folder. (optional) + * @return File + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public File getPdfInStorageToMobiXml(String name, String folder) throws ApiException { + ApiResponse resp = getPdfInStorageToMobiXmlWithHttpInfo(name, folder); + return resp.getData(); + } + + /** + * Converts PDF document (located on storage) to MOBIXML format and returns resulting file in response content + * + * @param name The document name. (required) + * @param folder The document folder. (optional) + * @return ApiResponse<File> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse getPdfInStorageToMobiXmlWithHttpInfo(String name, String folder) throws ApiException { + com.squareup.okhttp.Call call = getPdfInStorageToMobiXmlValidateBeforeCall(name, folder, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Converts PDF document (located on storage) to MOBIXML format and returns resulting file in response content (asynchronously) + * + * @param name The document name. (required) + * @param folder The document folder. (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call getPdfInStorageToMobiXmlAsync(String name, String folder, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = getPdfInStorageToMobiXmlValidateBeforeCall(name, folder, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for getPdfInStorageToPdfA + * @param name The document name. (required) + * @param type Type of PdfA format. (required) + * @param folder The document folder. (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call getPdfInStorageToPdfACall(String name, String type, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/pdf/{name}/convert/pdfa" + .replaceAll("\\{" + "name" + "\\}", apiClient.escapeString(name.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (type != null) + localVarQueryParams.addAll(apiClient.parameterToPair("type", type)); + if (folder != null) + localVarQueryParams.addAll(apiClient.parameterToPair("folder", folder)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "multipart/form-data" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call getPdfInStorageToPdfAValidateBeforeCall(String name, String type, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException("Missing the required parameter 'name' when calling getPdfInStorageToPdfA(Async)"); + } + + // verify the required parameter 'type' is set + if (type == null) { + throw new ApiException("Missing the required parameter 'type' when calling getPdfInStorageToPdfA(Async)"); + } + + + com.squareup.okhttp.Call call = getPdfInStorageToPdfACall(name, type, folder, progressListener, progressRequestListener); + return call; + + } + + /** + * Converts PDF document (located on storage) to PdfA format and returns resulting file in response content + * + * @param name The document name. (required) + * @param type Type of PdfA format. (required) + * @param folder The document folder. (optional) + * @return File + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public File getPdfInStorageToPdfA(String name, String type, String folder) throws ApiException { + ApiResponse resp = getPdfInStorageToPdfAWithHttpInfo(name, type, folder); + return resp.getData(); + } + + /** + * Converts PDF document (located on storage) to PdfA format and returns resulting file in response content + * + * @param name The document name. (required) + * @param type Type of PdfA format. (required) + * @param folder The document folder. (optional) + * @return ApiResponse<File> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse getPdfInStorageToPdfAWithHttpInfo(String name, String type, String folder) throws ApiException { + com.squareup.okhttp.Call call = getPdfInStorageToPdfAValidateBeforeCall(name, type, folder, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Converts PDF document (located on storage) to PdfA format and returns resulting file in response content (asynchronously) + * + * @param name The document name. (required) + * @param type Type of PdfA format. (required) + * @param folder The document folder. (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call getPdfInStorageToPdfAAsync(String name, String type, String folder, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = getPdfInStorageToPdfAValidateBeforeCall(name, type, folder, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for getPdfInStorageToPptx + * @param name The document name. (required) + * @param separateImages Separate images. (optional) + * @param slidesAsImages Slides as images. (optional) + * @param folder The document folder. (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call getPdfInStorageToPptxCall(String name, Boolean separateImages, Boolean slidesAsImages, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/pdf/{name}/convert/pptx" + .replaceAll("\\{" + "name" + "\\}", apiClient.escapeString(name.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (separateImages != null) + localVarQueryParams.addAll(apiClient.parameterToPair("separateImages", separateImages)); + if (slidesAsImages != null) + localVarQueryParams.addAll(apiClient.parameterToPair("slidesAsImages", slidesAsImages)); + if (folder != null) + localVarQueryParams.addAll(apiClient.parameterToPair("folder", folder)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "multipart/form-data" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call getPdfInStorageToPptxValidateBeforeCall(String name, Boolean separateImages, Boolean slidesAsImages, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException("Missing the required parameter 'name' when calling getPdfInStorageToPptx(Async)"); + } + + + com.squareup.okhttp.Call call = getPdfInStorageToPptxCall(name, separateImages, slidesAsImages, folder, progressListener, progressRequestListener); + return call; + + } + + /** + * Converts PDF document (located on storage) to PPTX format and returns resulting file in response content + * + * @param name The document name. (required) + * @param separateImages Separate images. (optional) + * @param slidesAsImages Slides as images. (optional) + * @param folder The document folder. (optional) + * @return File + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public File getPdfInStorageToPptx(String name, Boolean separateImages, Boolean slidesAsImages, String folder) throws ApiException { + ApiResponse resp = getPdfInStorageToPptxWithHttpInfo(name, separateImages, slidesAsImages, folder); + return resp.getData(); + } + + /** + * Converts PDF document (located on storage) to PPTX format and returns resulting file in response content + * + * @param name The document name. (required) + * @param separateImages Separate images. (optional) + * @param slidesAsImages Slides as images. (optional) + * @param folder The document folder. (optional) + * @return ApiResponse<File> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse getPdfInStorageToPptxWithHttpInfo(String name, Boolean separateImages, Boolean slidesAsImages, String folder) throws ApiException { + com.squareup.okhttp.Call call = getPdfInStorageToPptxValidateBeforeCall(name, separateImages, slidesAsImages, folder, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Converts PDF document (located on storage) to PPTX format and returns resulting file in response content (asynchronously) + * + * @param name The document name. (required) + * @param separateImages Separate images. (optional) + * @param slidesAsImages Slides as images. (optional) + * @param folder The document folder. (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call getPdfInStorageToPptxAsync(String name, Boolean separateImages, Boolean slidesAsImages, String folder, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = getPdfInStorageToPptxValidateBeforeCall(name, separateImages, slidesAsImages, folder, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for getPdfInStorageToSvg + * @param name The document name. (required) + * @param compressOutputToZipArchive Specifies whether output will be created as one zip-archive. (optional) + * @param folder The document folder. (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call getPdfInStorageToSvgCall(String name, Boolean compressOutputToZipArchive, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/pdf/{name}/convert/svg" + .replaceAll("\\{" + "name" + "\\}", apiClient.escapeString(name.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (compressOutputToZipArchive != null) + localVarQueryParams.addAll(apiClient.parameterToPair("compressOutputToZipArchive", compressOutputToZipArchive)); + if (folder != null) + localVarQueryParams.addAll(apiClient.parameterToPair("folder", folder)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "multipart/form-data" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call getPdfInStorageToSvgValidateBeforeCall(String name, Boolean compressOutputToZipArchive, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException("Missing the required parameter 'name' when calling getPdfInStorageToSvg(Async)"); + } + + + com.squareup.okhttp.Call call = getPdfInStorageToSvgCall(name, compressOutputToZipArchive, folder, progressListener, progressRequestListener); + return call; + + } + + /** + * Converts PDF document (located on storage) to SVG format and returns resulting file in response content + * + * @param name The document name. (required) + * @param compressOutputToZipArchive Specifies whether output will be created as one zip-archive. (optional) + * @param folder The document folder. (optional) + * @return File + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public File getPdfInStorageToSvg(String name, Boolean compressOutputToZipArchive, String folder) throws ApiException { + ApiResponse resp = getPdfInStorageToSvgWithHttpInfo(name, compressOutputToZipArchive, folder); + return resp.getData(); + } + + /** + * Converts PDF document (located on storage) to SVG format and returns resulting file in response content + * + * @param name The document name. (required) + * @param compressOutputToZipArchive Specifies whether output will be created as one zip-archive. (optional) + * @param folder The document folder. (optional) + * @return ApiResponse<File> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse getPdfInStorageToSvgWithHttpInfo(String name, Boolean compressOutputToZipArchive, String folder) throws ApiException { + com.squareup.okhttp.Call call = getPdfInStorageToSvgValidateBeforeCall(name, compressOutputToZipArchive, folder, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Converts PDF document (located on storage) to SVG format and returns resulting file in response content (asynchronously) + * + * @param name The document name. (required) + * @param compressOutputToZipArchive Specifies whether output will be created as one zip-archive. (optional) + * @param folder The document folder. (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call getPdfInStorageToSvgAsync(String name, Boolean compressOutputToZipArchive, String folder, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = getPdfInStorageToSvgValidateBeforeCall(name, compressOutputToZipArchive, folder, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for getPdfInStorageToTiff + * @param name The document name. (required) + * @param brightness Image brightness. (optional) + * @param compression Tiff compression. Possible values are: LZW, CCITT4, CCITT3, RLE, None. (optional) + * @param colorDepth Image color depth. Possible valuse are: Default, Format8bpp, Format4bpp, Format1bpp. (optional) + * @param leftMargin Left image margin. (optional) + * @param rightMargin Right image margin. (optional) + * @param topMargin Top image margin. (optional) + * @param bottomMargin Bottom image margin. (optional) + * @param orientation Image orientation. Possible values are: None, Landscape, Portait. (optional) + * @param skipBlankPages Skip blank pages flag. (optional) + * @param width Image width. (optional) + * @param height Image height. (optional) + * @param xResolution Horizontal resolution. (optional) + * @param yResolution Vertical resolution. (optional) + * @param pageIndex Start page to export. (optional) + * @param pageCount Number of pages to export. (optional) + * @param folder The document folder. (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call getPdfInStorageToTiffCall(String name, Double brightness, String compression, String colorDepth, Integer leftMargin, Integer rightMargin, Integer topMargin, Integer bottomMargin, String orientation, Boolean skipBlankPages, Integer width, Integer height, Integer xResolution, Integer yResolution, Integer pageIndex, Integer pageCount, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/pdf/{name}/convert/tiff" + .replaceAll("\\{" + "name" + "\\}", apiClient.escapeString(name.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (brightness != null) + localVarQueryParams.addAll(apiClient.parameterToPair("brightness", brightness)); + if (compression != null) + localVarQueryParams.addAll(apiClient.parameterToPair("compression", compression)); + if (colorDepth != null) + localVarQueryParams.addAll(apiClient.parameterToPair("colorDepth", colorDepth)); + if (leftMargin != null) + localVarQueryParams.addAll(apiClient.parameterToPair("leftMargin", leftMargin)); + if (rightMargin != null) + localVarQueryParams.addAll(apiClient.parameterToPair("rightMargin", rightMargin)); + if (topMargin != null) + localVarQueryParams.addAll(apiClient.parameterToPair("topMargin", topMargin)); + if (bottomMargin != null) + localVarQueryParams.addAll(apiClient.parameterToPair("bottomMargin", bottomMargin)); + if (orientation != null) + localVarQueryParams.addAll(apiClient.parameterToPair("orientation", orientation)); + if (skipBlankPages != null) + localVarQueryParams.addAll(apiClient.parameterToPair("skipBlankPages", skipBlankPages)); + if (width != null) + localVarQueryParams.addAll(apiClient.parameterToPair("width", width)); + if (height != null) + localVarQueryParams.addAll(apiClient.parameterToPair("height", height)); + if (xResolution != null) + localVarQueryParams.addAll(apiClient.parameterToPair("xResolution", xResolution)); + if (yResolution != null) + localVarQueryParams.addAll(apiClient.parameterToPair("yResolution", yResolution)); + if (pageIndex != null) + localVarQueryParams.addAll(apiClient.parameterToPair("pageIndex", pageIndex)); + if (pageCount != null) + localVarQueryParams.addAll(apiClient.parameterToPair("pageCount", pageCount)); + if (folder != null) + localVarQueryParams.addAll(apiClient.parameterToPair("folder", folder)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "multipart/form-data" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call getPdfInStorageToTiffValidateBeforeCall(String name, Double brightness, String compression, String colorDepth, Integer leftMargin, Integer rightMargin, Integer topMargin, Integer bottomMargin, String orientation, Boolean skipBlankPages, Integer width, Integer height, Integer xResolution, Integer yResolution, Integer pageIndex, Integer pageCount, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException("Missing the required parameter 'name' when calling getPdfInStorageToTiff(Async)"); + } + + + com.squareup.okhttp.Call call = getPdfInStorageToTiffCall(name, brightness, compression, colorDepth, leftMargin, rightMargin, topMargin, bottomMargin, orientation, skipBlankPages, width, height, xResolution, yResolution, pageIndex, pageCount, folder, progressListener, progressRequestListener); + return call; + + } + + /** + * Converts PDF document (located on storage) to TIFF format and returns resulting file in response content + * + * @param name The document name. (required) + * @param brightness Image brightness. (optional) + * @param compression Tiff compression. Possible values are: LZW, CCITT4, CCITT3, RLE, None. (optional) + * @param colorDepth Image color depth. Possible valuse are: Default, Format8bpp, Format4bpp, Format1bpp. (optional) + * @param leftMargin Left image margin. (optional) + * @param rightMargin Right image margin. (optional) + * @param topMargin Top image margin. (optional) + * @param bottomMargin Bottom image margin. (optional) + * @param orientation Image orientation. Possible values are: None, Landscape, Portait. (optional) + * @param skipBlankPages Skip blank pages flag. (optional) + * @param width Image width. (optional) + * @param height Image height. (optional) + * @param xResolution Horizontal resolution. (optional) + * @param yResolution Vertical resolution. (optional) + * @param pageIndex Start page to export. (optional) + * @param pageCount Number of pages to export. (optional) + * @param folder The document folder. (optional) + * @return File + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public File getPdfInStorageToTiff(String name, Double brightness, String compression, String colorDepth, Integer leftMargin, Integer rightMargin, Integer topMargin, Integer bottomMargin, String orientation, Boolean skipBlankPages, Integer width, Integer height, Integer xResolution, Integer yResolution, Integer pageIndex, Integer pageCount, String folder) throws ApiException { + ApiResponse resp = getPdfInStorageToTiffWithHttpInfo(name, brightness, compression, colorDepth, leftMargin, rightMargin, topMargin, bottomMargin, orientation, skipBlankPages, width, height, xResolution, yResolution, pageIndex, pageCount, folder); + return resp.getData(); + } + + /** + * Converts PDF document (located on storage) to TIFF format and returns resulting file in response content + * + * @param name The document name. (required) + * @param brightness Image brightness. (optional) + * @param compression Tiff compression. Possible values are: LZW, CCITT4, CCITT3, RLE, None. (optional) + * @param colorDepth Image color depth. Possible valuse are: Default, Format8bpp, Format4bpp, Format1bpp. (optional) + * @param leftMargin Left image margin. (optional) + * @param rightMargin Right image margin. (optional) + * @param topMargin Top image margin. (optional) + * @param bottomMargin Bottom image margin. (optional) + * @param orientation Image orientation. Possible values are: None, Landscape, Portait. (optional) + * @param skipBlankPages Skip blank pages flag. (optional) + * @param width Image width. (optional) + * @param height Image height. (optional) + * @param xResolution Horizontal resolution. (optional) + * @param yResolution Vertical resolution. (optional) + * @param pageIndex Start page to export. (optional) + * @param pageCount Number of pages to export. (optional) + * @param folder The document folder. (optional) + * @return ApiResponse<File> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse getPdfInStorageToTiffWithHttpInfo(String name, Double brightness, String compression, String colorDepth, Integer leftMargin, Integer rightMargin, Integer topMargin, Integer bottomMargin, String orientation, Boolean skipBlankPages, Integer width, Integer height, Integer xResolution, Integer yResolution, Integer pageIndex, Integer pageCount, String folder) throws ApiException { + com.squareup.okhttp.Call call = getPdfInStorageToTiffValidateBeforeCall(name, brightness, compression, colorDepth, leftMargin, rightMargin, topMargin, bottomMargin, orientation, skipBlankPages, width, height, xResolution, yResolution, pageIndex, pageCount, folder, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Converts PDF document (located on storage) to TIFF format and returns resulting file in response content (asynchronously) + * + * @param name The document name. (required) + * @param brightness Image brightness. (optional) + * @param compression Tiff compression. Possible values are: LZW, CCITT4, CCITT3, RLE, None. (optional) + * @param colorDepth Image color depth. Possible valuse are: Default, Format8bpp, Format4bpp, Format1bpp. (optional) + * @param leftMargin Left image margin. (optional) + * @param rightMargin Right image margin. (optional) + * @param topMargin Top image margin. (optional) + * @param bottomMargin Bottom image margin. (optional) + * @param orientation Image orientation. Possible values are: None, Landscape, Portait. (optional) + * @param skipBlankPages Skip blank pages flag. (optional) + * @param width Image width. (optional) + * @param height Image height. (optional) + * @param xResolution Horizontal resolution. (optional) + * @param yResolution Vertical resolution. (optional) + * @param pageIndex Start page to export. (optional) + * @param pageCount Number of pages to export. (optional) + * @param folder The document folder. (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call getPdfInStorageToTiffAsync(String name, Double brightness, String compression, String colorDepth, Integer leftMargin, Integer rightMargin, Integer topMargin, Integer bottomMargin, String orientation, Boolean skipBlankPages, Integer width, Integer height, Integer xResolution, Integer yResolution, Integer pageIndex, Integer pageCount, String folder, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = getPdfInStorageToTiffValidateBeforeCall(name, brightness, compression, colorDepth, leftMargin, rightMargin, topMargin, bottomMargin, orientation, skipBlankPages, width, height, xResolution, yResolution, pageIndex, pageCount, folder, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for getPdfInStorageToXls + * @param name The document name. (required) + * @param insertBlankColumnAtFirst Insert blank column at first (optional) + * @param minimizeTheNumberOfWorksheets Minimize the number of worksheets (optional) + * @param scaleFactor Scale factor (optional) + * @param uniformWorksheets Uniform worksheets (optional) + * @param folder The document folder. (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call getPdfInStorageToXlsCall(String name, Boolean insertBlankColumnAtFirst, Boolean minimizeTheNumberOfWorksheets, Double scaleFactor, Boolean uniformWorksheets, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/pdf/{name}/convert/xls" + .replaceAll("\\{" + "name" + "\\}", apiClient.escapeString(name.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (insertBlankColumnAtFirst != null) + localVarQueryParams.addAll(apiClient.parameterToPair("insertBlankColumnAtFirst", insertBlankColumnAtFirst)); + if (minimizeTheNumberOfWorksheets != null) + localVarQueryParams.addAll(apiClient.parameterToPair("minimizeTheNumberOfWorksheets", minimizeTheNumberOfWorksheets)); + if (scaleFactor != null) + localVarQueryParams.addAll(apiClient.parameterToPair("scaleFactor", scaleFactor)); + if (uniformWorksheets != null) + localVarQueryParams.addAll(apiClient.parameterToPair("uniformWorksheets", uniformWorksheets)); + if (folder != null) + localVarQueryParams.addAll(apiClient.parameterToPair("folder", folder)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "multipart/form-data" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call getPdfInStorageToXlsValidateBeforeCall(String name, Boolean insertBlankColumnAtFirst, Boolean minimizeTheNumberOfWorksheets, Double scaleFactor, Boolean uniformWorksheets, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException("Missing the required parameter 'name' when calling getPdfInStorageToXls(Async)"); + } + + + com.squareup.okhttp.Call call = getPdfInStorageToXlsCall(name, insertBlankColumnAtFirst, minimizeTheNumberOfWorksheets, scaleFactor, uniformWorksheets, folder, progressListener, progressRequestListener); + return call; + + } + + /** + * Converts PDF document (located on storage) to XLS format and returns resulting file in response content + * + * @param name The document name. (required) + * @param insertBlankColumnAtFirst Insert blank column at first (optional) + * @param minimizeTheNumberOfWorksheets Minimize the number of worksheets (optional) + * @param scaleFactor Scale factor (optional) + * @param uniformWorksheets Uniform worksheets (optional) + * @param folder The document folder. (optional) + * @return File + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public File getPdfInStorageToXls(String name, Boolean insertBlankColumnAtFirst, Boolean minimizeTheNumberOfWorksheets, Double scaleFactor, Boolean uniformWorksheets, String folder) throws ApiException { + ApiResponse resp = getPdfInStorageToXlsWithHttpInfo(name, insertBlankColumnAtFirst, minimizeTheNumberOfWorksheets, scaleFactor, uniformWorksheets, folder); + return resp.getData(); + } + + /** + * Converts PDF document (located on storage) to XLS format and returns resulting file in response content + * + * @param name The document name. (required) + * @param insertBlankColumnAtFirst Insert blank column at first (optional) + * @param minimizeTheNumberOfWorksheets Minimize the number of worksheets (optional) + * @param scaleFactor Scale factor (optional) + * @param uniformWorksheets Uniform worksheets (optional) + * @param folder The document folder. (optional) + * @return ApiResponse<File> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse getPdfInStorageToXlsWithHttpInfo(String name, Boolean insertBlankColumnAtFirst, Boolean minimizeTheNumberOfWorksheets, Double scaleFactor, Boolean uniformWorksheets, String folder) throws ApiException { + com.squareup.okhttp.Call call = getPdfInStorageToXlsValidateBeforeCall(name, insertBlankColumnAtFirst, minimizeTheNumberOfWorksheets, scaleFactor, uniformWorksheets, folder, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Converts PDF document (located on storage) to XLS format and returns resulting file in response content (asynchronously) + * + * @param name The document name. (required) + * @param insertBlankColumnAtFirst Insert blank column at first (optional) + * @param minimizeTheNumberOfWorksheets Minimize the number of worksheets (optional) + * @param scaleFactor Scale factor (optional) + * @param uniformWorksheets Uniform worksheets (optional) + * @param folder The document folder. (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call getPdfInStorageToXlsAsync(String name, Boolean insertBlankColumnAtFirst, Boolean minimizeTheNumberOfWorksheets, Double scaleFactor, Boolean uniformWorksheets, String folder, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = getPdfInStorageToXlsValidateBeforeCall(name, insertBlankColumnAtFirst, minimizeTheNumberOfWorksheets, scaleFactor, uniformWorksheets, folder, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for getPdfInStorageToXml + * @param name The document name. (required) + * @param folder The document folder. (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call getPdfInStorageToXmlCall(String name, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/pdf/{name}/convert/xml" + .replaceAll("\\{" + "name" + "\\}", apiClient.escapeString(name.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (folder != null) + localVarQueryParams.addAll(apiClient.parameterToPair("folder", folder)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "multipart/form-data" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call getPdfInStorageToXmlValidateBeforeCall(String name, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException("Missing the required parameter 'name' when calling getPdfInStorageToXml(Async)"); + } + + + com.squareup.okhttp.Call call = getPdfInStorageToXmlCall(name, folder, progressListener, progressRequestListener); + return call; + + } + + /** + * Converts PDF document (located on storage) to XML format and returns resulting file in response content + * + * @param name The document name. (required) + * @param folder The document folder. (optional) + * @return File + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public File getPdfInStorageToXml(String name, String folder) throws ApiException { + ApiResponse resp = getPdfInStorageToXmlWithHttpInfo(name, folder); + return resp.getData(); + } + + /** + * Converts PDF document (located on storage) to XML format and returns resulting file in response content + * + * @param name The document name. (required) + * @param folder The document folder. (optional) + * @return ApiResponse<File> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse getPdfInStorageToXmlWithHttpInfo(String name, String folder) throws ApiException { + com.squareup.okhttp.Call call = getPdfInStorageToXmlValidateBeforeCall(name, folder, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Converts PDF document (located on storage) to XML format and returns resulting file in response content (asynchronously) + * + * @param name The document name. (required) + * @param folder The document folder. (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call getPdfInStorageToXmlAsync(String name, String folder, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = getPdfInStorageToXmlValidateBeforeCall(name, folder, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for getPdfInStorageToXps + * @param name The document name. (required) + * @param folder The document folder. (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call getPdfInStorageToXpsCall(String name, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/pdf/{name}/convert/xps" + .replaceAll("\\{" + "name" + "\\}", apiClient.escapeString(name.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (folder != null) + localVarQueryParams.addAll(apiClient.parameterToPair("folder", folder)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "multipart/form-data" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call getPdfInStorageToXpsValidateBeforeCall(String name, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException("Missing the required parameter 'name' when calling getPdfInStorageToXps(Async)"); + } + + + com.squareup.okhttp.Call call = getPdfInStorageToXpsCall(name, folder, progressListener, progressRequestListener); + return call; + + } + + /** + * Converts PDF document (located on storage) to XPS format and returns resulting file in response content + * + * @param name The document name. (required) + * @param folder The document folder. (optional) + * @return File + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public File getPdfInStorageToXps(String name, String folder) throws ApiException { + ApiResponse resp = getPdfInStorageToXpsWithHttpInfo(name, folder); + return resp.getData(); + } + + /** + * Converts PDF document (located on storage) to XPS format and returns resulting file in response content + * + * @param name The document name. (required) + * @param folder The document folder. (optional) + * @return ApiResponse<File> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse getPdfInStorageToXpsWithHttpInfo(String name, String folder) throws ApiException { + com.squareup.okhttp.Call call = getPdfInStorageToXpsValidateBeforeCall(name, folder, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Converts PDF document (located on storage) to XPS format and returns resulting file in response content (asynchronously) + * + * @param name The document name. (required) + * @param folder The document folder. (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call getPdfInStorageToXpsAsync(String name, String folder, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = getPdfInStorageToXpsValidateBeforeCall(name, folder, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for getSegment + * @param name (required) + * @param pageNumber (required) + * @param fragmentNumber (required) + * @param segmentNumber (required) + * @param storage (optional) + * @param folder (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @deprecated + */ + @Deprecated + public com.squareup.okhttp.Call getSegmentCall(String name, Integer pageNumber, Integer fragmentNumber, Integer segmentNumber, String storage, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/pdf/{name}/pages/{pageNumber}/fragments/{fragmentNumber}/segments/{segmentNumber}" + .replaceAll("\\{" + "name" + "\\}", apiClient.escapeString(name.toString())) + .replaceAll("\\{" + "pageNumber" + "\\}", apiClient.escapeString(pageNumber.toString())) + .replaceAll("\\{" + "fragmentNumber" + "\\}", apiClient.escapeString(fragmentNumber.toString())) + .replaceAll("\\{" + "segmentNumber" + "\\}", apiClient.escapeString(segmentNumber.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (storage != null) + localVarQueryParams.addAll(apiClient.parameterToPair("storage", storage)); + if (folder != null) + localVarQueryParams.addAll(apiClient.parameterToPair("folder", folder)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @Deprecated + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call getSegmentValidateBeforeCall(String name, Integer pageNumber, Integer fragmentNumber, Integer segmentNumber, String storage, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException("Missing the required parameter 'name' when calling getSegment(Async)"); + } + + // verify the required parameter 'pageNumber' is set + if (pageNumber == null) { + throw new ApiException("Missing the required parameter 'pageNumber' when calling getSegment(Async)"); + } + + // verify the required parameter 'fragmentNumber' is set + if (fragmentNumber == null) { + throw new ApiException("Missing the required parameter 'fragmentNumber' when calling getSegment(Async)"); + } + + // verify the required parameter 'segmentNumber' is set + if (segmentNumber == null) { + throw new ApiException("Missing the required parameter 'segmentNumber' when calling getSegment(Async)"); + } + + + com.squareup.okhttp.Call call = getSegmentCall(name, pageNumber, fragmentNumber, segmentNumber, storage, folder, progressListener, progressRequestListener); + return call; + + } + + /** + * Read segment. + * + * @param name (required) + * @param pageNumber (required) + * @param fragmentNumber (required) + * @param segmentNumber (required) + * @param storage (optional) + * @param folder (optional) + * @return TextItemResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @deprecated + */ + @Deprecated + public TextItemResponse getSegment(String name, Integer pageNumber, Integer fragmentNumber, Integer segmentNumber, String storage, String folder) throws ApiException { + ApiResponse resp = getSegmentWithHttpInfo(name, pageNumber, fragmentNumber, segmentNumber, storage, folder); + return resp.getData(); + } + + /** + * Read segment. + * + * @param name (required) + * @param pageNumber (required) + * @param fragmentNumber (required) + * @param segmentNumber (required) + * @param storage (optional) + * @param folder (optional) + * @return ApiResponse<TextItemResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @deprecated + */ + @Deprecated + public ApiResponse getSegmentWithHttpInfo(String name, Integer pageNumber, Integer fragmentNumber, Integer segmentNumber, String storage, String folder) throws ApiException { + com.squareup.okhttp.Call call = getSegmentValidateBeforeCall(name, pageNumber, fragmentNumber, segmentNumber, storage, folder, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Read segment. (asynchronously) + * + * @param name (required) + * @param pageNumber (required) + * @param fragmentNumber (required) + * @param segmentNumber (required) + * @param storage (optional) + * @param folder (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @deprecated + */ + @Deprecated + public com.squareup.okhttp.Call getSegmentAsync(String name, Integer pageNumber, Integer fragmentNumber, Integer segmentNumber, String storage, String folder, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = getSegmentValidateBeforeCall(name, pageNumber, fragmentNumber, segmentNumber, storage, folder, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for getSegmentTextFormat + * @param name (required) + * @param pageNumber (required) + * @param fragmentNumber (required) + * @param segmentNumber (required) + * @param storage (optional) + * @param folder (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @deprecated + */ + @Deprecated + public com.squareup.okhttp.Call getSegmentTextFormatCall(String name, Integer pageNumber, Integer fragmentNumber, Integer segmentNumber, String storage, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/pdf/{name}/pages/{pageNumber}/fragments/{fragmentNumber}/segments/{segmentNumber}/textformat" + .replaceAll("\\{" + "name" + "\\}", apiClient.escapeString(name.toString())) + .replaceAll("\\{" + "pageNumber" + "\\}", apiClient.escapeString(pageNumber.toString())) + .replaceAll("\\{" + "fragmentNumber" + "\\}", apiClient.escapeString(fragmentNumber.toString())) + .replaceAll("\\{" + "segmentNumber" + "\\}", apiClient.escapeString(segmentNumber.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (storage != null) + localVarQueryParams.addAll(apiClient.parameterToPair("storage", storage)); + if (folder != null) + localVarQueryParams.addAll(apiClient.parameterToPair("folder", folder)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @Deprecated + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call getSegmentTextFormatValidateBeforeCall(String name, Integer pageNumber, Integer fragmentNumber, Integer segmentNumber, String storage, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException("Missing the required parameter 'name' when calling getSegmentTextFormat(Async)"); + } + + // verify the required parameter 'pageNumber' is set + if (pageNumber == null) { + throw new ApiException("Missing the required parameter 'pageNumber' when calling getSegmentTextFormat(Async)"); + } + + // verify the required parameter 'fragmentNumber' is set + if (fragmentNumber == null) { + throw new ApiException("Missing the required parameter 'fragmentNumber' when calling getSegmentTextFormat(Async)"); + } + + // verify the required parameter 'segmentNumber' is set + if (segmentNumber == null) { + throw new ApiException("Missing the required parameter 'segmentNumber' when calling getSegmentTextFormat(Async)"); + } + + + com.squareup.okhttp.Call call = getSegmentTextFormatCall(name, pageNumber, fragmentNumber, segmentNumber, storage, folder, progressListener, progressRequestListener); + return call; + + } + + /** + * Read segment text format. + * + * @param name (required) + * @param pageNumber (required) + * @param fragmentNumber (required) + * @param segmentNumber (required) + * @param storage (optional) + * @param folder (optional) + * @return TextFormatResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @deprecated + */ + @Deprecated + public TextFormatResponse getSegmentTextFormat(String name, Integer pageNumber, Integer fragmentNumber, Integer segmentNumber, String storage, String folder) throws ApiException { + ApiResponse resp = getSegmentTextFormatWithHttpInfo(name, pageNumber, fragmentNumber, segmentNumber, storage, folder); + return resp.getData(); + } + + /** + * Read segment text format. + * + * @param name (required) + * @param pageNumber (required) + * @param fragmentNumber (required) + * @param segmentNumber (required) + * @param storage (optional) + * @param folder (optional) + * @return ApiResponse<TextFormatResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @deprecated + */ + @Deprecated + public ApiResponse getSegmentTextFormatWithHttpInfo(String name, Integer pageNumber, Integer fragmentNumber, Integer segmentNumber, String storage, String folder) throws ApiException { + com.squareup.okhttp.Call call = getSegmentTextFormatValidateBeforeCall(name, pageNumber, fragmentNumber, segmentNumber, storage, folder, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Read segment text format. (asynchronously) + * + * @param name (required) + * @param pageNumber (required) + * @param fragmentNumber (required) + * @param segmentNumber (required) + * @param storage (optional) + * @param folder (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @deprecated + */ + @Deprecated + public com.squareup.okhttp.Call getSegmentTextFormatAsync(String name, Integer pageNumber, Integer fragmentNumber, Integer segmentNumber, String storage, String folder, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = getSegmentTextFormatValidateBeforeCall(name, pageNumber, fragmentNumber, segmentNumber, storage, folder, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for getSegments + * @param name (required) + * @param pageNumber (required) + * @param fragmentNumber (required) + * @param withEmpty (optional) + * @param storage (optional) + * @param folder (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @deprecated + */ + @Deprecated + public com.squareup.okhttp.Call getSegmentsCall(String name, Integer pageNumber, Integer fragmentNumber, String withEmpty, String storage, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/pdf/{name}/pages/{pageNumber}/fragments/{fragmentNumber}/segments" + .replaceAll("\\{" + "name" + "\\}", apiClient.escapeString(name.toString())) + .replaceAll("\\{" + "pageNumber" + "\\}", apiClient.escapeString(pageNumber.toString())) + .replaceAll("\\{" + "fragmentNumber" + "\\}", apiClient.escapeString(fragmentNumber.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (withEmpty != null) + localVarQueryParams.addAll(apiClient.parameterToPair("withEmpty", withEmpty)); + if (storage != null) + localVarQueryParams.addAll(apiClient.parameterToPair("storage", storage)); + if (folder != null) + localVarQueryParams.addAll(apiClient.parameterToPair("folder", folder)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @Deprecated + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call getSegmentsValidateBeforeCall(String name, Integer pageNumber, Integer fragmentNumber, String withEmpty, String storage, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException("Missing the required parameter 'name' when calling getSegments(Async)"); + } + + // verify the required parameter 'pageNumber' is set + if (pageNumber == null) { + throw new ApiException("Missing the required parameter 'pageNumber' when calling getSegments(Async)"); + } + + // verify the required parameter 'fragmentNumber' is set + if (fragmentNumber == null) { + throw new ApiException("Missing the required parameter 'fragmentNumber' when calling getSegments(Async)"); + } + + + com.squareup.okhttp.Call call = getSegmentsCall(name, pageNumber, fragmentNumber, withEmpty, storage, folder, progressListener, progressRequestListener); + return call; + + } + + /** + * Read fragment segments. + * + * @param name (required) + * @param pageNumber (required) + * @param fragmentNumber (required) + * @param withEmpty (optional) + * @param storage (optional) + * @param folder (optional) + * @return TextItemsResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @deprecated + */ + @Deprecated + public TextItemsResponse getSegments(String name, Integer pageNumber, Integer fragmentNumber, String withEmpty, String storage, String folder) throws ApiException { + ApiResponse resp = getSegmentsWithHttpInfo(name, pageNumber, fragmentNumber, withEmpty, storage, folder); + return resp.getData(); + } + + /** + * Read fragment segments. + * + * @param name (required) + * @param pageNumber (required) + * @param fragmentNumber (required) + * @param withEmpty (optional) + * @param storage (optional) + * @param folder (optional) + * @return ApiResponse<TextItemsResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @deprecated + */ + @Deprecated + public ApiResponse getSegmentsWithHttpInfo(String name, Integer pageNumber, Integer fragmentNumber, String withEmpty, String storage, String folder) throws ApiException { + com.squareup.okhttp.Call call = getSegmentsValidateBeforeCall(name, pageNumber, fragmentNumber, withEmpty, storage, folder, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Read fragment segments. (asynchronously) + * + * @param name (required) + * @param pageNumber (required) + * @param fragmentNumber (required) + * @param withEmpty (optional) + * @param storage (optional) + * @param folder (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @deprecated + */ + @Deprecated + public com.squareup.okhttp.Call getSegmentsAsync(String name, Integer pageNumber, Integer fragmentNumber, String withEmpty, String storage, String folder, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = getSegmentsValidateBeforeCall(name, pageNumber, fragmentNumber, withEmpty, storage, folder, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for getSvgInStorageToPdf + * @param srcPath Full source filename (ex. /folder1/folder2/template.svg) (required) + * @param adjustPageSize Adjust page size (optional) + * @param height Page height (optional) + * @param width Page width (optional) + * @param isLandscape Is page landscaped (optional) + * @param marginLeft Page margin left (optional) + * @param marginBottom Page margin bottom (optional) + * @param marginRight Page margin right (optional) + * @param marginTop Page margin top (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call getSvgInStorageToPdfCall(String srcPath, Boolean adjustPageSize, Double height, Double width, Boolean isLandscape, Double marginLeft, Double marginBottom, Double marginRight, Double marginTop, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/pdf/create/svg"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (srcPath != null) + localVarQueryParams.addAll(apiClient.parameterToPair("srcPath", srcPath)); + if (adjustPageSize != null) + localVarQueryParams.addAll(apiClient.parameterToPair("adjustPageSize", adjustPageSize)); + if (height != null) + localVarQueryParams.addAll(apiClient.parameterToPair("height", height)); + if (width != null) + localVarQueryParams.addAll(apiClient.parameterToPair("width", width)); + if (isLandscape != null) + localVarQueryParams.addAll(apiClient.parameterToPair("isLandscape", isLandscape)); + if (marginLeft != null) + localVarQueryParams.addAll(apiClient.parameterToPair("marginLeft", marginLeft)); + if (marginBottom != null) + localVarQueryParams.addAll(apiClient.parameterToPair("marginBottom", marginBottom)); + if (marginRight != null) + localVarQueryParams.addAll(apiClient.parameterToPair("marginRight", marginRight)); + if (marginTop != null) + localVarQueryParams.addAll(apiClient.parameterToPair("marginTop", marginTop)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "multipart/form-data" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call getSvgInStorageToPdfValidateBeforeCall(String srcPath, Boolean adjustPageSize, Double height, Double width, Boolean isLandscape, Double marginLeft, Double marginBottom, Double marginRight, Double marginTop, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + // verify the required parameter 'srcPath' is set + if (srcPath == null) { + throw new ApiException("Missing the required parameter 'srcPath' when calling getSvgInStorageToPdf(Async)"); + } + + + com.squareup.okhttp.Call call = getSvgInStorageToPdfCall(srcPath, adjustPageSize, height, width, isLandscape, marginLeft, marginBottom, marginRight, marginTop, progressListener, progressRequestListener); + return call; + + } + + /** + * Convert SVG file (located on storage) to PDF format and return resulting file in response. + * + * @param srcPath Full source filename (ex. /folder1/folder2/template.svg) (required) + * @param adjustPageSize Adjust page size (optional) + * @param height Page height (optional) + * @param width Page width (optional) + * @param isLandscape Is page landscaped (optional) + * @param marginLeft Page margin left (optional) + * @param marginBottom Page margin bottom (optional) + * @param marginRight Page margin right (optional) + * @param marginTop Page margin top (optional) + * @return File + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public File getSvgInStorageToPdf(String srcPath, Boolean adjustPageSize, Double height, Double width, Boolean isLandscape, Double marginLeft, Double marginBottom, Double marginRight, Double marginTop) throws ApiException { + ApiResponse resp = getSvgInStorageToPdfWithHttpInfo(srcPath, adjustPageSize, height, width, isLandscape, marginLeft, marginBottom, marginRight, marginTop); + return resp.getData(); + } + + /** + * Convert SVG file (located on storage) to PDF format and return resulting file in response. + * + * @param srcPath Full source filename (ex. /folder1/folder2/template.svg) (required) + * @param adjustPageSize Adjust page size (optional) + * @param height Page height (optional) + * @param width Page width (optional) + * @param isLandscape Is page landscaped (optional) + * @param marginLeft Page margin left (optional) + * @param marginBottom Page margin bottom (optional) + * @param marginRight Page margin right (optional) + * @param marginTop Page margin top (optional) + * @return ApiResponse<File> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse getSvgInStorageToPdfWithHttpInfo(String srcPath, Boolean adjustPageSize, Double height, Double width, Boolean isLandscape, Double marginLeft, Double marginBottom, Double marginRight, Double marginTop) throws ApiException { + com.squareup.okhttp.Call call = getSvgInStorageToPdfValidateBeforeCall(srcPath, adjustPageSize, height, width, isLandscape, marginLeft, marginBottom, marginRight, marginTop, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Convert SVG file (located on storage) to PDF format and return resulting file in response. (asynchronously) + * + * @param srcPath Full source filename (ex. /folder1/folder2/template.svg) (required) + * @param adjustPageSize Adjust page size (optional) + * @param height Page height (optional) + * @param width Page width (optional) + * @param isLandscape Is page landscaped (optional) + * @param marginLeft Page margin left (optional) + * @param marginBottom Page margin bottom (optional) + * @param marginRight Page margin right (optional) + * @param marginTop Page margin top (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call getSvgInStorageToPdfAsync(String srcPath, Boolean adjustPageSize, Double height, Double width, Boolean isLandscape, Double marginLeft, Double marginBottom, Double marginRight, Double marginTop, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = getSvgInStorageToPdfValidateBeforeCall(srcPath, adjustPageSize, height, width, isLandscape, marginLeft, marginBottom, marginRight, marginTop, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for getText + * @param name The document name. (required) + * @param X (required) + * @param Y (required) + * @param width (required) + * @param height (required) + * @param format List of formats for search. (optional) + * @param regex Formats are specified as a regular expression. (optional) + * @param splitRects Split result fragments (default is true). (optional) + * @param folder The document folder. (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call getTextCall(String name, Integer X, Integer Y, Integer width, Integer height, List format, String regex, Boolean splitRects, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/pdf/{name}/text" + .replaceAll("\\{" + "name" + "\\}", apiClient.escapeString(name.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (format != null) + localVarCollectionQueryParams.addAll(apiClient.parameterToPairs("multi", "format", format)); + if (regex != null) + localVarQueryParams.addAll(apiClient.parameterToPair("regex", regex)); + if (X != null) + localVarQueryParams.addAll(apiClient.parameterToPair("X", X)); + if (Y != null) + localVarQueryParams.addAll(apiClient.parameterToPair("Y", Y)); + if (width != null) + localVarQueryParams.addAll(apiClient.parameterToPair("Width", width)); + if (height != null) + localVarQueryParams.addAll(apiClient.parameterToPair("Height", height)); + if (splitRects != null) + localVarQueryParams.addAll(apiClient.parameterToPair("splitRects", splitRects)); + if (folder != null) + localVarQueryParams.addAll(apiClient.parameterToPair("folder", folder)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call getTextValidateBeforeCall(String name, Integer X, Integer Y, Integer width, Integer height, List format, String regex, Boolean splitRects, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException("Missing the required parameter 'name' when calling getText(Async)"); + } + + // verify the required parameter 'X' is set + if (X == null) { + throw new ApiException("Missing the required parameter 'X' when calling getText(Async)"); + } + + // verify the required parameter 'Y' is set + if (Y == null) { + throw new ApiException("Missing the required parameter 'Y' when calling getText(Async)"); + } + + // verify the required parameter 'width' is set + if (width == null) { + throw new ApiException("Missing the required parameter 'width' when calling getText(Async)"); + } + + // verify the required parameter 'height' is set + if (height == null) { + throw new ApiException("Missing the required parameter 'height' when calling getText(Async)"); + } + + + com.squareup.okhttp.Call call = getTextCall(name, X, Y, width, height, format, regex, splitRects, folder, progressListener, progressRequestListener); + return call; + + } + + /** + * Read document text. + * + * @param name The document name. (required) + * @param X (required) + * @param Y (required) + * @param width (required) + * @param height (required) + * @param format List of formats for search. (optional) + * @param regex Formats are specified as a regular expression. (optional) + * @param splitRects Split result fragments (default is true). (optional) + * @param folder The document folder. (optional) + * @return TextRectsResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public TextRectsResponse getText(String name, Integer X, Integer Y, Integer width, Integer height, List format, String regex, Boolean splitRects, String folder) throws ApiException { + ApiResponse resp = getTextWithHttpInfo(name, X, Y, width, height, format, regex, splitRects, folder); + return resp.getData(); + } + + /** + * Read document text. + * + * @param name The document name. (required) + * @param X (required) + * @param Y (required) + * @param width (required) + * @param height (required) + * @param format List of formats for search. (optional) + * @param regex Formats are specified as a regular expression. (optional) + * @param splitRects Split result fragments (default is true). (optional) + * @param folder The document folder. (optional) + * @return ApiResponse<TextRectsResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse getTextWithHttpInfo(String name, Integer X, Integer Y, Integer width, Integer height, List format, String regex, Boolean splitRects, String folder) throws ApiException { + com.squareup.okhttp.Call call = getTextValidateBeforeCall(name, X, Y, width, height, format, regex, splitRects, folder, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Read document text. (asynchronously) + * + * @param name The document name. (required) + * @param X (required) + * @param Y (required) + * @param width (required) + * @param height (required) + * @param format List of formats for search. (optional) + * @param regex Formats are specified as a regular expression. (optional) + * @param splitRects Split result fragments (default is true). (optional) + * @param folder The document folder. (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call getTextAsync(String name, Integer X, Integer Y, Integer width, Integer height, List format, String regex, Boolean splitRects, String folder, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = getTextValidateBeforeCall(name, X, Y, width, height, format, regex, splitRects, folder, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for getTextItems + * @param name (required) + * @param withEmpty (optional) + * @param storage (optional) + * @param folder (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @deprecated + */ + @Deprecated + public com.squareup.okhttp.Call getTextItemsCall(String name, String withEmpty, String storage, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/pdf/{name}/textItems" + .replaceAll("\\{" + "name" + "\\}", apiClient.escapeString(name.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (withEmpty != null) + localVarQueryParams.addAll(apiClient.parameterToPair("withEmpty", withEmpty)); + if (storage != null) + localVarQueryParams.addAll(apiClient.parameterToPair("storage", storage)); + if (folder != null) + localVarQueryParams.addAll(apiClient.parameterToPair("folder", folder)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @Deprecated + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call getTextItemsValidateBeforeCall(String name, String withEmpty, String storage, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException("Missing the required parameter 'name' when calling getTextItems(Async)"); + } + + + com.squareup.okhttp.Call call = getTextItemsCall(name, withEmpty, storage, folder, progressListener, progressRequestListener); + return call; + + } + + /** + * Read document text items. + * + * @param name (required) + * @param withEmpty (optional) + * @param storage (optional) + * @param folder (optional) + * @return TextItemsResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @deprecated + */ + @Deprecated + public TextItemsResponse getTextItems(String name, String withEmpty, String storage, String folder) throws ApiException { + ApiResponse resp = getTextItemsWithHttpInfo(name, withEmpty, storage, folder); + return resp.getData(); + } + + /** + * Read document text items. + * + * @param name (required) + * @param withEmpty (optional) + * @param storage (optional) + * @param folder (optional) + * @return ApiResponse<TextItemsResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @deprecated + */ + @Deprecated + public ApiResponse getTextItemsWithHttpInfo(String name, String withEmpty, String storage, String folder) throws ApiException { + com.squareup.okhttp.Call call = getTextItemsValidateBeforeCall(name, withEmpty, storage, folder, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Read document text items. (asynchronously) + * + * @param name (required) + * @param withEmpty (optional) + * @param storage (optional) + * @param folder (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @deprecated + */ + @Deprecated + public com.squareup.okhttp.Call getTextItemsAsync(String name, String withEmpty, String storage, String folder, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = getTextItemsValidateBeforeCall(name, withEmpty, storage, folder, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for getVerifySignature + * @param name The document name. (required) + * @param signName Sign name. (required) + * @param folder The document folder. (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call getVerifySignatureCall(String name, String signName, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/pdf/{name}/verifySignature" + .replaceAll("\\{" + "name" + "\\}", apiClient.escapeString(name.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (signName != null) + localVarQueryParams.addAll(apiClient.parameterToPair("signName", signName)); + if (folder != null) + localVarQueryParams.addAll(apiClient.parameterToPair("folder", folder)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call getVerifySignatureValidateBeforeCall(String name, String signName, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException("Missing the required parameter 'name' when calling getVerifySignature(Async)"); + } + + // verify the required parameter 'signName' is set + if (signName == null) { + throw new ApiException("Missing the required parameter 'signName' when calling getVerifySignature(Async)"); + } + + + com.squareup.okhttp.Call call = getVerifySignatureCall(name, signName, folder, progressListener, progressRequestListener); + return call; + + } + + /** + * Verify signature document. + * + * @param name The document name. (required) + * @param signName Sign name. (required) + * @param folder The document folder. (optional) + * @return SignatureVerifyResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public SignatureVerifyResponse getVerifySignature(String name, String signName, String folder) throws ApiException { + ApiResponse resp = getVerifySignatureWithHttpInfo(name, signName, folder); + return resp.getData(); + } + + /** + * Verify signature document. + * + * @param name The document name. (required) + * @param signName Sign name. (required) + * @param folder The document folder. (optional) + * @return ApiResponse<SignatureVerifyResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse getVerifySignatureWithHttpInfo(String name, String signName, String folder) throws ApiException { + com.squareup.okhttp.Call call = getVerifySignatureValidateBeforeCall(name, signName, folder, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Verify signature document. (asynchronously) + * + * @param name The document name. (required) + * @param signName Sign name. (required) + * @param folder The document folder. (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call getVerifySignatureAsync(String name, String signName, String folder, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = getVerifySignatureValidateBeforeCall(name, signName, folder, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for getWebInStorageToPdf + * @param url Source url (required) + * @param height Page height (optional) + * @param width Page width (optional) + * @param isLandscape Is page landscaped (optional) + * @param marginLeft Page margin left (optional) + * @param marginBottom Page margin bottom (optional) + * @param marginRight Page margin right (optional) + * @param marginTop Page margin top (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call getWebInStorageToPdfCall(String url, Double height, Double width, Boolean isLandscape, Double marginLeft, Double marginBottom, Double marginRight, Double marginTop, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/pdf/create/web"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (url != null) + localVarQueryParams.addAll(apiClient.parameterToPair("url", url)); + if (height != null) + localVarQueryParams.addAll(apiClient.parameterToPair("height", height)); + if (width != null) + localVarQueryParams.addAll(apiClient.parameterToPair("width", width)); + if (isLandscape != null) + localVarQueryParams.addAll(apiClient.parameterToPair("isLandscape", isLandscape)); + if (marginLeft != null) + localVarQueryParams.addAll(apiClient.parameterToPair("marginLeft", marginLeft)); + if (marginBottom != null) + localVarQueryParams.addAll(apiClient.parameterToPair("marginBottom", marginBottom)); + if (marginRight != null) + localVarQueryParams.addAll(apiClient.parameterToPair("marginRight", marginRight)); + if (marginTop != null) + localVarQueryParams.addAll(apiClient.parameterToPair("marginTop", marginTop)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "multipart/form-data" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call getWebInStorageToPdfValidateBeforeCall(String url, Double height, Double width, Boolean isLandscape, Double marginLeft, Double marginBottom, Double marginRight, Double marginTop, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + // verify the required parameter 'url' is set + if (url == null) { + throw new ApiException("Missing the required parameter 'url' when calling getWebInStorageToPdf(Async)"); + } + + + com.squareup.okhttp.Call call = getWebInStorageToPdfCall(url, height, width, isLandscape, marginLeft, marginBottom, marginRight, marginTop, progressListener, progressRequestListener); + return call; + + } + + /** + * Convert web page to PDF format and return resulting file in response. + * + * @param url Source url (required) + * @param height Page height (optional) + * @param width Page width (optional) + * @param isLandscape Is page landscaped (optional) + * @param marginLeft Page margin left (optional) + * @param marginBottom Page margin bottom (optional) + * @param marginRight Page margin right (optional) + * @param marginTop Page margin top (optional) + * @return File + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public File getWebInStorageToPdf(String url, Double height, Double width, Boolean isLandscape, Double marginLeft, Double marginBottom, Double marginRight, Double marginTop) throws ApiException { + ApiResponse resp = getWebInStorageToPdfWithHttpInfo(url, height, width, isLandscape, marginLeft, marginBottom, marginRight, marginTop); + return resp.getData(); + } + + /** + * Convert web page to PDF format and return resulting file in response. + * + * @param url Source url (required) + * @param height Page height (optional) + * @param width Page width (optional) + * @param isLandscape Is page landscaped (optional) + * @param marginLeft Page margin left (optional) + * @param marginBottom Page margin bottom (optional) + * @param marginRight Page margin right (optional) + * @param marginTop Page margin top (optional) + * @return ApiResponse<File> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse getWebInStorageToPdfWithHttpInfo(String url, Double height, Double width, Boolean isLandscape, Double marginLeft, Double marginBottom, Double marginRight, Double marginTop) throws ApiException { + com.squareup.okhttp.Call call = getWebInStorageToPdfValidateBeforeCall(url, height, width, isLandscape, marginLeft, marginBottom, marginRight, marginTop, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Convert web page to PDF format and return resulting file in response. (asynchronously) + * + * @param url Source url (required) + * @param height Page height (optional) + * @param width Page width (optional) + * @param isLandscape Is page landscaped (optional) + * @param marginLeft Page margin left (optional) + * @param marginBottom Page margin bottom (optional) + * @param marginRight Page margin right (optional) + * @param marginTop Page margin top (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call getWebInStorageToPdfAsync(String url, Double height, Double width, Boolean isLandscape, Double marginLeft, Double marginBottom, Double marginRight, Double marginTop, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = getWebInStorageToPdfValidateBeforeCall(url, height, width, isLandscape, marginLeft, marginBottom, marginRight, marginTop, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for getWordsPerPage + * @param name The document name. (required) + * @param storage The document storage. (optional) + * @param folder The document folder. (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call getWordsPerPageCall(String name, String storage, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/pdf/{name}/pages/wordCount" + .replaceAll("\\{" + "name" + "\\}", apiClient.escapeString(name.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (storage != null) + localVarQueryParams.addAll(apiClient.parameterToPair("storage", storage)); + if (folder != null) + localVarQueryParams.addAll(apiClient.parameterToPair("folder", folder)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call getWordsPerPageValidateBeforeCall(String name, String storage, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException("Missing the required parameter 'name' when calling getWordsPerPage(Async)"); + } + + + com.squareup.okhttp.Call call = getWordsPerPageCall(name, storage, folder, progressListener, progressRequestListener); + return call; + + } + + /** + * Get number of words per document page. + * + * @param name The document name. (required) + * @param storage The document storage. (optional) + * @param folder The document folder. (optional) + * @return WordCountResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public WordCountResponse getWordsPerPage(String name, String storage, String folder) throws ApiException { + ApiResponse resp = getWordsPerPageWithHttpInfo(name, storage, folder); + return resp.getData(); + } + + /** + * Get number of words per document page. + * + * @param name The document name. (required) + * @param storage The document storage. (optional) + * @param folder The document folder. (optional) + * @return ApiResponse<WordCountResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse getWordsPerPageWithHttpInfo(String name, String storage, String folder) throws ApiException { + com.squareup.okhttp.Call call = getWordsPerPageValidateBeforeCall(name, storage, folder, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Get number of words per document page. (asynchronously) + * + * @param name The document name. (required) + * @param storage The document storage. (optional) + * @param folder The document folder. (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call getWordsPerPageAsync(String name, String storage, String folder, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = getWordsPerPageValidateBeforeCall(name, storage, folder, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for getXfaPdfInStorageToAcroForm + * @param name The document name. (required) + * @param folder The document folder. (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call getXfaPdfInStorageToAcroFormCall(String name, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/pdf/{name}/convert/xfatoacroform" + .replaceAll("\\{" + "name" + "\\}", apiClient.escapeString(name.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (folder != null) + localVarQueryParams.addAll(apiClient.parameterToPair("folder", folder)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "multipart/form-data" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call getXfaPdfInStorageToAcroFormValidateBeforeCall(String name, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException("Missing the required parameter 'name' when calling getXfaPdfInStorageToAcroForm(Async)"); + } + + + com.squareup.okhttp.Call call = getXfaPdfInStorageToAcroFormCall(name, folder, progressListener, progressRequestListener); + return call; + + } + + /** + * Converts PDF document which contatins XFA form (located on storage) to PDF with AcroForm and returns resulting file response content + * + * @param name The document name. (required) + * @param folder The document folder. (optional) + * @return File + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public File getXfaPdfInStorageToAcroForm(String name, String folder) throws ApiException { + ApiResponse resp = getXfaPdfInStorageToAcroFormWithHttpInfo(name, folder); + return resp.getData(); + } + + /** + * Converts PDF document which contatins XFA form (located on storage) to PDF with AcroForm and returns resulting file response content + * + * @param name The document name. (required) + * @param folder The document folder. (optional) + * @return ApiResponse<File> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse getXfaPdfInStorageToAcroFormWithHttpInfo(String name, String folder) throws ApiException { + com.squareup.okhttp.Call call = getXfaPdfInStorageToAcroFormValidateBeforeCall(name, folder, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Converts PDF document which contatins XFA form (located on storage) to PDF with AcroForm and returns resulting file response content (asynchronously) + * + * @param name The document name. (required) + * @param folder The document folder. (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call getXfaPdfInStorageToAcroFormAsync(String name, String folder, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = getXfaPdfInStorageToAcroFormValidateBeforeCall(name, folder, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for getXmlInStorageToPdf + * @param srcPath Full source filename (ex. /folder1/folder2/template.xml) (required) + * @param xslFilePath Full XSL source filename (ex. /folder1/folder2/template.xsl) (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call getXmlInStorageToPdfCall(String srcPath, String xslFilePath, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/pdf/create/xml"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (srcPath != null) + localVarQueryParams.addAll(apiClient.parameterToPair("srcPath", srcPath)); + if (xslFilePath != null) + localVarQueryParams.addAll(apiClient.parameterToPair("xslFilePath", xslFilePath)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "multipart/form-data" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call getXmlInStorageToPdfValidateBeforeCall(String srcPath, String xslFilePath, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + // verify the required parameter 'srcPath' is set + if (srcPath == null) { + throw new ApiException("Missing the required parameter 'srcPath' when calling getXmlInStorageToPdf(Async)"); + } + + + com.squareup.okhttp.Call call = getXmlInStorageToPdfCall(srcPath, xslFilePath, progressListener, progressRequestListener); + return call; + + } + + /** + * Convert XML file (located on storage) to PDF format and return resulting file in response. + * + * @param srcPath Full source filename (ex. /folder1/folder2/template.xml) (required) + * @param xslFilePath Full XSL source filename (ex. /folder1/folder2/template.xsl) (optional) + * @return File + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public File getXmlInStorageToPdf(String srcPath, String xslFilePath) throws ApiException { + ApiResponse resp = getXmlInStorageToPdfWithHttpInfo(srcPath, xslFilePath); + return resp.getData(); + } + + /** + * Convert XML file (located on storage) to PDF format and return resulting file in response. + * + * @param srcPath Full source filename (ex. /folder1/folder2/template.xml) (required) + * @param xslFilePath Full XSL source filename (ex. /folder1/folder2/template.xsl) (optional) + * @return ApiResponse<File> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse getXmlInStorageToPdfWithHttpInfo(String srcPath, String xslFilePath) throws ApiException { + com.squareup.okhttp.Call call = getXmlInStorageToPdfValidateBeforeCall(srcPath, xslFilePath, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Convert XML file (located on storage) to PDF format and return resulting file in response. (asynchronously) + * + * @param srcPath Full source filename (ex. /folder1/folder2/template.xml) (required) + * @param xslFilePath Full XSL source filename (ex. /folder1/folder2/template.xsl) (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call getXmlInStorageToPdfAsync(String srcPath, String xslFilePath, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = getXmlInStorageToPdfValidateBeforeCall(srcPath, xslFilePath, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for getXpsInStorageToPdf + * @param srcPath Full source filename (ex. /folder1/folder2/template.xps) (required) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call getXpsInStorageToPdfCall(String srcPath, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/pdf/create/xps"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (srcPath != null) + localVarQueryParams.addAll(apiClient.parameterToPair("srcPath", srcPath)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "multipart/form-data" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call getXpsInStorageToPdfValidateBeforeCall(String srcPath, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + // verify the required parameter 'srcPath' is set + if (srcPath == null) { + throw new ApiException("Missing the required parameter 'srcPath' when calling getXpsInStorageToPdf(Async)"); + } + + + com.squareup.okhttp.Call call = getXpsInStorageToPdfCall(srcPath, progressListener, progressRequestListener); + return call; + + } + + /** + * Convert XPS file (located on storage) to PDF format and return resulting file in response. + * + * @param srcPath Full source filename (ex. /folder1/folder2/template.xps) (required) + * @return File + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public File getXpsInStorageToPdf(String srcPath) throws ApiException { + ApiResponse resp = getXpsInStorageToPdfWithHttpInfo(srcPath); + return resp.getData(); + } + + /** + * Convert XPS file (located on storage) to PDF format and return resulting file in response. + * + * @param srcPath Full source filename (ex. /folder1/folder2/template.xps) (required) + * @return ApiResponse<File> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse getXpsInStorageToPdfWithHttpInfo(String srcPath) throws ApiException { + com.squareup.okhttp.Call call = getXpsInStorageToPdfValidateBeforeCall(srcPath, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Convert XPS file (located on storage) to PDF format and return resulting file in response. (asynchronously) + * + * @param srcPath Full source filename (ex. /folder1/folder2/template.xps) (required) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call getXpsInStorageToPdfAsync(String srcPath, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = getXpsInStorageToPdfValidateBeforeCall(srcPath, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for getXslFoInStorageToPdf + * @param srcPath Full source filename (ex. /folder1/folder2/template.xslfo) (required) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call getXslFoInStorageToPdfCall(String srcPath, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/pdf/create/xslfo"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (srcPath != null) + localVarQueryParams.addAll(apiClient.parameterToPair("srcPath", srcPath)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "multipart/form-data" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call getXslFoInStorageToPdfValidateBeforeCall(String srcPath, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + // verify the required parameter 'srcPath' is set + if (srcPath == null) { + throw new ApiException("Missing the required parameter 'srcPath' when calling getXslFoInStorageToPdf(Async)"); + } + + + com.squareup.okhttp.Call call = getXslFoInStorageToPdfCall(srcPath, progressListener, progressRequestListener); + return call; + + } + + /** + * Convert XslFo file (located on storage) to PDF format and return resulting file in response. + * + * @param srcPath Full source filename (ex. /folder1/folder2/template.xslfo) (required) + * @return File + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public File getXslFoInStorageToPdf(String srcPath) throws ApiException { + ApiResponse resp = getXslFoInStorageToPdfWithHttpInfo(srcPath); + return resp.getData(); + } + + /** + * Convert XslFo file (located on storage) to PDF format and return resulting file in response. + * + * @param srcPath Full source filename (ex. /folder1/folder2/template.xslfo) (required) + * @return ApiResponse<File> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse getXslFoInStorageToPdfWithHttpInfo(String srcPath) throws ApiException { + com.squareup.okhttp.Call call = getXslFoInStorageToPdfValidateBeforeCall(srcPath, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Convert XslFo file (located on storage) to PDF format and return resulting file in response. (asynchronously) + * + * @param srcPath Full source filename (ex. /folder1/folder2/template.xslfo) (required) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call getXslFoInStorageToPdfAsync(String srcPath, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = getXslFoInStorageToPdfValidateBeforeCall(srcPath, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for postAppendDocument + * @param name The original document name. (required) + * @param appendDocument with the append document data. (optional) + * @param appendFile Append file server path. (optional) + * @param startPage Appending start page. (optional, default to 0) + * @param endPage Appending end page. (optional, default to 0) + * @param storage The documents storage. (optional) + * @param folder The original document folder. (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call postAppendDocumentCall(String name, AppendDocument appendDocument, String appendFile, Integer startPage, Integer endPage, String storage, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = appendDocument; + + // create path and map variables + String localVarPath = "/pdf/{name}/appendDocument" + .replaceAll("\\{" + "name" + "\\}", apiClient.escapeString(name.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (appendFile != null) + localVarQueryParams.addAll(apiClient.parameterToPair("appendFile", appendFile)); + if (startPage != null) + localVarQueryParams.addAll(apiClient.parameterToPair("startPage", startPage)); + if (endPage != null) + localVarQueryParams.addAll(apiClient.parameterToPair("endPage", endPage)); + if (storage != null) + localVarQueryParams.addAll(apiClient.parameterToPair("storage", storage)); + if (folder != null) + localVarQueryParams.addAll(apiClient.parameterToPair("folder", folder)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call postAppendDocumentValidateBeforeCall(String name, AppendDocument appendDocument, String appendFile, Integer startPage, Integer endPage, String storage, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException("Missing the required parameter 'name' when calling postAppendDocument(Async)"); + } + + + com.squareup.okhttp.Call call = postAppendDocumentCall(name, appendDocument, appendFile, startPage, endPage, storage, folder, progressListener, progressRequestListener); + return call; + + } + + /** + * Append document to existing one. + * + * @param name The original document name. (required) + * @param appendDocument with the append document data. (optional) + * @param appendFile Append file server path. (optional) + * @param startPage Appending start page. (optional, default to 0) + * @param endPage Appending end page. (optional, default to 0) + * @param storage The documents storage. (optional) + * @param folder The original document folder. (optional) + * @return DocumentResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public DocumentResponse postAppendDocument(String name, AppendDocument appendDocument, String appendFile, Integer startPage, Integer endPage, String storage, String folder) throws ApiException { + ApiResponse resp = postAppendDocumentWithHttpInfo(name, appendDocument, appendFile, startPage, endPage, storage, folder); + return resp.getData(); + } + + /** + * Append document to existing one. + * + * @param name The original document name. (required) + * @param appendDocument with the append document data. (optional) + * @param appendFile Append file server path. (optional) + * @param startPage Appending start page. (optional, default to 0) + * @param endPage Appending end page. (optional, default to 0) + * @param storage The documents storage. (optional) + * @param folder The original document folder. (optional) + * @return ApiResponse<DocumentResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse postAppendDocumentWithHttpInfo(String name, AppendDocument appendDocument, String appendFile, Integer startPage, Integer endPage, String storage, String folder) throws ApiException { + com.squareup.okhttp.Call call = postAppendDocumentValidateBeforeCall(name, appendDocument, appendFile, startPage, endPage, storage, folder, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Append document to existing one. (asynchronously) + * + * @param name The original document name. (required) + * @param appendDocument with the append document data. (optional) + * @param appendFile Append file server path. (optional) + * @param startPage Appending start page. (optional, default to 0) + * @param endPage Appending end page. (optional, default to 0) + * @param storage The documents storage. (optional) + * @param folder The original document folder. (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call postAppendDocumentAsync(String name, AppendDocument appendDocument, String appendFile, Integer startPage, Integer endPage, String storage, String folder, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = postAppendDocumentValidateBeforeCall(name, appendDocument, appendFile, startPage, endPage, storage, folder, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for postCreateField + * @param name The document name. (required) + * @param page Document page number. (required) + * @param field with the field data. (optional) + * @param storage The document storage. (optional) + * @param folder The document folder. (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call postCreateFieldCall(String name, Integer page, Field field, String storage, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = field; + + // create path and map variables + String localVarPath = "/pdf/{name}/fields" + .replaceAll("\\{" + "name" + "\\}", apiClient.escapeString(name.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (page != null) + localVarQueryParams.addAll(apiClient.parameterToPair("page", page)); + if (storage != null) + localVarQueryParams.addAll(apiClient.parameterToPair("storage", storage)); + if (folder != null) + localVarQueryParams.addAll(apiClient.parameterToPair("folder", folder)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call postCreateFieldValidateBeforeCall(String name, Integer page, Field field, String storage, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException("Missing the required parameter 'name' when calling postCreateField(Async)"); + } + + // verify the required parameter 'page' is set + if (page == null) { + throw new ApiException("Missing the required parameter 'page' when calling postCreateField(Async)"); + } + + + com.squareup.okhttp.Call call = postCreateFieldCall(name, page, field, storage, folder, progressListener, progressRequestListener); + return call; + + } + + /** + * Create field. + * + * @param name The document name. (required) + * @param page Document page number. (required) + * @param field with the field data. (optional) + * @param storage The document storage. (optional) + * @param folder The document folder. (optional) + * @return SaaSposeResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public SaaSposeResponse postCreateField(String name, Integer page, Field field, String storage, String folder) throws ApiException { + ApiResponse resp = postCreateFieldWithHttpInfo(name, page, field, storage, folder); + return resp.getData(); + } + + /** + * Create field. + * + * @param name The document name. (required) + * @param page Document page number. (required) + * @param field with the field data. (optional) + * @param storage The document storage. (optional) + * @param folder The document folder. (optional) + * @return ApiResponse<SaaSposeResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse postCreateFieldWithHttpInfo(String name, Integer page, Field field, String storage, String folder) throws ApiException { + com.squareup.okhttp.Call call = postCreateFieldValidateBeforeCall(name, page, field, storage, folder, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Create field. (asynchronously) + * + * @param name The document name. (required) + * @param page Document page number. (required) + * @param field with the field data. (optional) + * @param storage The document storage. (optional) + * @param folder The document folder. (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call postCreateFieldAsync(String name, Integer page, Field field, String storage, String folder, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = postCreateFieldValidateBeforeCall(name, page, field, storage, folder, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for postDocumentReplaceText + * @param name (required) + * @param textReplace (required) + * @param storage (optional) + * @param folder (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @deprecated + */ + @Deprecated + public com.squareup.okhttp.Call postDocumentReplaceTextCall(String name, TextReplaceRequest textReplace, String storage, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = textReplace; + + // create path and map variables + String localVarPath = "/pdf/{name}/replaceText" + .replaceAll("\\{" + "name" + "\\}", apiClient.escapeString(name.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (storage != null) + localVarQueryParams.addAll(apiClient.parameterToPair("storage", storage)); + if (folder != null) + localVarQueryParams.addAll(apiClient.parameterToPair("folder", folder)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @Deprecated + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call postDocumentReplaceTextValidateBeforeCall(String name, TextReplaceRequest textReplace, String storage, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException("Missing the required parameter 'name' when calling postDocumentReplaceText(Async)"); + } + + // verify the required parameter 'textReplace' is set + if (textReplace == null) { + throw new ApiException("Missing the required parameter 'textReplace' when calling postDocumentReplaceText(Async)"); + } + + + com.squareup.okhttp.Call call = postDocumentReplaceTextCall(name, textReplace, storage, folder, progressListener, progressRequestListener); + return call; + + } + + /** + * Document's replace text method. Deprecated + * + * @param name (required) + * @param textReplace (required) + * @param storage (optional) + * @param folder (optional) + * @return DocumentTextReplaceResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @deprecated + */ + @Deprecated + public DocumentTextReplaceResponse postDocumentReplaceText(String name, TextReplaceRequest textReplace, String storage, String folder) throws ApiException { + ApiResponse resp = postDocumentReplaceTextWithHttpInfo(name, textReplace, storage, folder); + return resp.getData(); + } + + /** + * Document's replace text method. Deprecated + * + * @param name (required) + * @param textReplace (required) + * @param storage (optional) + * @param folder (optional) + * @return ApiResponse<DocumentTextReplaceResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @deprecated + */ + @Deprecated + public ApiResponse postDocumentReplaceTextWithHttpInfo(String name, TextReplaceRequest textReplace, String storage, String folder) throws ApiException { + com.squareup.okhttp.Call call = postDocumentReplaceTextValidateBeforeCall(name, textReplace, storage, folder, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Document's replace text method. Deprecated (asynchronously) + * + * @param name (required) + * @param textReplace (required) + * @param storage (optional) + * @param folder (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @deprecated + */ + @Deprecated + public com.squareup.okhttp.Call postDocumentReplaceTextAsync(String name, TextReplaceRequest textReplace, String storage, String folder, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = postDocumentReplaceTextValidateBeforeCall(name, textReplace, storage, folder, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for postDocumentReplaceTextList + * @param name (required) + * @param textReplaceListRequest (required) + * @param storage (optional) + * @param folder (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @deprecated + */ + @Deprecated + public com.squareup.okhttp.Call postDocumentReplaceTextListCall(String name, TextReplaceListRequest textReplaceListRequest, String storage, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = textReplaceListRequest; + + // create path and map variables + String localVarPath = "/pdf/{name}/replaceTextList" + .replaceAll("\\{" + "name" + "\\}", apiClient.escapeString(name.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (storage != null) + localVarQueryParams.addAll(apiClient.parameterToPair("storage", storage)); + if (folder != null) + localVarQueryParams.addAll(apiClient.parameterToPair("folder", folder)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @Deprecated + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call postDocumentReplaceTextListValidateBeforeCall(String name, TextReplaceListRequest textReplaceListRequest, String storage, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException("Missing the required parameter 'name' when calling postDocumentReplaceTextList(Async)"); + } + + // verify the required parameter 'textReplaceListRequest' is set + if (textReplaceListRequest == null) { + throw new ApiException("Missing the required parameter 'textReplaceListRequest' when calling postDocumentReplaceTextList(Async)"); + } + + + com.squareup.okhttp.Call call = postDocumentReplaceTextListCall(name, textReplaceListRequest, storage, folder, progressListener, progressRequestListener); + return call; + + } + + /** + * Document's replace text method. Deprecated + * + * @param name (required) + * @param textReplaceListRequest (required) + * @param storage (optional) + * @param folder (optional) + * @return DocumentTextReplaceResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @deprecated + */ + @Deprecated + public DocumentTextReplaceResponse postDocumentReplaceTextList(String name, TextReplaceListRequest textReplaceListRequest, String storage, String folder) throws ApiException { + ApiResponse resp = postDocumentReplaceTextListWithHttpInfo(name, textReplaceListRequest, storage, folder); + return resp.getData(); + } + + /** + * Document's replace text method. Deprecated + * + * @param name (required) + * @param textReplaceListRequest (required) + * @param storage (optional) + * @param folder (optional) + * @return ApiResponse<DocumentTextReplaceResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @deprecated + */ + @Deprecated + public ApiResponse postDocumentReplaceTextListWithHttpInfo(String name, TextReplaceListRequest textReplaceListRequest, String storage, String folder) throws ApiException { + com.squareup.okhttp.Call call = postDocumentReplaceTextListValidateBeforeCall(name, textReplaceListRequest, storage, folder, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Document's replace text method. Deprecated (asynchronously) + * + * @param name (required) + * @param textReplaceListRequest (required) + * @param storage (optional) + * @param folder (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @deprecated + */ + @Deprecated + public com.squareup.okhttp.Call postDocumentReplaceTextListAsync(String name, TextReplaceListRequest textReplaceListRequest, String storage, String folder, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = postDocumentReplaceTextListValidateBeforeCall(name, textReplaceListRequest, storage, folder, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for postDocumentTextReplace + * @param name (required) + * @param textReplace (required) + * @param storage (optional) + * @param folder (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call postDocumentTextReplaceCall(String name, TextReplaceListRequest textReplace, String storage, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = textReplace; + + // create path and map variables + String localVarPath = "/pdf/{name}/text/replace" + .replaceAll("\\{" + "name" + "\\}", apiClient.escapeString(name.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (storage != null) + localVarQueryParams.addAll(apiClient.parameterToPair("storage", storage)); + if (folder != null) + localVarQueryParams.addAll(apiClient.parameterToPair("folder", folder)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call postDocumentTextReplaceValidateBeforeCall(String name, TextReplaceListRequest textReplace, String storage, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException("Missing the required parameter 'name' when calling postDocumentTextReplace(Async)"); + } + + // verify the required parameter 'textReplace' is set + if (textReplace == null) { + throw new ApiException("Missing the required parameter 'textReplace' when calling postDocumentTextReplace(Async)"); + } + + + com.squareup.okhttp.Call call = postDocumentTextReplaceCall(name, textReplace, storage, folder, progressListener, progressRequestListener); + return call; + + } + + /** + * Document's replace text method. + * + * @param name (required) + * @param textReplace (required) + * @param storage (optional) + * @param folder (optional) + * @return TextReplaceResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public TextReplaceResponse postDocumentTextReplace(String name, TextReplaceListRequest textReplace, String storage, String folder) throws ApiException { + ApiResponse resp = postDocumentTextReplaceWithHttpInfo(name, textReplace, storage, folder); + return resp.getData(); + } + + /** + * Document's replace text method. + * + * @param name (required) + * @param textReplace (required) + * @param storage (optional) + * @param folder (optional) + * @return ApiResponse<TextReplaceResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse postDocumentTextReplaceWithHttpInfo(String name, TextReplaceListRequest textReplace, String storage, String folder) throws ApiException { + com.squareup.okhttp.Call call = postDocumentTextReplaceValidateBeforeCall(name, textReplace, storage, folder, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Document's replace text method. (asynchronously) + * + * @param name (required) + * @param textReplace (required) + * @param storage (optional) + * @param folder (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call postDocumentTextReplaceAsync(String name, TextReplaceListRequest textReplace, String storage, String folder, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = postDocumentTextReplaceValidateBeforeCall(name, textReplace, storage, folder, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for postMovePage + * @param name The document name. (required) + * @param pageNumber The page number. (required) + * @param newIndex The new page position/index. (required) + * @param storage The document storage. (optional) + * @param folder The document folder. (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call postMovePageCall(String name, Integer pageNumber, Integer newIndex, String storage, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/pdf/{name}/pages/{pageNumber}/movePage" + .replaceAll("\\{" + "name" + "\\}", apiClient.escapeString(name.toString())) + .replaceAll("\\{" + "pageNumber" + "\\}", apiClient.escapeString(pageNumber.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (newIndex != null) + localVarQueryParams.addAll(apiClient.parameterToPair("newIndex", newIndex)); + if (storage != null) + localVarQueryParams.addAll(apiClient.parameterToPair("storage", storage)); + if (folder != null) + localVarQueryParams.addAll(apiClient.parameterToPair("folder", folder)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call postMovePageValidateBeforeCall(String name, Integer pageNumber, Integer newIndex, String storage, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException("Missing the required parameter 'name' when calling postMovePage(Async)"); + } + + // verify the required parameter 'pageNumber' is set + if (pageNumber == null) { + throw new ApiException("Missing the required parameter 'pageNumber' when calling postMovePage(Async)"); + } + + // verify the required parameter 'newIndex' is set + if (newIndex == null) { + throw new ApiException("Missing the required parameter 'newIndex' when calling postMovePage(Async)"); + } + + + com.squareup.okhttp.Call call = postMovePageCall(name, pageNumber, newIndex, storage, folder, progressListener, progressRequestListener); + return call; + + } + + /** + * Move page to new position. + * + * @param name The document name. (required) + * @param pageNumber The page number. (required) + * @param newIndex The new page position/index. (required) + * @param storage The document storage. (optional) + * @param folder The document folder. (optional) + * @return SaaSposeResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public SaaSposeResponse postMovePage(String name, Integer pageNumber, Integer newIndex, String storage, String folder) throws ApiException { + ApiResponse resp = postMovePageWithHttpInfo(name, pageNumber, newIndex, storage, folder); + return resp.getData(); + } + + /** + * Move page to new position. + * + * @param name The document name. (required) + * @param pageNumber The page number. (required) + * @param newIndex The new page position/index. (required) + * @param storage The document storage. (optional) + * @param folder The document folder. (optional) + * @return ApiResponse<SaaSposeResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse postMovePageWithHttpInfo(String name, Integer pageNumber, Integer newIndex, String storage, String folder) throws ApiException { + com.squareup.okhttp.Call call = postMovePageValidateBeforeCall(name, pageNumber, newIndex, storage, folder, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Move page to new position. (asynchronously) + * + * @param name The document name. (required) + * @param pageNumber The page number. (required) + * @param newIndex The new page position/index. (required) + * @param storage The document storage. (optional) + * @param folder The document folder. (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call postMovePageAsync(String name, Integer pageNumber, Integer newIndex, String storage, String folder, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = postMovePageValidateBeforeCall(name, pageNumber, newIndex, storage, folder, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for postOptimizeDocument + * @param name The document name. (required) + * @param options The optimization options. (optional) + * @param storage The document storage. (optional) + * @param folder The document folder. (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call postOptimizeDocumentCall(String name, OptimizeOptions options, String storage, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = options; + + // create path and map variables + String localVarPath = "/pdf/{name}/optimize" + .replaceAll("\\{" + "name" + "\\}", apiClient.escapeString(name.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (storage != null) + localVarQueryParams.addAll(apiClient.parameterToPair("storage", storage)); + if (folder != null) + localVarQueryParams.addAll(apiClient.parameterToPair("folder", folder)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call postOptimizeDocumentValidateBeforeCall(String name, OptimizeOptions options, String storage, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException("Missing the required parameter 'name' when calling postOptimizeDocument(Async)"); + } + + + com.squareup.okhttp.Call call = postOptimizeDocumentCall(name, options, storage, folder, progressListener, progressRequestListener); + return call; + + } + + /** + * Optimize document. + * + * @param name The document name. (required) + * @param options The optimization options. (optional) + * @param storage The document storage. (optional) + * @param folder The document folder. (optional) + * @return SaaSposeResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public SaaSposeResponse postOptimizeDocument(String name, OptimizeOptions options, String storage, String folder) throws ApiException { + ApiResponse resp = postOptimizeDocumentWithHttpInfo(name, options, storage, folder); + return resp.getData(); + } + + /** + * Optimize document. + * + * @param name The document name. (required) + * @param options The optimization options. (optional) + * @param storage The document storage. (optional) + * @param folder The document folder. (optional) + * @return ApiResponse<SaaSposeResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse postOptimizeDocumentWithHttpInfo(String name, OptimizeOptions options, String storage, String folder) throws ApiException { + com.squareup.okhttp.Call call = postOptimizeDocumentValidateBeforeCall(name, options, storage, folder, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Optimize document. (asynchronously) + * + * @param name The document name. (required) + * @param options The optimization options. (optional) + * @param storage The document storage. (optional) + * @param folder The document folder. (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call postOptimizeDocumentAsync(String name, OptimizeOptions options, String storage, String folder, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = postOptimizeDocumentValidateBeforeCall(name, options, storage, folder, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for postPageReplaceText + * @param name (required) + * @param pageNumber (required) + * @param textReplace (required) + * @param storage (optional) + * @param folder (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @deprecated + */ + @Deprecated + public com.squareup.okhttp.Call postPageReplaceTextCall(String name, Integer pageNumber, TextReplaceRequest textReplace, String storage, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = textReplace; + + // create path and map variables + String localVarPath = "/pdf/{name}/pages/{pageNumber}/replaceText" + .replaceAll("\\{" + "name" + "\\}", apiClient.escapeString(name.toString())) + .replaceAll("\\{" + "pageNumber" + "\\}", apiClient.escapeString(pageNumber.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (storage != null) + localVarQueryParams.addAll(apiClient.parameterToPair("storage", storage)); + if (folder != null) + localVarQueryParams.addAll(apiClient.parameterToPair("folder", folder)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @Deprecated + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call postPageReplaceTextValidateBeforeCall(String name, Integer pageNumber, TextReplaceRequest textReplace, String storage, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException("Missing the required parameter 'name' when calling postPageReplaceText(Async)"); + } + + // verify the required parameter 'pageNumber' is set + if (pageNumber == null) { + throw new ApiException("Missing the required parameter 'pageNumber' when calling postPageReplaceText(Async)"); + } + + // verify the required parameter 'textReplace' is set + if (textReplace == null) { + throw new ApiException("Missing the required parameter 'textReplace' when calling postPageReplaceText(Async)"); + } + + + com.squareup.okhttp.Call call = postPageReplaceTextCall(name, pageNumber, textReplace, storage, folder, progressListener, progressRequestListener); + return call; + + } + + /** + * Page's replace text method. Deprecated + * + * @param name (required) + * @param pageNumber (required) + * @param textReplace (required) + * @param storage (optional) + * @param folder (optional) + * @return PageTextReplaceResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @deprecated + */ + @Deprecated + public PageTextReplaceResponse postPageReplaceText(String name, Integer pageNumber, TextReplaceRequest textReplace, String storage, String folder) throws ApiException { + ApiResponse resp = postPageReplaceTextWithHttpInfo(name, pageNumber, textReplace, storage, folder); + return resp.getData(); + } + + /** + * Page's replace text method. Deprecated + * + * @param name (required) + * @param pageNumber (required) + * @param textReplace (required) + * @param storage (optional) + * @param folder (optional) + * @return ApiResponse<PageTextReplaceResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @deprecated + */ + @Deprecated + public ApiResponse postPageReplaceTextWithHttpInfo(String name, Integer pageNumber, TextReplaceRequest textReplace, String storage, String folder) throws ApiException { + com.squareup.okhttp.Call call = postPageReplaceTextValidateBeforeCall(name, pageNumber, textReplace, storage, folder, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Page's replace text method. Deprecated (asynchronously) + * + * @param name (required) + * @param pageNumber (required) + * @param textReplace (required) + * @param storage (optional) + * @param folder (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @deprecated + */ + @Deprecated + public com.squareup.okhttp.Call postPageReplaceTextAsync(String name, Integer pageNumber, TextReplaceRequest textReplace, String storage, String folder, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = postPageReplaceTextValidateBeforeCall(name, pageNumber, textReplace, storage, folder, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for postPageReplaceTextList + * @param name (required) + * @param pageNumber (required) + * @param textReplaceListRequest (required) + * @param storage (optional) + * @param folder (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @deprecated + */ + @Deprecated + public com.squareup.okhttp.Call postPageReplaceTextListCall(String name, Integer pageNumber, TextReplaceListRequest textReplaceListRequest, String storage, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = textReplaceListRequest; + + // create path and map variables + String localVarPath = "/pdf/{name}/pages/{pageNumber}/replaceTextList" + .replaceAll("\\{" + "name" + "\\}", apiClient.escapeString(name.toString())) + .replaceAll("\\{" + "pageNumber" + "\\}", apiClient.escapeString(pageNumber.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (storage != null) + localVarQueryParams.addAll(apiClient.parameterToPair("storage", storage)); + if (folder != null) + localVarQueryParams.addAll(apiClient.parameterToPair("folder", folder)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @Deprecated + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call postPageReplaceTextListValidateBeforeCall(String name, Integer pageNumber, TextReplaceListRequest textReplaceListRequest, String storage, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException("Missing the required parameter 'name' when calling postPageReplaceTextList(Async)"); + } + + // verify the required parameter 'pageNumber' is set + if (pageNumber == null) { + throw new ApiException("Missing the required parameter 'pageNumber' when calling postPageReplaceTextList(Async)"); + } + + // verify the required parameter 'textReplaceListRequest' is set + if (textReplaceListRequest == null) { + throw new ApiException("Missing the required parameter 'textReplaceListRequest' when calling postPageReplaceTextList(Async)"); + } + + + com.squareup.okhttp.Call call = postPageReplaceTextListCall(name, pageNumber, textReplaceListRequest, storage, folder, progressListener, progressRequestListener); + return call; + + } + + /** + * Page's replace text method. Deprecated + * + * @param name (required) + * @param pageNumber (required) + * @param textReplaceListRequest (required) + * @param storage (optional) + * @param folder (optional) + * @return PageTextReplaceResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @deprecated + */ + @Deprecated + public PageTextReplaceResponse postPageReplaceTextList(String name, Integer pageNumber, TextReplaceListRequest textReplaceListRequest, String storage, String folder) throws ApiException { + ApiResponse resp = postPageReplaceTextListWithHttpInfo(name, pageNumber, textReplaceListRequest, storage, folder); + return resp.getData(); + } + + /** + * Page's replace text method. Deprecated + * + * @param name (required) + * @param pageNumber (required) + * @param textReplaceListRequest (required) + * @param storage (optional) + * @param folder (optional) + * @return ApiResponse<PageTextReplaceResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @deprecated + */ + @Deprecated + public ApiResponse postPageReplaceTextListWithHttpInfo(String name, Integer pageNumber, TextReplaceListRequest textReplaceListRequest, String storage, String folder) throws ApiException { + com.squareup.okhttp.Call call = postPageReplaceTextListValidateBeforeCall(name, pageNumber, textReplaceListRequest, storage, folder, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Page's replace text method. Deprecated (asynchronously) + * + * @param name (required) + * @param pageNumber (required) + * @param textReplaceListRequest (required) + * @param storage (optional) + * @param folder (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @deprecated + */ + @Deprecated + public com.squareup.okhttp.Call postPageReplaceTextListAsync(String name, Integer pageNumber, TextReplaceListRequest textReplaceListRequest, String storage, String folder, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = postPageReplaceTextListValidateBeforeCall(name, pageNumber, textReplaceListRequest, storage, folder, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for postPageTextReplace + * @param name (required) + * @param pageNumber (required) + * @param textReplaceListRequest (required) + * @param storage (optional) + * @param folder (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call postPageTextReplaceCall(String name, Integer pageNumber, TextReplaceListRequest textReplaceListRequest, String storage, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = textReplaceListRequest; + + // create path and map variables + String localVarPath = "/pdf/{name}/pages/{pageNumber}/text/replace" + .replaceAll("\\{" + "name" + "\\}", apiClient.escapeString(name.toString())) + .replaceAll("\\{" + "pageNumber" + "\\}", apiClient.escapeString(pageNumber.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (storage != null) + localVarQueryParams.addAll(apiClient.parameterToPair("storage", storage)); + if (folder != null) + localVarQueryParams.addAll(apiClient.parameterToPair("folder", folder)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call postPageTextReplaceValidateBeforeCall(String name, Integer pageNumber, TextReplaceListRequest textReplaceListRequest, String storage, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException("Missing the required parameter 'name' when calling postPageTextReplace(Async)"); + } + + // verify the required parameter 'pageNumber' is set + if (pageNumber == null) { + throw new ApiException("Missing the required parameter 'pageNumber' when calling postPageTextReplace(Async)"); + } + + // verify the required parameter 'textReplaceListRequest' is set + if (textReplaceListRequest == null) { + throw new ApiException("Missing the required parameter 'textReplaceListRequest' when calling postPageTextReplace(Async)"); + } + + + com.squareup.okhttp.Call call = postPageTextReplaceCall(name, pageNumber, textReplaceListRequest, storage, folder, progressListener, progressRequestListener); + return call; + + } + + /** + * Page's replace text method. + * + * @param name (required) + * @param pageNumber (required) + * @param textReplaceListRequest (required) + * @param storage (optional) + * @param folder (optional) + * @return TextReplaceResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public TextReplaceResponse postPageTextReplace(String name, Integer pageNumber, TextReplaceListRequest textReplaceListRequest, String storage, String folder) throws ApiException { + ApiResponse resp = postPageTextReplaceWithHttpInfo(name, pageNumber, textReplaceListRequest, storage, folder); + return resp.getData(); + } + + /** + * Page's replace text method. + * + * @param name (required) + * @param pageNumber (required) + * @param textReplaceListRequest (required) + * @param storage (optional) + * @param folder (optional) + * @return ApiResponse<TextReplaceResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse postPageTextReplaceWithHttpInfo(String name, Integer pageNumber, TextReplaceListRequest textReplaceListRequest, String storage, String folder) throws ApiException { + com.squareup.okhttp.Call call = postPageTextReplaceValidateBeforeCall(name, pageNumber, textReplaceListRequest, storage, folder, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Page's replace text method. (asynchronously) + * + * @param name (required) + * @param pageNumber (required) + * @param textReplaceListRequest (required) + * @param storage (optional) + * @param folder (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call postPageTextReplaceAsync(String name, Integer pageNumber, TextReplaceListRequest textReplaceListRequest, String storage, String folder, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = postPageTextReplaceValidateBeforeCall(name, pageNumber, textReplaceListRequest, storage, folder, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for postReplaceImage + * @param name The document name. (required) + * @param pageNumber The page number. (required) + * @param imageNumber The image number. (required) + * @param imageFile Path to image file if specified. Request content is used otherwise. (optional) + * @param storage The document storage. (optional) + * @param folder The document folder. (optional) + * @param image Image file. (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call postReplaceImageCall(String name, Integer pageNumber, Integer imageNumber, String imageFile, String storage, String folder, File image, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = image; + + // create path and map variables + String localVarPath = "/pdf/{name}/pages/{pageNumber}/images/{imageNumber}" + .replaceAll("\\{" + "name" + "\\}", apiClient.escapeString(name.toString())) + .replaceAll("\\{" + "pageNumber" + "\\}", apiClient.escapeString(pageNumber.toString())) + .replaceAll("\\{" + "imageNumber" + "\\}", apiClient.escapeString(imageNumber.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (imageFile != null) + localVarQueryParams.addAll(apiClient.parameterToPair("imageFile", imageFile)); + if (storage != null) + localVarQueryParams.addAll(apiClient.parameterToPair("storage", storage)); + if (folder != null) + localVarQueryParams.addAll(apiClient.parameterToPair("folder", folder)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call postReplaceImageValidateBeforeCall(String name, Integer pageNumber, Integer imageNumber, String imageFile, String storage, String folder, File image, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException("Missing the required parameter 'name' when calling postReplaceImage(Async)"); + } + + // verify the required parameter 'pageNumber' is set + if (pageNumber == null) { + throw new ApiException("Missing the required parameter 'pageNumber' when calling postReplaceImage(Async)"); + } + + // verify the required parameter 'imageNumber' is set + if (imageNumber == null) { + throw new ApiException("Missing the required parameter 'imageNumber' when calling postReplaceImage(Async)"); + } + + + com.squareup.okhttp.Call call = postReplaceImageCall(name, pageNumber, imageNumber, imageFile, storage, folder, image, progressListener, progressRequestListener); + return call; + + } + + /** + * Replace document image. + * + * @param name The document name. (required) + * @param pageNumber The page number. (required) + * @param imageNumber The image number. (required) + * @param imageFile Path to image file if specified. Request content is used otherwise. (optional) + * @param storage The document storage. (optional) + * @param folder The document folder. (optional) + * @param image Image file. (optional) + * @return ImageResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ImageResponse postReplaceImage(String name, Integer pageNumber, Integer imageNumber, String imageFile, String storage, String folder, File image) throws ApiException { + ApiResponse resp = postReplaceImageWithHttpInfo(name, pageNumber, imageNumber, imageFile, storage, folder, image); + return resp.getData(); + } + + /** + * Replace document image. + * + * @param name The document name. (required) + * @param pageNumber The page number. (required) + * @param imageNumber The image number. (required) + * @param imageFile Path to image file if specified. Request content is used otherwise. (optional) + * @param storage The document storage. (optional) + * @param folder The document folder. (optional) + * @param image Image file. (optional) + * @return ApiResponse<ImageResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse postReplaceImageWithHttpInfo(String name, Integer pageNumber, Integer imageNumber, String imageFile, String storage, String folder, File image) throws ApiException { + com.squareup.okhttp.Call call = postReplaceImageValidateBeforeCall(name, pageNumber, imageNumber, imageFile, storage, folder, image, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Replace document image. (asynchronously) + * + * @param name The document name. (required) + * @param pageNumber The page number. (required) + * @param imageNumber The image number. (required) + * @param imageFile Path to image file if specified. Request content is used otherwise. (optional) + * @param storage The document storage. (optional) + * @param folder The document folder. (optional) + * @param image Image file. (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call postReplaceImageAsync(String name, Integer pageNumber, Integer imageNumber, String imageFile, String storage, String folder, File image, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = postReplaceImageValidateBeforeCall(name, pageNumber, imageNumber, imageFile, storage, folder, image, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for postSignDocument + * @param name The document name. (required) + * @param signature Signature object containing signature data. (optional) + * @param storage The document storage. (optional) + * @param folder The document folder. (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call postSignDocumentCall(String name, Signature signature, String storage, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = signature; + + // create path and map variables + String localVarPath = "/pdf/{name}/sign" + .replaceAll("\\{" + "name" + "\\}", apiClient.escapeString(name.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (storage != null) + localVarQueryParams.addAll(apiClient.parameterToPair("storage", storage)); + if (folder != null) + localVarQueryParams.addAll(apiClient.parameterToPair("folder", folder)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call postSignDocumentValidateBeforeCall(String name, Signature signature, String storage, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException("Missing the required parameter 'name' when calling postSignDocument(Async)"); + } + + + com.squareup.okhttp.Call call = postSignDocumentCall(name, signature, storage, folder, progressListener, progressRequestListener); + return call; + + } + + /** + * Sign document. + * + * @param name The document name. (required) + * @param signature Signature object containing signature data. (optional) + * @param storage The document storage. (optional) + * @param folder The document folder. (optional) + * @return SaaSposeResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public SaaSposeResponse postSignDocument(String name, Signature signature, String storage, String folder) throws ApiException { + ApiResponse resp = postSignDocumentWithHttpInfo(name, signature, storage, folder); + return resp.getData(); + } + + /** + * Sign document. + * + * @param name The document name. (required) + * @param signature Signature object containing signature data. (optional) + * @param storage The document storage. (optional) + * @param folder The document folder. (optional) + * @return ApiResponse<SaaSposeResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse postSignDocumentWithHttpInfo(String name, Signature signature, String storage, String folder) throws ApiException { + com.squareup.okhttp.Call call = postSignDocumentValidateBeforeCall(name, signature, storage, folder, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Sign document. (asynchronously) + * + * @param name The document name. (required) + * @param signature Signature object containing signature data. (optional) + * @param storage The document storage. (optional) + * @param folder The document folder. (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call postSignDocumentAsync(String name, Signature signature, String storage, String folder, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = postSignDocumentValidateBeforeCall(name, signature, storage, folder, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for postSignPage + * @param name The document name. (required) + * @param pageNumber The page number. (required) + * @param signature Signature object containing signature data. (optional) + * @param storage The document storage. (optional) + * @param folder The document folder. (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call postSignPageCall(String name, Integer pageNumber, Signature signature, String storage, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = signature; + + // create path and map variables + String localVarPath = "/pdf/{name}/pages/{pageNumber}/sign" + .replaceAll("\\{" + "name" + "\\}", apiClient.escapeString(name.toString())) + .replaceAll("\\{" + "pageNumber" + "\\}", apiClient.escapeString(pageNumber.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (storage != null) + localVarQueryParams.addAll(apiClient.parameterToPair("storage", storage)); + if (folder != null) + localVarQueryParams.addAll(apiClient.parameterToPair("folder", folder)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call postSignPageValidateBeforeCall(String name, Integer pageNumber, Signature signature, String storage, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException("Missing the required parameter 'name' when calling postSignPage(Async)"); + } + + // verify the required parameter 'pageNumber' is set + if (pageNumber == null) { + throw new ApiException("Missing the required parameter 'pageNumber' when calling postSignPage(Async)"); + } + + + com.squareup.okhttp.Call call = postSignPageCall(name, pageNumber, signature, storage, folder, progressListener, progressRequestListener); + return call; + + } + + /** + * Sign page. + * + * @param name The document name. (required) + * @param pageNumber The page number. (required) + * @param signature Signature object containing signature data. (optional) + * @param storage The document storage. (optional) + * @param folder The document folder. (optional) + * @return SaaSposeResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public SaaSposeResponse postSignPage(String name, Integer pageNumber, Signature signature, String storage, String folder) throws ApiException { + ApiResponse resp = postSignPageWithHttpInfo(name, pageNumber, signature, storage, folder); + return resp.getData(); + } + + /** + * Sign page. + * + * @param name The document name. (required) + * @param pageNumber The page number. (required) + * @param signature Signature object containing signature data. (optional) + * @param storage The document storage. (optional) + * @param folder The document folder. (optional) + * @return ApiResponse<SaaSposeResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse postSignPageWithHttpInfo(String name, Integer pageNumber, Signature signature, String storage, String folder) throws ApiException { + com.squareup.okhttp.Call call = postSignPageValidateBeforeCall(name, pageNumber, signature, storage, folder, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Sign page. (asynchronously) + * + * @param name The document name. (required) + * @param pageNumber The page number. (required) + * @param signature Signature object containing signature data. (optional) + * @param storage The document storage. (optional) + * @param folder The document folder. (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call postSignPageAsync(String name, Integer pageNumber, Signature signature, String storage, String folder, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = postSignPageValidateBeforeCall(name, pageNumber, signature, storage, folder, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for postSplitDocument + * @param name Document name. (required) + * @param format Resulting documents format. (optional) + * @param from Start page if defined. (optional) + * @param to End page if defined. (optional) + * @param storage The document storage. (optional) + * @param folder The document folder. (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call postSplitDocumentCall(String name, String format, Integer from, Integer to, String storage, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/pdf/{name}/split" + .replaceAll("\\{" + "name" + "\\}", apiClient.escapeString(name.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (format != null) + localVarQueryParams.addAll(apiClient.parameterToPair("format", format)); + if (from != null) + localVarQueryParams.addAll(apiClient.parameterToPair("from", from)); + if (to != null) + localVarQueryParams.addAll(apiClient.parameterToPair("to", to)); + if (storage != null) + localVarQueryParams.addAll(apiClient.parameterToPair("storage", storage)); + if (folder != null) + localVarQueryParams.addAll(apiClient.parameterToPair("folder", folder)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call postSplitDocumentValidateBeforeCall(String name, String format, Integer from, Integer to, String storage, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException("Missing the required parameter 'name' when calling postSplitDocument(Async)"); + } + + + com.squareup.okhttp.Call call = postSplitDocumentCall(name, format, from, to, storage, folder, progressListener, progressRequestListener); + return call; + + } + + /** + * Split document to parts. + * + * @param name Document name. (required) + * @param format Resulting documents format. (optional) + * @param from Start page if defined. (optional) + * @param to End page if defined. (optional) + * @param storage The document storage. (optional) + * @param folder The document folder. (optional) + * @return SplitResultResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public SplitResultResponse postSplitDocument(String name, String format, Integer from, Integer to, String storage, String folder) throws ApiException { + ApiResponse resp = postSplitDocumentWithHttpInfo(name, format, from, to, storage, folder); + return resp.getData(); + } + + /** + * Split document to parts. + * + * @param name Document name. (required) + * @param format Resulting documents format. (optional) + * @param from Start page if defined. (optional) + * @param to End page if defined. (optional) + * @param storage The document storage. (optional) + * @param folder The document folder. (optional) + * @return ApiResponse<SplitResultResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse postSplitDocumentWithHttpInfo(String name, String format, Integer from, Integer to, String storage, String folder) throws ApiException { + com.squareup.okhttp.Call call = postSplitDocumentValidateBeforeCall(name, format, from, to, storage, folder, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Split document to parts. (asynchronously) + * + * @param name Document name. (required) + * @param format Resulting documents format. (optional) + * @param from Start page if defined. (optional) + * @param to End page if defined. (optional) + * @param storage The document storage. (optional) + * @param folder The document folder. (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call postSplitDocumentAsync(String name, String format, Integer from, Integer to, String storage, String folder, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = postSplitDocumentValidateBeforeCall(name, format, from, to, storage, folder, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for putAddNewPage + * @param name The document name. (required) + * @param storage The document storage. (optional) + * @param folder The document folder. (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call putAddNewPageCall(String name, String storage, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/pdf/{name}/pages" + .replaceAll("\\{" + "name" + "\\}", apiClient.escapeString(name.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (storage != null) + localVarQueryParams.addAll(apiClient.parameterToPair("storage", storage)); + if (folder != null) + localVarQueryParams.addAll(apiClient.parameterToPair("folder", folder)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call putAddNewPageValidateBeforeCall(String name, String storage, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException("Missing the required parameter 'name' when calling putAddNewPage(Async)"); + } + + + com.squareup.okhttp.Call call = putAddNewPageCall(name, storage, folder, progressListener, progressRequestListener); + return call; + + } + + /** + * Add new page to end of the document. + * + * @param name The document name. (required) + * @param storage The document storage. (optional) + * @param folder The document folder. (optional) + * @return DocumentPagesResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public DocumentPagesResponse putAddNewPage(String name, String storage, String folder) throws ApiException { + ApiResponse resp = putAddNewPageWithHttpInfo(name, storage, folder); + return resp.getData(); + } + + /** + * Add new page to end of the document. + * + * @param name The document name. (required) + * @param storage The document storage. (optional) + * @param folder The document folder. (optional) + * @return ApiResponse<DocumentPagesResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse putAddNewPageWithHttpInfo(String name, String storage, String folder) throws ApiException { + com.squareup.okhttp.Call call = putAddNewPageValidateBeforeCall(name, storage, folder, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Add new page to end of the document. (asynchronously) + * + * @param name The document name. (required) + * @param storage The document storage. (optional) + * @param folder The document folder. (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call putAddNewPageAsync(String name, String storage, String folder, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = putAddNewPageValidateBeforeCall(name, storage, folder, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for putAddParagraph + * @param name Name of the document to which text should be added. (required) + * @param pageNumber Number of page (starting with 1) to which text should be added. (required) + * @param paragraph Paragraph data. (optional) + * @param storage File storage to be used. (optional) + * @param folder Document folder. (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @deprecated + */ + @Deprecated + public com.squareup.okhttp.Call putAddParagraphCall(String name, Integer pageNumber, Paragraph paragraph, String storage, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = paragraph; + + // create path and map variables + String localVarPath = "/pdf/{name}/pages/{pageNumber}/paragraph" + .replaceAll("\\{" + "name" + "\\}", apiClient.escapeString(name.toString())) + .replaceAll("\\{" + "pageNumber" + "\\}", apiClient.escapeString(pageNumber.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (storage != null) + localVarQueryParams.addAll(apiClient.parameterToPair("storage", storage)); + if (folder != null) + localVarQueryParams.addAll(apiClient.parameterToPair("folder", folder)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @Deprecated + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call putAddParagraphValidateBeforeCall(String name, Integer pageNumber, Paragraph paragraph, String storage, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException("Missing the required parameter 'name' when calling putAddParagraph(Async)"); + } + + // verify the required parameter 'pageNumber' is set + if (pageNumber == null) { + throw new ApiException("Missing the required parameter 'pageNumber' when calling putAddParagraph(Async)"); + } + + + com.squareup.okhttp.Call call = putAddParagraphCall(name, pageNumber, paragraph, storage, folder, progressListener, progressRequestListener); + return call; + + } + + /** + * Add text to PDF document page. Deprecated + * + * @param name Name of the document to which text should be added. (required) + * @param pageNumber Number of page (starting with 1) to which text should be added. (required) + * @param paragraph Paragraph data. (optional) + * @param storage File storage to be used. (optional) + * @param folder Document folder. (optional) + * @return SaaSposeResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @deprecated + */ + @Deprecated + public SaaSposeResponse putAddParagraph(String name, Integer pageNumber, Paragraph paragraph, String storage, String folder) throws ApiException { + ApiResponse resp = putAddParagraphWithHttpInfo(name, pageNumber, paragraph, storage, folder); + return resp.getData(); + } + + /** + * Add text to PDF document page. Deprecated + * + * @param name Name of the document to which text should be added. (required) + * @param pageNumber Number of page (starting with 1) to which text should be added. (required) + * @param paragraph Paragraph data. (optional) + * @param storage File storage to be used. (optional) + * @param folder Document folder. (optional) + * @return ApiResponse<SaaSposeResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @deprecated + */ + @Deprecated + public ApiResponse putAddParagraphWithHttpInfo(String name, Integer pageNumber, Paragraph paragraph, String storage, String folder) throws ApiException { + com.squareup.okhttp.Call call = putAddParagraphValidateBeforeCall(name, pageNumber, paragraph, storage, folder, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Add text to PDF document page. Deprecated (asynchronously) + * + * @param name Name of the document to which text should be added. (required) + * @param pageNumber Number of page (starting with 1) to which text should be added. (required) + * @param paragraph Paragraph data. (optional) + * @param storage File storage to be used. (optional) + * @param folder Document folder. (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @deprecated + */ + @Deprecated + public com.squareup.okhttp.Call putAddParagraphAsync(String name, Integer pageNumber, Paragraph paragraph, String storage, String folder, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = putAddParagraphValidateBeforeCall(name, pageNumber, paragraph, storage, folder, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for putAddText + * @param name The document name. (required) + * @param pageNumber Number of page (starting from 1). (required) + * @param paragraph Paragraph data. (optional) + * @param folder Document folder. (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call putAddTextCall(String name, Integer pageNumber, Paragraph paragraph, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = paragraph; + + // create path and map variables + String localVarPath = "/pdf/{name}/pages/{pageNumber}/text" + .replaceAll("\\{" + "name" + "\\}", apiClient.escapeString(name.toString())) + .replaceAll("\\{" + "pageNumber" + "\\}", apiClient.escapeString(pageNumber.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (folder != null) + localVarQueryParams.addAll(apiClient.parameterToPair("folder", folder)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call putAddTextValidateBeforeCall(String name, Integer pageNumber, Paragraph paragraph, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException("Missing the required parameter 'name' when calling putAddText(Async)"); + } + + // verify the required parameter 'pageNumber' is set + if (pageNumber == null) { + throw new ApiException("Missing the required parameter 'pageNumber' when calling putAddText(Async)"); + } + + + com.squareup.okhttp.Call call = putAddTextCall(name, pageNumber, paragraph, folder, progressListener, progressRequestListener); + return call; + + } + + /** + * Add text to PDF document page. + * + * @param name The document name. (required) + * @param pageNumber Number of page (starting from 1). (required) + * @param paragraph Paragraph data. (optional) + * @param folder Document folder. (optional) + * @return SaaSposeResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public SaaSposeResponse putAddText(String name, Integer pageNumber, Paragraph paragraph, String folder) throws ApiException { + ApiResponse resp = putAddTextWithHttpInfo(name, pageNumber, paragraph, folder); + return resp.getData(); + } + + /** + * Add text to PDF document page. + * + * @param name The document name. (required) + * @param pageNumber Number of page (starting from 1). (required) + * @param paragraph Paragraph data. (optional) + * @param folder Document folder. (optional) + * @return ApiResponse<SaaSposeResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse putAddTextWithHttpInfo(String name, Integer pageNumber, Paragraph paragraph, String folder) throws ApiException { + com.squareup.okhttp.Call call = putAddTextValidateBeforeCall(name, pageNumber, paragraph, folder, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Add text to PDF document page. (asynchronously) + * + * @param name The document name. (required) + * @param pageNumber Number of page (starting from 1). (required) + * @param paragraph Paragraph data. (optional) + * @param folder Document folder. (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call putAddTextAsync(String name, Integer pageNumber, Paragraph paragraph, String folder, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = putAddTextValidateBeforeCall(name, pageNumber, paragraph, folder, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for putConvertDocument + * @param format The format to convert. (optional) + * @param url (optional) + * @param outPath Path to save result (optional) + * @param file A file to be converted. (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @deprecated + */ + @Deprecated + public com.squareup.okhttp.Call putConvertDocumentCall(String format, String url, String outPath, File file, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = file; + + // create path and map variables + String localVarPath = "/pdf/convert"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (format != null) + localVarQueryParams.addAll(apiClient.parameterToPair("format", format)); + if (url != null) + localVarQueryParams.addAll(apiClient.parameterToPair("url", url)); + if (outPath != null) + localVarQueryParams.addAll(apiClient.parameterToPair("outPath", outPath)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "multipart/form-data" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @Deprecated + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call putConvertDocumentValidateBeforeCall(String format, String url, String outPath, File file, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + + com.squareup.okhttp.Call call = putConvertDocumentCall(format, url, outPath, file, progressListener, progressRequestListener); + return call; + + } + + /** + * Convert document from request content to format specified. + * + * @param format The format to convert. (optional) + * @param url (optional) + * @param outPath Path to save result (optional) + * @param file A file to be converted. (optional) + * @return File + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @deprecated + */ + @Deprecated + public File putConvertDocument(String format, String url, String outPath, File file) throws ApiException { + ApiResponse resp = putConvertDocumentWithHttpInfo(format, url, outPath, file); + return resp.getData(); + } + + /** + * Convert document from request content to format specified. + * + * @param format The format to convert. (optional) + * @param url (optional) + * @param outPath Path to save result (optional) + * @param file A file to be converted. (optional) + * @return ApiResponse<File> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @deprecated + */ + @Deprecated + public ApiResponse putConvertDocumentWithHttpInfo(String format, String url, String outPath, File file) throws ApiException { + com.squareup.okhttp.Call call = putConvertDocumentValidateBeforeCall(format, url, outPath, file, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Convert document from request content to format specified. (asynchronously) + * + * @param format The format to convert. (optional) + * @param url (optional) + * @param outPath Path to save result (optional) + * @param file A file to be converted. (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @deprecated + */ + @Deprecated + public com.squareup.okhttp.Call putConvertDocumentAsync(String format, String url, String outPath, File file, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = putConvertDocumentValidateBeforeCall(format, url, outPath, file, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for putCreate + * @param path Path where to upload including filename and extension e.g. /file.ext or /Folder 1/file.ext (required) + * @param file File to upload (required) + * @param versionId Source file's version (optional) + * @param storage User's storage name (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call putCreateCall(String path, File file, String versionId, String storage, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = file; + + // create path and map variables + String localVarPath = "/storage/file"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (path != null) + localVarQueryParams.addAll(apiClient.parameterToPair("path", path)); + if (versionId != null) + localVarQueryParams.addAll(apiClient.parameterToPair("versionId", versionId)); + if (storage != null) + localVarQueryParams.addAll(apiClient.parameterToPair("storage", storage)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call putCreateValidateBeforeCall(String path, File file, String versionId, String storage, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + // verify the required parameter 'path' is set + if (path == null) { + throw new ApiException("Missing the required parameter 'path' when calling putCreate(Async)"); + } + + // verify the required parameter 'file' is set + if (file == null) { + throw new ApiException("Missing the required parameter 'file' when calling putCreate(Async)"); + } + + + com.squareup.okhttp.Call call = putCreateCall(path, file, versionId, storage, progressListener, progressRequestListener); + return call; + + } + + /** + * Upload a specific file + * + * @param path Path where to upload including filename and extension e.g. /file.ext or /Folder 1/file.ext (required) + * @param file File to upload (required) + * @param versionId Source file's version (optional) + * @param storage User's storage name (optional) + * @return SaaSposeResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public SaaSposeResponse putCreate(String path, File file, String versionId, String storage) throws ApiException { + ApiResponse resp = putCreateWithHttpInfo(path, file, versionId, storage); + return resp.getData(); + } + + /** + * Upload a specific file + * + * @param path Path where to upload including filename and extension e.g. /file.ext or /Folder 1/file.ext (required) + * @param file File to upload (required) + * @param versionId Source file's version (optional) + * @param storage User's storage name (optional) + * @return ApiResponse<SaaSposeResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse putCreateWithHttpInfo(String path, File file, String versionId, String storage) throws ApiException { + com.squareup.okhttp.Call call = putCreateValidateBeforeCall(path, file, versionId, storage, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Upload a specific file (asynchronously) + * + * @param path Path where to upload including filename and extension e.g. /file.ext or /Folder 1/file.ext (required) + * @param file File to upload (required) + * @param versionId Source file's version (optional) + * @param storage User's storage name (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call putCreateAsync(String path, File file, String versionId, String storage, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = putCreateValidateBeforeCall(path, file, versionId, storage, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for putCreateDocument + * @param name The new document name. (required) + * @param templateFile The template file server path if defined. (optional) + * @param dataFile The data file path (for xml template only). (optional) + * @param templateType The template type, can be xml, html, bmp, jpg, png, tiff, emf, cgm, tex. (optional) + * @param storage The document storage. (optional) + * @param folder The new document folder. (optional) + * @param url The url of web page if defined. (optional) + * @param fitSize Draw a margin around content in resulting pdf. (optional, default to false) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call putCreateDocumentCall(String name, String templateFile, String dataFile, String templateType, String storage, String folder, String url, Boolean fitSize, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/pdf/{name}" + .replaceAll("\\{" + "name" + "\\}", apiClient.escapeString(name.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (templateFile != null) + localVarQueryParams.addAll(apiClient.parameterToPair("templateFile", templateFile)); + if (dataFile != null) + localVarQueryParams.addAll(apiClient.parameterToPair("dataFile", dataFile)); + if (templateType != null) + localVarQueryParams.addAll(apiClient.parameterToPair("templateType", templateType)); + if (storage != null) + localVarQueryParams.addAll(apiClient.parameterToPair("storage", storage)); + if (folder != null) + localVarQueryParams.addAll(apiClient.parameterToPair("folder", folder)); + if (url != null) + localVarQueryParams.addAll(apiClient.parameterToPair("url", url)); + if (fitSize != null) + localVarQueryParams.addAll(apiClient.parameterToPair("fitSize", fitSize)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call putCreateDocumentValidateBeforeCall(String name, String templateFile, String dataFile, String templateType, String storage, String folder, String url, Boolean fitSize, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException("Missing the required parameter 'name' when calling putCreateDocument(Async)"); + } + + + com.squareup.okhttp.Call call = putCreateDocumentCall(name, templateFile, dataFile, templateType, storage, folder, url, fitSize, progressListener, progressRequestListener); + return call; + + } + + /** + * Create new document. + * + * @param name The new document name. (required) + * @param templateFile The template file server path if defined. (optional) + * @param dataFile The data file path (for xml template only). (optional) + * @param templateType The template type, can be xml, html, bmp, jpg, png, tiff, emf, cgm, tex. (optional) + * @param storage The document storage. (optional) + * @param folder The new document folder. (optional) + * @param url The url of web page if defined. (optional) + * @param fitSize Draw a margin around content in resulting pdf. (optional, default to false) + * @return DocumentResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public DocumentResponse putCreateDocument(String name, String templateFile, String dataFile, String templateType, String storage, String folder, String url, Boolean fitSize) throws ApiException { + ApiResponse resp = putCreateDocumentWithHttpInfo(name, templateFile, dataFile, templateType, storage, folder, url, fitSize); + return resp.getData(); + } + + /** + * Create new document. + * + * @param name The new document name. (required) + * @param templateFile The template file server path if defined. (optional) + * @param dataFile The data file path (for xml template only). (optional) + * @param templateType The template type, can be xml, html, bmp, jpg, png, tiff, emf, cgm, tex. (optional) + * @param storage The document storage. (optional) + * @param folder The new document folder. (optional) + * @param url The url of web page if defined. (optional) + * @param fitSize Draw a margin around content in resulting pdf. (optional, default to false) + * @return ApiResponse<DocumentResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse putCreateDocumentWithHttpInfo(String name, String templateFile, String dataFile, String templateType, String storage, String folder, String url, Boolean fitSize) throws ApiException { + com.squareup.okhttp.Call call = putCreateDocumentValidateBeforeCall(name, templateFile, dataFile, templateType, storage, folder, url, fitSize, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Create new document. (asynchronously) + * + * @param name The new document name. (required) + * @param templateFile The template file server path if defined. (optional) + * @param dataFile The data file path (for xml template only). (optional) + * @param templateType The template type, can be xml, html, bmp, jpg, png, tiff, emf, cgm, tex. (optional) + * @param storage The document storage. (optional) + * @param folder The new document folder. (optional) + * @param url The url of web page if defined. (optional) + * @param fitSize Draw a margin around content in resulting pdf. (optional, default to false) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call putCreateDocumentAsync(String name, String templateFile, String dataFile, String templateType, String storage, String folder, String url, Boolean fitSize, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = putCreateDocumentValidateBeforeCall(name, templateFile, dataFile, templateType, storage, folder, url, fitSize, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for putCreateDocumentFromImages + * @param name The new document name. (required) + * @param images The images file paths set. (optional) + * @param ocr To create OCR layer for image or not. (optional, default to false) + * @param ocrLang The language which is defined for OCR engine. Default is eng. (optional, default to eng) + * @param storage The document storage. (optional) + * @param folder The new document folder. (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call putCreateDocumentFromImagesCall(String name, ImagesListRequest images, Boolean ocr, String ocrLang, String storage, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = images; + + // create path and map variables + String localVarPath = "/pdf/{name}/fromimages" + .replaceAll("\\{" + "name" + "\\}", apiClient.escapeString(name.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (ocr != null) + localVarQueryParams.addAll(apiClient.parameterToPair("ocr", ocr)); + if (ocrLang != null) + localVarQueryParams.addAll(apiClient.parameterToPair("ocrLang", ocrLang)); + if (storage != null) + localVarQueryParams.addAll(apiClient.parameterToPair("storage", storage)); + if (folder != null) + localVarQueryParams.addAll(apiClient.parameterToPair("folder", folder)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call putCreateDocumentFromImagesValidateBeforeCall(String name, ImagesListRequest images, Boolean ocr, String ocrLang, String storage, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException("Missing the required parameter 'name' when calling putCreateDocumentFromImages(Async)"); + } + + + com.squareup.okhttp.Call call = putCreateDocumentFromImagesCall(name, images, ocr, ocrLang, storage, folder, progressListener, progressRequestListener); + return call; + + } + + /** + * Create new document from images. + * + * @param name The new document name. (required) + * @param images The images file paths set. (optional) + * @param ocr To create OCR layer for image or not. (optional, default to false) + * @param ocrLang The language which is defined for OCR engine. Default is eng. (optional, default to eng) + * @param storage The document storage. (optional) + * @param folder The new document folder. (optional) + * @return DocumentResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public DocumentResponse putCreateDocumentFromImages(String name, ImagesListRequest images, Boolean ocr, String ocrLang, String storage, String folder) throws ApiException { + ApiResponse resp = putCreateDocumentFromImagesWithHttpInfo(name, images, ocr, ocrLang, storage, folder); + return resp.getData(); + } + + /** + * Create new document from images. + * + * @param name The new document name. (required) + * @param images The images file paths set. (optional) + * @param ocr To create OCR layer for image or not. (optional, default to false) + * @param ocrLang The language which is defined for OCR engine. Default is eng. (optional, default to eng) + * @param storage The document storage. (optional) + * @param folder The new document folder. (optional) + * @return ApiResponse<DocumentResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse putCreateDocumentFromImagesWithHttpInfo(String name, ImagesListRequest images, Boolean ocr, String ocrLang, String storage, String folder) throws ApiException { + com.squareup.okhttp.Call call = putCreateDocumentFromImagesValidateBeforeCall(name, images, ocr, ocrLang, storage, folder, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Create new document from images. (asynchronously) + * + * @param name The new document name. (required) + * @param images The images file paths set. (optional) + * @param ocr To create OCR layer for image or not. (optional, default to false) + * @param ocrLang The language which is defined for OCR engine. Default is eng. (optional, default to eng) + * @param storage The document storage. (optional) + * @param folder The new document folder. (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call putCreateDocumentFromImagesAsync(String name, ImagesListRequest images, Boolean ocr, String ocrLang, String storage, String folder, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = putCreateDocumentFromImagesValidateBeforeCall(name, images, ocr, ocrLang, storage, folder, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for putDocumentSaveAsTiff + * @param name The document name. (required) + * @param exportOptions with tiff export options. (optional) + * @param resultFile The resulting file. (optional) + * @param brightness The image brightness. (optional) + * @param compression Tiff compression. Possible values are: LZW, CCITT4, CCITT3, RLE, None. (optional) + * @param colorDepth Image color depth. Possible valuse are: Default, Format8bpp, Format4bpp, Format1bpp. (optional) + * @param leftMargin Left image margin. (optional) + * @param rightMargin Right image margin. (optional) + * @param topMargin Top image margin. (optional) + * @param bottomMargin Bottom image margin. (optional) + * @param orientation Image orientation. Possible values are: None, Landscape, Portait. (optional) + * @param skipBlankPages Skip blank pages flag. (optional) + * @param width Image width. (optional) + * @param height Image height. (optional) + * @param xResolution Horizontal resolution. (optional) + * @param yResolution Vertical resolution. (optional) + * @param pageIndex Start page to export. (optional) + * @param pageCount Number of pages to export. (optional) + * @param storage The document storage. (optional) + * @param folder The document folder. (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @deprecated + */ + @Deprecated + public com.squareup.okhttp.Call putDocumentSaveAsTiffCall(String name, TiffExportOptions exportOptions, String resultFile, Double brightness, String compression, String colorDepth, Integer leftMargin, Integer rightMargin, Integer topMargin, Integer bottomMargin, String orientation, Boolean skipBlankPages, Integer width, Integer height, Integer xResolution, Integer yResolution, Integer pageIndex, Integer pageCount, String storage, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = exportOptions; + + // create path and map variables + String localVarPath = "/pdf/{name}/SaveAs/tiff" + .replaceAll("\\{" + "name" + "\\}", apiClient.escapeString(name.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (resultFile != null) + localVarQueryParams.addAll(apiClient.parameterToPair("resultFile", resultFile)); + if (brightness != null) + localVarQueryParams.addAll(apiClient.parameterToPair("brightness", brightness)); + if (compression != null) + localVarQueryParams.addAll(apiClient.parameterToPair("compression", compression)); + if (colorDepth != null) + localVarQueryParams.addAll(apiClient.parameterToPair("colorDepth", colorDepth)); + if (leftMargin != null) + localVarQueryParams.addAll(apiClient.parameterToPair("leftMargin", leftMargin)); + if (rightMargin != null) + localVarQueryParams.addAll(apiClient.parameterToPair("rightMargin", rightMargin)); + if (topMargin != null) + localVarQueryParams.addAll(apiClient.parameterToPair("topMargin", topMargin)); + if (bottomMargin != null) + localVarQueryParams.addAll(apiClient.parameterToPair("bottomMargin", bottomMargin)); + if (orientation != null) + localVarQueryParams.addAll(apiClient.parameterToPair("orientation", orientation)); + if (skipBlankPages != null) + localVarQueryParams.addAll(apiClient.parameterToPair("skipBlankPages", skipBlankPages)); + if (width != null) + localVarQueryParams.addAll(apiClient.parameterToPair("width", width)); + if (height != null) + localVarQueryParams.addAll(apiClient.parameterToPair("height", height)); + if (xResolution != null) + localVarQueryParams.addAll(apiClient.parameterToPair("xResolution", xResolution)); + if (yResolution != null) + localVarQueryParams.addAll(apiClient.parameterToPair("yResolution", yResolution)); + if (pageIndex != null) + localVarQueryParams.addAll(apiClient.parameterToPair("pageIndex", pageIndex)); + if (pageCount != null) + localVarQueryParams.addAll(apiClient.parameterToPair("pageCount", pageCount)); + if (storage != null) + localVarQueryParams.addAll(apiClient.parameterToPair("storage", storage)); + if (folder != null) + localVarQueryParams.addAll(apiClient.parameterToPair("folder", folder)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @Deprecated + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call putDocumentSaveAsTiffValidateBeforeCall(String name, TiffExportOptions exportOptions, String resultFile, Double brightness, String compression, String colorDepth, Integer leftMargin, Integer rightMargin, Integer topMargin, Integer bottomMargin, String orientation, Boolean skipBlankPages, Integer width, Integer height, Integer xResolution, Integer yResolution, Integer pageIndex, Integer pageCount, String storage, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException("Missing the required parameter 'name' when calling putDocumentSaveAsTiff(Async)"); + } + + + com.squareup.okhttp.Call call = putDocumentSaveAsTiffCall(name, exportOptions, resultFile, brightness, compression, colorDepth, leftMargin, rightMargin, topMargin, bottomMargin, orientation, skipBlankPages, width, height, xResolution, yResolution, pageIndex, pageCount, storage, folder, progressListener, progressRequestListener); + return call; + + } + + /** + * Save document as Tiff image. + * + * @param name The document name. (required) + * @param exportOptions with tiff export options. (optional) + * @param resultFile The resulting file. (optional) + * @param brightness The image brightness. (optional) + * @param compression Tiff compression. Possible values are: LZW, CCITT4, CCITT3, RLE, None. (optional) + * @param colorDepth Image color depth. Possible valuse are: Default, Format8bpp, Format4bpp, Format1bpp. (optional) + * @param leftMargin Left image margin. (optional) + * @param rightMargin Right image margin. (optional) + * @param topMargin Top image margin. (optional) + * @param bottomMargin Bottom image margin. (optional) + * @param orientation Image orientation. Possible values are: None, Landscape, Portait. (optional) + * @param skipBlankPages Skip blank pages flag. (optional) + * @param width Image width. (optional) + * @param height Image height. (optional) + * @param xResolution Horizontal resolution. (optional) + * @param yResolution Vertical resolution. (optional) + * @param pageIndex Start page to export. (optional) + * @param pageCount Number of pages to export. (optional) + * @param storage The document storage. (optional) + * @param folder The document folder. (optional) + * @return SaaSposeResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @deprecated + */ + @Deprecated + public SaaSposeResponse putDocumentSaveAsTiff(String name, TiffExportOptions exportOptions, String resultFile, Double brightness, String compression, String colorDepth, Integer leftMargin, Integer rightMargin, Integer topMargin, Integer bottomMargin, String orientation, Boolean skipBlankPages, Integer width, Integer height, Integer xResolution, Integer yResolution, Integer pageIndex, Integer pageCount, String storage, String folder) throws ApiException { + ApiResponse resp = putDocumentSaveAsTiffWithHttpInfo(name, exportOptions, resultFile, brightness, compression, colorDepth, leftMargin, rightMargin, topMargin, bottomMargin, orientation, skipBlankPages, width, height, xResolution, yResolution, pageIndex, pageCount, storage, folder); + return resp.getData(); + } + + /** + * Save document as Tiff image. + * + * @param name The document name. (required) + * @param exportOptions with tiff export options. (optional) + * @param resultFile The resulting file. (optional) + * @param brightness The image brightness. (optional) + * @param compression Tiff compression. Possible values are: LZW, CCITT4, CCITT3, RLE, None. (optional) + * @param colorDepth Image color depth. Possible valuse are: Default, Format8bpp, Format4bpp, Format1bpp. (optional) + * @param leftMargin Left image margin. (optional) + * @param rightMargin Right image margin. (optional) + * @param topMargin Top image margin. (optional) + * @param bottomMargin Bottom image margin. (optional) + * @param orientation Image orientation. Possible values are: None, Landscape, Portait. (optional) + * @param skipBlankPages Skip blank pages flag. (optional) + * @param width Image width. (optional) + * @param height Image height. (optional) + * @param xResolution Horizontal resolution. (optional) + * @param yResolution Vertical resolution. (optional) + * @param pageIndex Start page to export. (optional) + * @param pageCount Number of pages to export. (optional) + * @param storage The document storage. (optional) + * @param folder The document folder. (optional) + * @return ApiResponse<SaaSposeResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @deprecated + */ + @Deprecated + public ApiResponse putDocumentSaveAsTiffWithHttpInfo(String name, TiffExportOptions exportOptions, String resultFile, Double brightness, String compression, String colorDepth, Integer leftMargin, Integer rightMargin, Integer topMargin, Integer bottomMargin, String orientation, Boolean skipBlankPages, Integer width, Integer height, Integer xResolution, Integer yResolution, Integer pageIndex, Integer pageCount, String storage, String folder) throws ApiException { + com.squareup.okhttp.Call call = putDocumentSaveAsTiffValidateBeforeCall(name, exportOptions, resultFile, brightness, compression, colorDepth, leftMargin, rightMargin, topMargin, bottomMargin, orientation, skipBlankPages, width, height, xResolution, yResolution, pageIndex, pageCount, storage, folder, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Save document as Tiff image. (asynchronously) + * + * @param name The document name. (required) + * @param exportOptions with tiff export options. (optional) + * @param resultFile The resulting file. (optional) + * @param brightness The image brightness. (optional) + * @param compression Tiff compression. Possible values are: LZW, CCITT4, CCITT3, RLE, None. (optional) + * @param colorDepth Image color depth. Possible valuse are: Default, Format8bpp, Format4bpp, Format1bpp. (optional) + * @param leftMargin Left image margin. (optional) + * @param rightMargin Right image margin. (optional) + * @param topMargin Top image margin. (optional) + * @param bottomMargin Bottom image margin. (optional) + * @param orientation Image orientation. Possible values are: None, Landscape, Portait. (optional) + * @param skipBlankPages Skip blank pages flag. (optional) + * @param width Image width. (optional) + * @param height Image height. (optional) + * @param xResolution Horizontal resolution. (optional) + * @param yResolution Vertical resolution. (optional) + * @param pageIndex Start page to export. (optional) + * @param pageCount Number of pages to export. (optional) + * @param storage The document storage. (optional) + * @param folder The document folder. (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @deprecated + */ + @Deprecated + public com.squareup.okhttp.Call putDocumentSaveAsTiffAsync(String name, TiffExportOptions exportOptions, String resultFile, Double brightness, String compression, String colorDepth, Integer leftMargin, Integer rightMargin, Integer topMargin, Integer bottomMargin, String orientation, Boolean skipBlankPages, Integer width, Integer height, Integer xResolution, Integer yResolution, Integer pageIndex, Integer pageCount, String storage, String folder, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = putDocumentSaveAsTiffValidateBeforeCall(name, exportOptions, resultFile, brightness, compression, colorDepth, leftMargin, rightMargin, topMargin, bottomMargin, orientation, skipBlankPages, width, height, xResolution, yResolution, pageIndex, pageCount, storage, folder, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for putEpubInStorageToPdf + * @param name The document name. (required) + * @param srcPath Full source filename (ex. /folder1/folder2/template.epub) (required) + * @param dstFolder The destination document folder. (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call putEpubInStorageToPdfCall(String name, String srcPath, String dstFolder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/pdf/{name}/create/epub" + .replaceAll("\\{" + "name" + "\\}", apiClient.escapeString(name.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (srcPath != null) + localVarQueryParams.addAll(apiClient.parameterToPair("srcPath", srcPath)); + if (dstFolder != null) + localVarQueryParams.addAll(apiClient.parameterToPair("dstFolder", dstFolder)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call putEpubInStorageToPdfValidateBeforeCall(String name, String srcPath, String dstFolder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException("Missing the required parameter 'name' when calling putEpubInStorageToPdf(Async)"); + } + + // verify the required parameter 'srcPath' is set + if (srcPath == null) { + throw new ApiException("Missing the required parameter 'srcPath' when calling putEpubInStorageToPdf(Async)"); + } + + + com.squareup.okhttp.Call call = putEpubInStorageToPdfCall(name, srcPath, dstFolder, progressListener, progressRequestListener); + return call; + + } + + /** + * Convert EPUB file (located on storage) to PDF format and upload resulting file to storage. + * + * @param name The document name. (required) + * @param srcPath Full source filename (ex. /folder1/folder2/template.epub) (required) + * @param dstFolder The destination document folder. (optional) + * @return SaaSposeResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public SaaSposeResponse putEpubInStorageToPdf(String name, String srcPath, String dstFolder) throws ApiException { + ApiResponse resp = putEpubInStorageToPdfWithHttpInfo(name, srcPath, dstFolder); + return resp.getData(); + } + + /** + * Convert EPUB file (located on storage) to PDF format and upload resulting file to storage. + * + * @param name The document name. (required) + * @param srcPath Full source filename (ex. /folder1/folder2/template.epub) (required) + * @param dstFolder The destination document folder. (optional) + * @return ApiResponse<SaaSposeResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse putEpubInStorageToPdfWithHttpInfo(String name, String srcPath, String dstFolder) throws ApiException { + com.squareup.okhttp.Call call = putEpubInStorageToPdfValidateBeforeCall(name, srcPath, dstFolder, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Convert EPUB file (located on storage) to PDF format and upload resulting file to storage. (asynchronously) + * + * @param name The document name. (required) + * @param srcPath Full source filename (ex. /folder1/folder2/template.epub) (required) + * @param dstFolder The destination document folder. (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call putEpubInStorageToPdfAsync(String name, String srcPath, String dstFolder, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = putEpubInStorageToPdfValidateBeforeCall(name, srcPath, dstFolder, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for putFieldsFlatten + * @param name The document name. (required) + * @param storage The document storage. (optional) + * @param folder The document folder. (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call putFieldsFlattenCall(String name, String storage, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/pdf/{name}/fields/flatten" + .replaceAll("\\{" + "name" + "\\}", apiClient.escapeString(name.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (storage != null) + localVarQueryParams.addAll(apiClient.parameterToPair("storage", storage)); + if (folder != null) + localVarQueryParams.addAll(apiClient.parameterToPair("folder", folder)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call putFieldsFlattenValidateBeforeCall(String name, String storage, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException("Missing the required parameter 'name' when calling putFieldsFlatten(Async)"); + } + + + com.squareup.okhttp.Call call = putFieldsFlattenCall(name, storage, folder, progressListener, progressRequestListener); + return call; + + } + + /** + * Flatten form fields in document. + * + * @param name The document name. (required) + * @param storage The document storage. (optional) + * @param folder The document folder. (optional) + * @return SaaSposeResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public SaaSposeResponse putFieldsFlatten(String name, String storage, String folder) throws ApiException { + ApiResponse resp = putFieldsFlattenWithHttpInfo(name, storage, folder); + return resp.getData(); + } + + /** + * Flatten form fields in document. + * + * @param name The document name. (required) + * @param storage The document storage. (optional) + * @param folder The document folder. (optional) + * @return ApiResponse<SaaSposeResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse putFieldsFlattenWithHttpInfo(String name, String storage, String folder) throws ApiException { + com.squareup.okhttp.Call call = putFieldsFlattenValidateBeforeCall(name, storage, folder, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Flatten form fields in document. (asynchronously) + * + * @param name The document name. (required) + * @param storage The document storage. (optional) + * @param folder The document folder. (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call putFieldsFlattenAsync(String name, String storage, String folder, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = putFieldsFlattenValidateBeforeCall(name, storage, folder, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for putHtmlInStorageToPdf + * @param name The document name. (required) + * @param srcPath Full source filename (ex. /folder1/folder2/template.zip) (required) + * @param htmlFileName Name of HTML file in ZIP. (required) + * @param height Page height (optional) + * @param width Page width (optional) + * @param isLandscape Is page landscaped (optional) + * @param marginLeft Page margin left (optional) + * @param marginBottom Page margin bottom (optional) + * @param marginRight Page margin right (optional) + * @param marginTop Page margin top (optional) + * @param dstFolder The destination document folder. (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call putHtmlInStorageToPdfCall(String name, String srcPath, String htmlFileName, Double height, Double width, Boolean isLandscape, Double marginLeft, Double marginBottom, Double marginRight, Double marginTop, String dstFolder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/pdf/{name}/create/html" + .replaceAll("\\{" + "name" + "\\}", apiClient.escapeString(name.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (srcPath != null) + localVarQueryParams.addAll(apiClient.parameterToPair("srcPath", srcPath)); + if (htmlFileName != null) + localVarQueryParams.addAll(apiClient.parameterToPair("htmlFileName", htmlFileName)); + if (height != null) + localVarQueryParams.addAll(apiClient.parameterToPair("height", height)); + if (width != null) + localVarQueryParams.addAll(apiClient.parameterToPair("width", width)); + if (isLandscape != null) + localVarQueryParams.addAll(apiClient.parameterToPair("isLandscape", isLandscape)); + if (marginLeft != null) + localVarQueryParams.addAll(apiClient.parameterToPair("marginLeft", marginLeft)); + if (marginBottom != null) + localVarQueryParams.addAll(apiClient.parameterToPair("marginBottom", marginBottom)); + if (marginRight != null) + localVarQueryParams.addAll(apiClient.parameterToPair("marginRight", marginRight)); + if (marginTop != null) + localVarQueryParams.addAll(apiClient.parameterToPair("marginTop", marginTop)); + if (dstFolder != null) + localVarQueryParams.addAll(apiClient.parameterToPair("dstFolder", dstFolder)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call putHtmlInStorageToPdfValidateBeforeCall(String name, String srcPath, String htmlFileName, Double height, Double width, Boolean isLandscape, Double marginLeft, Double marginBottom, Double marginRight, Double marginTop, String dstFolder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException("Missing the required parameter 'name' when calling putHtmlInStorageToPdf(Async)"); + } + + // verify the required parameter 'srcPath' is set + if (srcPath == null) { + throw new ApiException("Missing the required parameter 'srcPath' when calling putHtmlInStorageToPdf(Async)"); + } + + // verify the required parameter 'htmlFileName' is set + if (htmlFileName == null) { + throw new ApiException("Missing the required parameter 'htmlFileName' when calling putHtmlInStorageToPdf(Async)"); + } + + + com.squareup.okhttp.Call call = putHtmlInStorageToPdfCall(name, srcPath, htmlFileName, height, width, isLandscape, marginLeft, marginBottom, marginRight, marginTop, dstFolder, progressListener, progressRequestListener); + return call; + + } + + /** + * Convert HTML file (located on storage) to PDF format and upload resulting file to storage. + * + * @param name The document name. (required) + * @param srcPath Full source filename (ex. /folder1/folder2/template.zip) (required) + * @param htmlFileName Name of HTML file in ZIP. (required) + * @param height Page height (optional) + * @param width Page width (optional) + * @param isLandscape Is page landscaped (optional) + * @param marginLeft Page margin left (optional) + * @param marginBottom Page margin bottom (optional) + * @param marginRight Page margin right (optional) + * @param marginTop Page margin top (optional) + * @param dstFolder The destination document folder. (optional) + * @return SaaSposeResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public SaaSposeResponse putHtmlInStorageToPdf(String name, String srcPath, String htmlFileName, Double height, Double width, Boolean isLandscape, Double marginLeft, Double marginBottom, Double marginRight, Double marginTop, String dstFolder) throws ApiException { + ApiResponse resp = putHtmlInStorageToPdfWithHttpInfo(name, srcPath, htmlFileName, height, width, isLandscape, marginLeft, marginBottom, marginRight, marginTop, dstFolder); + return resp.getData(); + } + + /** + * Convert HTML file (located on storage) to PDF format and upload resulting file to storage. + * + * @param name The document name. (required) + * @param srcPath Full source filename (ex. /folder1/folder2/template.zip) (required) + * @param htmlFileName Name of HTML file in ZIP. (required) + * @param height Page height (optional) + * @param width Page width (optional) + * @param isLandscape Is page landscaped (optional) + * @param marginLeft Page margin left (optional) + * @param marginBottom Page margin bottom (optional) + * @param marginRight Page margin right (optional) + * @param marginTop Page margin top (optional) + * @param dstFolder The destination document folder. (optional) + * @return ApiResponse<SaaSposeResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse putHtmlInStorageToPdfWithHttpInfo(String name, String srcPath, String htmlFileName, Double height, Double width, Boolean isLandscape, Double marginLeft, Double marginBottom, Double marginRight, Double marginTop, String dstFolder) throws ApiException { + com.squareup.okhttp.Call call = putHtmlInStorageToPdfValidateBeforeCall(name, srcPath, htmlFileName, height, width, isLandscape, marginLeft, marginBottom, marginRight, marginTop, dstFolder, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Convert HTML file (located on storage) to PDF format and upload resulting file to storage. (asynchronously) + * + * @param name The document name. (required) + * @param srcPath Full source filename (ex. /folder1/folder2/template.zip) (required) + * @param htmlFileName Name of HTML file in ZIP. (required) + * @param height Page height (optional) + * @param width Page width (optional) + * @param isLandscape Is page landscaped (optional) + * @param marginLeft Page margin left (optional) + * @param marginBottom Page margin bottom (optional) + * @param marginRight Page margin right (optional) + * @param marginTop Page margin top (optional) + * @param dstFolder The destination document folder. (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call putHtmlInStorageToPdfAsync(String name, String srcPath, String htmlFileName, Double height, Double width, Boolean isLandscape, Double marginLeft, Double marginBottom, Double marginRight, Double marginTop, String dstFolder, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = putHtmlInStorageToPdfValidateBeforeCall(name, srcPath, htmlFileName, height, width, isLandscape, marginLeft, marginBottom, marginRight, marginTop, dstFolder, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for putLaTeXInStorageToPdf + * @param name The document name. (required) + * @param srcPath Full source filename (ex. /folder1/folder2/template.tex) (required) + * @param dstFolder The destination document folder. (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call putLaTeXInStorageToPdfCall(String name, String srcPath, String dstFolder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/pdf/{name}/create/latex" + .replaceAll("\\{" + "name" + "\\}", apiClient.escapeString(name.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (srcPath != null) + localVarQueryParams.addAll(apiClient.parameterToPair("srcPath", srcPath)); + if (dstFolder != null) + localVarQueryParams.addAll(apiClient.parameterToPair("dstFolder", dstFolder)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call putLaTeXInStorageToPdfValidateBeforeCall(String name, String srcPath, String dstFolder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException("Missing the required parameter 'name' when calling putLaTeXInStorageToPdf(Async)"); + } + + // verify the required parameter 'srcPath' is set + if (srcPath == null) { + throw new ApiException("Missing the required parameter 'srcPath' when calling putLaTeXInStorageToPdf(Async)"); + } + + + com.squareup.okhttp.Call call = putLaTeXInStorageToPdfCall(name, srcPath, dstFolder, progressListener, progressRequestListener); + return call; + + } + + /** + * Convert LaTeX file (located on storage) to PDF format and upload resulting file to storage. + * + * @param name The document name. (required) + * @param srcPath Full source filename (ex. /folder1/folder2/template.tex) (required) + * @param dstFolder The destination document folder. (optional) + * @return SaaSposeResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public SaaSposeResponse putLaTeXInStorageToPdf(String name, String srcPath, String dstFolder) throws ApiException { + ApiResponse resp = putLaTeXInStorageToPdfWithHttpInfo(name, srcPath, dstFolder); + return resp.getData(); + } + + /** + * Convert LaTeX file (located on storage) to PDF format and upload resulting file to storage. + * + * @param name The document name. (required) + * @param srcPath Full source filename (ex. /folder1/folder2/template.tex) (required) + * @param dstFolder The destination document folder. (optional) + * @return ApiResponse<SaaSposeResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse putLaTeXInStorageToPdfWithHttpInfo(String name, String srcPath, String dstFolder) throws ApiException { + com.squareup.okhttp.Call call = putLaTeXInStorageToPdfValidateBeforeCall(name, srcPath, dstFolder, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Convert LaTeX file (located on storage) to PDF format and upload resulting file to storage. (asynchronously) + * + * @param name The document name. (required) + * @param srcPath Full source filename (ex. /folder1/folder2/template.tex) (required) + * @param dstFolder The destination document folder. (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call putLaTeXInStorageToPdfAsync(String name, String srcPath, String dstFolder, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = putLaTeXInStorageToPdfValidateBeforeCall(name, srcPath, dstFolder, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for putMergeDocuments + * @param name Resulting documen name. (required) + * @param mergeDocuments with a list of documents. (optional) + * @param storage Resulting document storage. (optional) + * @param folder Resulting document folder. (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call putMergeDocumentsCall(String name, MergeDocuments mergeDocuments, String storage, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = mergeDocuments; + + // create path and map variables + String localVarPath = "/pdf/{name}/merge" + .replaceAll("\\{" + "name" + "\\}", apiClient.escapeString(name.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (storage != null) + localVarQueryParams.addAll(apiClient.parameterToPair("storage", storage)); + if (folder != null) + localVarQueryParams.addAll(apiClient.parameterToPair("folder", folder)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call putMergeDocumentsValidateBeforeCall(String name, MergeDocuments mergeDocuments, String storage, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException("Missing the required parameter 'name' when calling putMergeDocuments(Async)"); + } + + + com.squareup.okhttp.Call call = putMergeDocumentsCall(name, mergeDocuments, storage, folder, progressListener, progressRequestListener); + return call; + + } + + /** + * Merge a list of documents. + * + * @param name Resulting documen name. (required) + * @param mergeDocuments with a list of documents. (optional) + * @param storage Resulting document storage. (optional) + * @param folder Resulting document folder. (optional) + * @return DocumentResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public DocumentResponse putMergeDocuments(String name, MergeDocuments mergeDocuments, String storage, String folder) throws ApiException { + ApiResponse resp = putMergeDocumentsWithHttpInfo(name, mergeDocuments, storage, folder); + return resp.getData(); + } + + /** + * Merge a list of documents. + * + * @param name Resulting documen name. (required) + * @param mergeDocuments with a list of documents. (optional) + * @param storage Resulting document storage. (optional) + * @param folder Resulting document folder. (optional) + * @return ApiResponse<DocumentResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse putMergeDocumentsWithHttpInfo(String name, MergeDocuments mergeDocuments, String storage, String folder) throws ApiException { + com.squareup.okhttp.Call call = putMergeDocumentsValidateBeforeCall(name, mergeDocuments, storage, folder, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Merge a list of documents. (asynchronously) + * + * @param name Resulting documen name. (required) + * @param mergeDocuments with a list of documents. (optional) + * @param storage Resulting document storage. (optional) + * @param folder Resulting document folder. (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call putMergeDocumentsAsync(String name, MergeDocuments mergeDocuments, String storage, String folder, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = putMergeDocumentsValidateBeforeCall(name, mergeDocuments, storage, folder, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for putMhtInStorageToPdf + * @param name The document name. (required) + * @param srcPath Full source filename (ex. /folder1/folder2/template.mht) (required) + * @param dstFolder The destination document folder. (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call putMhtInStorageToPdfCall(String name, String srcPath, String dstFolder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/pdf/{name}/create/mht" + .replaceAll("\\{" + "name" + "\\}", apiClient.escapeString(name.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (srcPath != null) + localVarQueryParams.addAll(apiClient.parameterToPair("srcPath", srcPath)); + if (dstFolder != null) + localVarQueryParams.addAll(apiClient.parameterToPair("dstFolder", dstFolder)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call putMhtInStorageToPdfValidateBeforeCall(String name, String srcPath, String dstFolder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException("Missing the required parameter 'name' when calling putMhtInStorageToPdf(Async)"); + } + + // verify the required parameter 'srcPath' is set + if (srcPath == null) { + throw new ApiException("Missing the required parameter 'srcPath' when calling putMhtInStorageToPdf(Async)"); + } + + + com.squareup.okhttp.Call call = putMhtInStorageToPdfCall(name, srcPath, dstFolder, progressListener, progressRequestListener); + return call; + + } + + /** + * Convert MHT file (located on storage) to PDF format and upload resulting file to storage. + * + * @param name The document name. (required) + * @param srcPath Full source filename (ex. /folder1/folder2/template.mht) (required) + * @param dstFolder The destination document folder. (optional) + * @return SaaSposeResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public SaaSposeResponse putMhtInStorageToPdf(String name, String srcPath, String dstFolder) throws ApiException { + ApiResponse resp = putMhtInStorageToPdfWithHttpInfo(name, srcPath, dstFolder); + return resp.getData(); + } + + /** + * Convert MHT file (located on storage) to PDF format and upload resulting file to storage. + * + * @param name The document name. (required) + * @param srcPath Full source filename (ex. /folder1/folder2/template.mht) (required) + * @param dstFolder The destination document folder. (optional) + * @return ApiResponse<SaaSposeResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse putMhtInStorageToPdfWithHttpInfo(String name, String srcPath, String dstFolder) throws ApiException { + com.squareup.okhttp.Call call = putMhtInStorageToPdfValidateBeforeCall(name, srcPath, dstFolder, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Convert MHT file (located on storage) to PDF format and upload resulting file to storage. (asynchronously) + * + * @param name The document name. (required) + * @param srcPath Full source filename (ex. /folder1/folder2/template.mht) (required) + * @param dstFolder The destination document folder. (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call putMhtInStorageToPdfAsync(String name, String srcPath, String dstFolder, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = putMhtInStorageToPdfValidateBeforeCall(name, srcPath, dstFolder, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for putPageAddStamp + * @param name The document name. (required) + * @param pageNumber The page number. (required) + * @param stamp with data. (required) + * @param storage The document storage. (optional) + * @param folder The document folder. (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call putPageAddStampCall(String name, Integer pageNumber, Stamp stamp, String storage, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = stamp; + + // create path and map variables + String localVarPath = "/pdf/{name}/pages/{pageNumber}/stamp" + .replaceAll("\\{" + "name" + "\\}", apiClient.escapeString(name.toString())) + .replaceAll("\\{" + "pageNumber" + "\\}", apiClient.escapeString(pageNumber.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (storage != null) + localVarQueryParams.addAll(apiClient.parameterToPair("storage", storage)); + if (folder != null) + localVarQueryParams.addAll(apiClient.parameterToPair("folder", folder)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call putPageAddStampValidateBeforeCall(String name, Integer pageNumber, Stamp stamp, String storage, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException("Missing the required parameter 'name' when calling putPageAddStamp(Async)"); + } + + // verify the required parameter 'pageNumber' is set + if (pageNumber == null) { + throw new ApiException("Missing the required parameter 'pageNumber' when calling putPageAddStamp(Async)"); + } + + // verify the required parameter 'stamp' is set + if (stamp == null) { + throw new ApiException("Missing the required parameter 'stamp' when calling putPageAddStamp(Async)"); + } + + + com.squareup.okhttp.Call call = putPageAddStampCall(name, pageNumber, stamp, storage, folder, progressListener, progressRequestListener); + return call; + + } + + /** + * Add page stamp. + * + * @param name The document name. (required) + * @param pageNumber The page number. (required) + * @param stamp with data. (required) + * @param storage The document storage. (optional) + * @param folder The document folder. (optional) + * @return SaaSposeResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public SaaSposeResponse putPageAddStamp(String name, Integer pageNumber, Stamp stamp, String storage, String folder) throws ApiException { + ApiResponse resp = putPageAddStampWithHttpInfo(name, pageNumber, stamp, storage, folder); + return resp.getData(); + } + + /** + * Add page stamp. + * + * @param name The document name. (required) + * @param pageNumber The page number. (required) + * @param stamp with data. (required) + * @param storage The document storage. (optional) + * @param folder The document folder. (optional) + * @return ApiResponse<SaaSposeResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse putPageAddStampWithHttpInfo(String name, Integer pageNumber, Stamp stamp, String storage, String folder) throws ApiException { + com.squareup.okhttp.Call call = putPageAddStampValidateBeforeCall(name, pageNumber, stamp, storage, folder, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Add page stamp. (asynchronously) + * + * @param name The document name. (required) + * @param pageNumber The page number. (required) + * @param stamp with data. (required) + * @param storage The document storage. (optional) + * @param folder The document folder. (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call putPageAddStampAsync(String name, Integer pageNumber, Stamp stamp, String storage, String folder, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = putPageAddStampValidateBeforeCall(name, pageNumber, stamp, storage, folder, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for putPclInStorageToPdf + * @param name The document name. (required) + * @param srcPath Full source filename (ex. /folder1/folder2/template.pcl) (required) + * @param dstFolder The destination document folder. (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call putPclInStorageToPdfCall(String name, String srcPath, String dstFolder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/pdf/{name}/create/pcl" + .replaceAll("\\{" + "name" + "\\}", apiClient.escapeString(name.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (srcPath != null) + localVarQueryParams.addAll(apiClient.parameterToPair("srcPath", srcPath)); + if (dstFolder != null) + localVarQueryParams.addAll(apiClient.parameterToPair("dstFolder", dstFolder)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call putPclInStorageToPdfValidateBeforeCall(String name, String srcPath, String dstFolder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException("Missing the required parameter 'name' when calling putPclInStorageToPdf(Async)"); + } + + // verify the required parameter 'srcPath' is set + if (srcPath == null) { + throw new ApiException("Missing the required parameter 'srcPath' when calling putPclInStorageToPdf(Async)"); + } + + + com.squareup.okhttp.Call call = putPclInStorageToPdfCall(name, srcPath, dstFolder, progressListener, progressRequestListener); + return call; + + } + + /** + * Convert PCL file (located on storage) to PDF format and upload resulting file to storage. + * + * @param name The document name. (required) + * @param srcPath Full source filename (ex. /folder1/folder2/template.pcl) (required) + * @param dstFolder The destination document folder. (optional) + * @return SaaSposeResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public SaaSposeResponse putPclInStorageToPdf(String name, String srcPath, String dstFolder) throws ApiException { + ApiResponse resp = putPclInStorageToPdfWithHttpInfo(name, srcPath, dstFolder); + return resp.getData(); + } + + /** + * Convert PCL file (located on storage) to PDF format and upload resulting file to storage. + * + * @param name The document name. (required) + * @param srcPath Full source filename (ex. /folder1/folder2/template.pcl) (required) + * @param dstFolder The destination document folder. (optional) + * @return ApiResponse<SaaSposeResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse putPclInStorageToPdfWithHttpInfo(String name, String srcPath, String dstFolder) throws ApiException { + com.squareup.okhttp.Call call = putPclInStorageToPdfValidateBeforeCall(name, srcPath, dstFolder, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Convert PCL file (located on storage) to PDF format and upload resulting file to storage. (asynchronously) + * + * @param name The document name. (required) + * @param srcPath Full source filename (ex. /folder1/folder2/template.pcl) (required) + * @param dstFolder The destination document folder. (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call putPclInStorageToPdfAsync(String name, String srcPath, String dstFolder, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = putPclInStorageToPdfValidateBeforeCall(name, srcPath, dstFolder, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for putPdfInRequestToDoc + * @param outPath Full resulting filename (ex. /folder1/folder2/result.doc) (required) + * @param addReturnToLineEnd Add return to line end. (optional) + * @param format Allows to specify .doc or .docx file format. (optional) + * @param imageResolutionX Image resolution X. (optional) + * @param imageResolutionY Image resolution Y. (optional) + * @param maxDistanceBetweenTextLines Max distance between text lines. (optional) + * @param mode Allows to control how a PDF document is converted into a word processing document. (optional) + * @param recognizeBullets Recognize bullets. (optional) + * @param relativeHorizontalProximity Relative horizontal proximity. (optional) + * @param file A file to be converted. (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call putPdfInRequestToDocCall(String outPath, Boolean addReturnToLineEnd, String format, Integer imageResolutionX, Integer imageResolutionY, Integer maxDistanceBetweenTextLines, String mode, Boolean recognizeBullets, Double relativeHorizontalProximity, File file, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = file; + + // create path and map variables + String localVarPath = "/pdf/convert/doc"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (outPath != null) + localVarQueryParams.addAll(apiClient.parameterToPair("outPath", outPath)); + if (addReturnToLineEnd != null) + localVarQueryParams.addAll(apiClient.parameterToPair("addReturnToLineEnd", addReturnToLineEnd)); + if (format != null) + localVarQueryParams.addAll(apiClient.parameterToPair("format", format)); + if (imageResolutionX != null) + localVarQueryParams.addAll(apiClient.parameterToPair("imageResolutionX", imageResolutionX)); + if (imageResolutionY != null) + localVarQueryParams.addAll(apiClient.parameterToPair("imageResolutionY", imageResolutionY)); + if (maxDistanceBetweenTextLines != null) + localVarQueryParams.addAll(apiClient.parameterToPair("maxDistanceBetweenTextLines", maxDistanceBetweenTextLines)); + if (mode != null) + localVarQueryParams.addAll(apiClient.parameterToPair("mode", mode)); + if (recognizeBullets != null) + localVarQueryParams.addAll(apiClient.parameterToPair("recognizeBullets", recognizeBullets)); + if (relativeHorizontalProximity != null) + localVarQueryParams.addAll(apiClient.parameterToPair("relativeHorizontalProximity", relativeHorizontalProximity)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call putPdfInRequestToDocValidateBeforeCall(String outPath, Boolean addReturnToLineEnd, String format, Integer imageResolutionX, Integer imageResolutionY, Integer maxDistanceBetweenTextLines, String mode, Boolean recognizeBullets, Double relativeHorizontalProximity, File file, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + // verify the required parameter 'outPath' is set + if (outPath == null) { + throw new ApiException("Missing the required parameter 'outPath' when calling putPdfInRequestToDoc(Async)"); + } + + + com.squareup.okhttp.Call call = putPdfInRequestToDocCall(outPath, addReturnToLineEnd, format, imageResolutionX, imageResolutionY, maxDistanceBetweenTextLines, mode, recognizeBullets, relativeHorizontalProximity, file, progressListener, progressRequestListener); + return call; + + } + + /** + * Converts PDF document (in request content) to DOC format and uploads resulting file to storage. + * + * @param outPath Full resulting filename (ex. /folder1/folder2/result.doc) (required) + * @param addReturnToLineEnd Add return to line end. (optional) + * @param format Allows to specify .doc or .docx file format. (optional) + * @param imageResolutionX Image resolution X. (optional) + * @param imageResolutionY Image resolution Y. (optional) + * @param maxDistanceBetweenTextLines Max distance between text lines. (optional) + * @param mode Allows to control how a PDF document is converted into a word processing document. (optional) + * @param recognizeBullets Recognize bullets. (optional) + * @param relativeHorizontalProximity Relative horizontal proximity. (optional) + * @param file A file to be converted. (optional) + * @return SaaSposeResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public SaaSposeResponse putPdfInRequestToDoc(String outPath, Boolean addReturnToLineEnd, String format, Integer imageResolutionX, Integer imageResolutionY, Integer maxDistanceBetweenTextLines, String mode, Boolean recognizeBullets, Double relativeHorizontalProximity, File file) throws ApiException { + ApiResponse resp = putPdfInRequestToDocWithHttpInfo(outPath, addReturnToLineEnd, format, imageResolutionX, imageResolutionY, maxDistanceBetweenTextLines, mode, recognizeBullets, relativeHorizontalProximity, file); + return resp.getData(); + } + + /** + * Converts PDF document (in request content) to DOC format and uploads resulting file to storage. + * + * @param outPath Full resulting filename (ex. /folder1/folder2/result.doc) (required) + * @param addReturnToLineEnd Add return to line end. (optional) + * @param format Allows to specify .doc or .docx file format. (optional) + * @param imageResolutionX Image resolution X. (optional) + * @param imageResolutionY Image resolution Y. (optional) + * @param maxDistanceBetweenTextLines Max distance between text lines. (optional) + * @param mode Allows to control how a PDF document is converted into a word processing document. (optional) + * @param recognizeBullets Recognize bullets. (optional) + * @param relativeHorizontalProximity Relative horizontal proximity. (optional) + * @param file A file to be converted. (optional) + * @return ApiResponse<SaaSposeResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse putPdfInRequestToDocWithHttpInfo(String outPath, Boolean addReturnToLineEnd, String format, Integer imageResolutionX, Integer imageResolutionY, Integer maxDistanceBetweenTextLines, String mode, Boolean recognizeBullets, Double relativeHorizontalProximity, File file) throws ApiException { + com.squareup.okhttp.Call call = putPdfInRequestToDocValidateBeforeCall(outPath, addReturnToLineEnd, format, imageResolutionX, imageResolutionY, maxDistanceBetweenTextLines, mode, recognizeBullets, relativeHorizontalProximity, file, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Converts PDF document (in request content) to DOC format and uploads resulting file to storage. (asynchronously) + * + * @param outPath Full resulting filename (ex. /folder1/folder2/result.doc) (required) + * @param addReturnToLineEnd Add return to line end. (optional) + * @param format Allows to specify .doc or .docx file format. (optional) + * @param imageResolutionX Image resolution X. (optional) + * @param imageResolutionY Image resolution Y. (optional) + * @param maxDistanceBetweenTextLines Max distance between text lines. (optional) + * @param mode Allows to control how a PDF document is converted into a word processing document. (optional) + * @param recognizeBullets Recognize bullets. (optional) + * @param relativeHorizontalProximity Relative horizontal proximity. (optional) + * @param file A file to be converted. (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call putPdfInRequestToDocAsync(String outPath, Boolean addReturnToLineEnd, String format, Integer imageResolutionX, Integer imageResolutionY, Integer maxDistanceBetweenTextLines, String mode, Boolean recognizeBullets, Double relativeHorizontalProximity, File file, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = putPdfInRequestToDocValidateBeforeCall(outPath, addReturnToLineEnd, format, imageResolutionX, imageResolutionY, maxDistanceBetweenTextLines, mode, recognizeBullets, relativeHorizontalProximity, file, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for putPdfInRequestToEpub + * @param outPath Full resulting filename (ex. /folder1/folder2/result.epub) (required) + * @param contentRecognitionMode Рroperty tunes conversion for this or that desirable method of recognition of content. (optional) + * @param file A file to be converted. (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call putPdfInRequestToEpubCall(String outPath, String contentRecognitionMode, File file, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = file; + + // create path and map variables + String localVarPath = "/pdf/convert/epub"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (outPath != null) + localVarQueryParams.addAll(apiClient.parameterToPair("outPath", outPath)); + if (contentRecognitionMode != null) + localVarQueryParams.addAll(apiClient.parameterToPair("contentRecognitionMode", contentRecognitionMode)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call putPdfInRequestToEpubValidateBeforeCall(String outPath, String contentRecognitionMode, File file, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + // verify the required parameter 'outPath' is set + if (outPath == null) { + throw new ApiException("Missing the required parameter 'outPath' when calling putPdfInRequestToEpub(Async)"); + } + + + com.squareup.okhttp.Call call = putPdfInRequestToEpubCall(outPath, contentRecognitionMode, file, progressListener, progressRequestListener); + return call; + + } + + /** + * Converts PDF document (in request content) to EPUB format and uploads resulting file to storage. + * + * @param outPath Full resulting filename (ex. /folder1/folder2/result.epub) (required) + * @param contentRecognitionMode Рroperty tunes conversion for this or that desirable method of recognition of content. (optional) + * @param file A file to be converted. (optional) + * @return SaaSposeResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public SaaSposeResponse putPdfInRequestToEpub(String outPath, String contentRecognitionMode, File file) throws ApiException { + ApiResponse resp = putPdfInRequestToEpubWithHttpInfo(outPath, contentRecognitionMode, file); + return resp.getData(); + } + + /** + * Converts PDF document (in request content) to EPUB format and uploads resulting file to storage. + * + * @param outPath Full resulting filename (ex. /folder1/folder2/result.epub) (required) + * @param contentRecognitionMode Рroperty tunes conversion for this or that desirable method of recognition of content. (optional) + * @param file A file to be converted. (optional) + * @return ApiResponse<SaaSposeResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse putPdfInRequestToEpubWithHttpInfo(String outPath, String contentRecognitionMode, File file) throws ApiException { + com.squareup.okhttp.Call call = putPdfInRequestToEpubValidateBeforeCall(outPath, contentRecognitionMode, file, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Converts PDF document (in request content) to EPUB format and uploads resulting file to storage. (asynchronously) + * + * @param outPath Full resulting filename (ex. /folder1/folder2/result.epub) (required) + * @param contentRecognitionMode Рroperty tunes conversion for this or that desirable method of recognition of content. (optional) + * @param file A file to be converted. (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call putPdfInRequestToEpubAsync(String outPath, String contentRecognitionMode, File file, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = putPdfInRequestToEpubValidateBeforeCall(outPath, contentRecognitionMode, file, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for putPdfInRequestToHtml + * @param outPath Full resulting filename (ex. /folder1/folder2/result.html) (required) + * @param additionalMarginWidthInPoints Defines width of margin that will be forcibly left around that output HTML-areas. (optional) + * @param compressSvgGraphicsIfAny The flag that indicates whether found SVG graphics(if any) will be compressed(zipped) into SVGZ format during saving. (optional) + * @param convertMarkedContentToLayers If attribute ConvertMarkedContentToLayers set to true then an all elements inside a PDF marked content (layer) will be put into an HTML div with \"data-pdflayer\" attribute specifying a layer name. This layer name will be extracted from optional properties of PDF marked content. If this attribute is false (by default) then no any layers will be created from PDF marked content. (optional) + * @param defaultFontName Specifies the name of an installed font which is used to substitute any document font that is not embedded and not installed in the system. If null then default substitution font is used. (optional) + * @param documentType Result document type. (optional) + * @param fixedLayout The value indicating whether that HTML is created as fixed layout. (optional) + * @param imageResolution Resolution for image rendering. (optional) + * @param minimalLineWidth This attribute sets minimal width of graphic path line. If thickness of line is less than 1px Adobe Acrobat rounds it to this value. So this attribute can be used to emulate this behavior for HTML browsers. (optional) + * @param preventGlyphsGrouping This attribute switch on the mode when text glyphs will not be grouped into words and strings This mode allows to keep maximum precision during positioning of glyphs on the page and it can be used for conversion documents with music notes or glyphs that should be placed separately each other. This parameter will be applied to document only when the value of FixedLayout attribute is true. (optional) + * @param splitCssIntoPages When multipage-mode selected(i.e 'SplitIntoPages' is 'true'), then this attribute defines whether should be created separate CSS-file for each result HTML page. (optional) + * @param splitIntoPages The flag that indicates whether each page of source document will be converted into it's own target HTML document, i.e whether result HTML will be splitted into several HTML-pages. (optional) + * @param useZOrder If attribute UseZORder set to true, graphics and text are added to resultant HTML document accordingly Z-order in original PDF document. If this attribute is false all graphics is put as single layer which may cause some unnecessary effects for overlapped objects. (optional) + * @param antialiasingProcessing The parameter defines required antialiasing measures during conversion of compound background images from PDF to HTML. (optional) + * @param cssClassNamesPrefix When PDFtoHTML converter generates result CSSs, CSS class names (something like \".stl_01 {}\" ... \".stl_NN {}) are generated and used in result CSS. This property allows forcibly set class name prefix. (optional) + * @param explicitListOfSavedPages With this property You can explicitely define what pages of document should be converted. Pages in this list must have 1-based numbers. I.e. valid numbers of pages must be taken from range (1...[NumberOfPagesInConvertedDocument]) Order of appearing of pages in this list does not affect their order in result HTML page(s) - in result pages allways will go in order in which they are present in source PDF. (optional) + * @param fontEncodingStrategy Defines encoding special rule to tune PDF decoding for current document. (optional) + * @param fontSavingMode Defines font saving mode that will be used during saving of PDF to desirable format. (optional) + * @param htmlMarkupGenerationMode Sometimes specific reqirments to generation of HTML markup are present. This parameter defines HTML preparing modes that can be used during conversion of PDF to HTML to match such specific requirments. (optional) + * @param lettersPositioningMethod The mode of positioning of letters in words in result HTML. (optional) + * @param pagesFlowTypeDependsOnViewersScreenSize If attribute 'SplitOnPages=false', than whole HTML representing all input PDF pages will be put into one big result HTML file. This flag defines whether result HTML will be generated in such way that flow of areas that represent PDF pages in result HTML will depend on screen resolution of viewer. (optional) + * @param partsEmbeddingMode It defines whether referenced files (HTML, Fonts,Images, CSSes) will be embedded into main HTML file or will be generated as apart binary entities. (optional) + * @param rasterImagesSavingMode Converted PDF can contain raster images This parameter defines how they should be handled during conversion of PDF to HTML. (optional) + * @param removeEmptyAreasOnTopAndBottom Defines whether in created HTML will be removed top and bottom empty area without any content (if any). (optional) + * @param saveShadowedTextsAsTransparentTexts Pdf can contain texts that are shadowed by another elements (f.e. by images) but can be selected to clipboard in Acrobat Reader (usually it happen when document contains images and OCRed texts extracted from it). This settings tells to converter whether we need save such texts as transparent selectable texts in result HTML to mimic behaviour of Acrobat Reader (othervise such texts are usually saved as hidden, not available for copying to clipboard). (optional) + * @param saveTransparentTexts Pdf can contain transparent texts that can be selected to clipboard (usually it happen when document contains images and OCRed texts extracted from it). This settings tells to converter whether we need save such texts as transparent selectable texts in result HTML. (optional) + * @param specialFolderForAllImages The path to directory to which must be saved any images if they are encountered during saving of document as HTML. If parameter is empty or null then image files(if any) wil be saved together with other files linked to HTML It does not affect anything if CustomImageSavingStrategy property was successfully used to process relevant image file. (optional) + * @param specialFolderForSvgImages The path to directory to which must be saved only SVG-images if they are encountered during saving of document as HTML. If parameter is empty or null then SVG files(if any) wil be saved together with other image-files (near to output file) or in special folder for images (if it specified in SpecialImagesFolderIfAny option). It does not affect anything if CustomImageSavingStrategy property was successfully used to process relevant image file. (optional) + * @param trySaveTextUnderliningAndStrikeoutingInCss PDF itself does not contain underlining markers for texts. It emulated with line situated under text. This option allows converter try guess that this or that line is a text's underlining and put this info into CSS instead of drawing of underlining graphically. (optional) + * @param file A file to be converted. (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call putPdfInRequestToHtmlCall(String outPath, Integer additionalMarginWidthInPoints, Boolean compressSvgGraphicsIfAny, Boolean convertMarkedContentToLayers, String defaultFontName, String documentType, Boolean fixedLayout, Integer imageResolution, Integer minimalLineWidth, Boolean preventGlyphsGrouping, Boolean splitCssIntoPages, Boolean splitIntoPages, Boolean useZOrder, String antialiasingProcessing, String cssClassNamesPrefix, List explicitListOfSavedPages, String fontEncodingStrategy, String fontSavingMode, String htmlMarkupGenerationMode, String lettersPositioningMethod, Boolean pagesFlowTypeDependsOnViewersScreenSize, String partsEmbeddingMode, String rasterImagesSavingMode, Boolean removeEmptyAreasOnTopAndBottom, Boolean saveShadowedTextsAsTransparentTexts, Boolean saveTransparentTexts, String specialFolderForAllImages, String specialFolderForSvgImages, Boolean trySaveTextUnderliningAndStrikeoutingInCss, File file, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = file; + + // create path and map variables + String localVarPath = "/pdf/convert/html"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (outPath != null) + localVarQueryParams.addAll(apiClient.parameterToPair("outPath", outPath)); + if (additionalMarginWidthInPoints != null) + localVarQueryParams.addAll(apiClient.parameterToPair("additionalMarginWidthInPoints", additionalMarginWidthInPoints)); + if (compressSvgGraphicsIfAny != null) + localVarQueryParams.addAll(apiClient.parameterToPair("compressSvgGraphicsIfAny", compressSvgGraphicsIfAny)); + if (convertMarkedContentToLayers != null) + localVarQueryParams.addAll(apiClient.parameterToPair("convertMarkedContentToLayers", convertMarkedContentToLayers)); + if (defaultFontName != null) + localVarQueryParams.addAll(apiClient.parameterToPair("defaultFontName", defaultFontName)); + if (documentType != null) + localVarQueryParams.addAll(apiClient.parameterToPair("documentType", documentType)); + if (fixedLayout != null) + localVarQueryParams.addAll(apiClient.parameterToPair("fixedLayout", fixedLayout)); + if (imageResolution != null) + localVarQueryParams.addAll(apiClient.parameterToPair("imageResolution", imageResolution)); + if (minimalLineWidth != null) + localVarQueryParams.addAll(apiClient.parameterToPair("minimalLineWidth", minimalLineWidth)); + if (preventGlyphsGrouping != null) + localVarQueryParams.addAll(apiClient.parameterToPair("preventGlyphsGrouping", preventGlyphsGrouping)); + if (splitCssIntoPages != null) + localVarQueryParams.addAll(apiClient.parameterToPair("splitCssIntoPages", splitCssIntoPages)); + if (splitIntoPages != null) + localVarQueryParams.addAll(apiClient.parameterToPair("splitIntoPages", splitIntoPages)); + if (useZOrder != null) + localVarQueryParams.addAll(apiClient.parameterToPair("useZOrder", useZOrder)); + if (antialiasingProcessing != null) + localVarQueryParams.addAll(apiClient.parameterToPair("antialiasingProcessing", antialiasingProcessing)); + if (cssClassNamesPrefix != null) + localVarQueryParams.addAll(apiClient.parameterToPair("cssClassNamesPrefix", cssClassNamesPrefix)); + if (explicitListOfSavedPages != null) + localVarCollectionQueryParams.addAll(apiClient.parameterToPairs("multi", "explicitListOfSavedPages", explicitListOfSavedPages)); + if (fontEncodingStrategy != null) + localVarQueryParams.addAll(apiClient.parameterToPair("fontEncodingStrategy", fontEncodingStrategy)); + if (fontSavingMode != null) + localVarQueryParams.addAll(apiClient.parameterToPair("fontSavingMode", fontSavingMode)); + if (htmlMarkupGenerationMode != null) + localVarQueryParams.addAll(apiClient.parameterToPair("htmlMarkupGenerationMode", htmlMarkupGenerationMode)); + if (lettersPositioningMethod != null) + localVarQueryParams.addAll(apiClient.parameterToPair("lettersPositioningMethod", lettersPositioningMethod)); + if (pagesFlowTypeDependsOnViewersScreenSize != null) + localVarQueryParams.addAll(apiClient.parameterToPair("pagesFlowTypeDependsOnViewersScreenSize", pagesFlowTypeDependsOnViewersScreenSize)); + if (partsEmbeddingMode != null) + localVarQueryParams.addAll(apiClient.parameterToPair("partsEmbeddingMode", partsEmbeddingMode)); + if (rasterImagesSavingMode != null) + localVarQueryParams.addAll(apiClient.parameterToPair("rasterImagesSavingMode", rasterImagesSavingMode)); + if (removeEmptyAreasOnTopAndBottom != null) + localVarQueryParams.addAll(apiClient.parameterToPair("removeEmptyAreasOnTopAndBottom", removeEmptyAreasOnTopAndBottom)); + if (saveShadowedTextsAsTransparentTexts != null) + localVarQueryParams.addAll(apiClient.parameterToPair("saveShadowedTextsAsTransparentTexts", saveShadowedTextsAsTransparentTexts)); + if (saveTransparentTexts != null) + localVarQueryParams.addAll(apiClient.parameterToPair("saveTransparentTexts", saveTransparentTexts)); + if (specialFolderForAllImages != null) + localVarQueryParams.addAll(apiClient.parameterToPair("specialFolderForAllImages", specialFolderForAllImages)); + if (specialFolderForSvgImages != null) + localVarQueryParams.addAll(apiClient.parameterToPair("specialFolderForSvgImages", specialFolderForSvgImages)); + if (trySaveTextUnderliningAndStrikeoutingInCss != null) + localVarQueryParams.addAll(apiClient.parameterToPair("trySaveTextUnderliningAndStrikeoutingInCss", trySaveTextUnderliningAndStrikeoutingInCss)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call putPdfInRequestToHtmlValidateBeforeCall(String outPath, Integer additionalMarginWidthInPoints, Boolean compressSvgGraphicsIfAny, Boolean convertMarkedContentToLayers, String defaultFontName, String documentType, Boolean fixedLayout, Integer imageResolution, Integer minimalLineWidth, Boolean preventGlyphsGrouping, Boolean splitCssIntoPages, Boolean splitIntoPages, Boolean useZOrder, String antialiasingProcessing, String cssClassNamesPrefix, List explicitListOfSavedPages, String fontEncodingStrategy, String fontSavingMode, String htmlMarkupGenerationMode, String lettersPositioningMethod, Boolean pagesFlowTypeDependsOnViewersScreenSize, String partsEmbeddingMode, String rasterImagesSavingMode, Boolean removeEmptyAreasOnTopAndBottom, Boolean saveShadowedTextsAsTransparentTexts, Boolean saveTransparentTexts, String specialFolderForAllImages, String specialFolderForSvgImages, Boolean trySaveTextUnderliningAndStrikeoutingInCss, File file, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + // verify the required parameter 'outPath' is set + if (outPath == null) { + throw new ApiException("Missing the required parameter 'outPath' when calling putPdfInRequestToHtml(Async)"); + } + + + com.squareup.okhttp.Call call = putPdfInRequestToHtmlCall(outPath, additionalMarginWidthInPoints, compressSvgGraphicsIfAny, convertMarkedContentToLayers, defaultFontName, documentType, fixedLayout, imageResolution, minimalLineWidth, preventGlyphsGrouping, splitCssIntoPages, splitIntoPages, useZOrder, antialiasingProcessing, cssClassNamesPrefix, explicitListOfSavedPages, fontEncodingStrategy, fontSavingMode, htmlMarkupGenerationMode, lettersPositioningMethod, pagesFlowTypeDependsOnViewersScreenSize, partsEmbeddingMode, rasterImagesSavingMode, removeEmptyAreasOnTopAndBottom, saveShadowedTextsAsTransparentTexts, saveTransparentTexts, specialFolderForAllImages, specialFolderForSvgImages, trySaveTextUnderliningAndStrikeoutingInCss, file, progressListener, progressRequestListener); + return call; + + } + + /** + * Converts PDF document (in request content) to Html format and uploads resulting file to storage. + * + * @param outPath Full resulting filename (ex. /folder1/folder2/result.html) (required) + * @param additionalMarginWidthInPoints Defines width of margin that will be forcibly left around that output HTML-areas. (optional) + * @param compressSvgGraphicsIfAny The flag that indicates whether found SVG graphics(if any) will be compressed(zipped) into SVGZ format during saving. (optional) + * @param convertMarkedContentToLayers If attribute ConvertMarkedContentToLayers set to true then an all elements inside a PDF marked content (layer) will be put into an HTML div with \"data-pdflayer\" attribute specifying a layer name. This layer name will be extracted from optional properties of PDF marked content. If this attribute is false (by default) then no any layers will be created from PDF marked content. (optional) + * @param defaultFontName Specifies the name of an installed font which is used to substitute any document font that is not embedded and not installed in the system. If null then default substitution font is used. (optional) + * @param documentType Result document type. (optional) + * @param fixedLayout The value indicating whether that HTML is created as fixed layout. (optional) + * @param imageResolution Resolution for image rendering. (optional) + * @param minimalLineWidth This attribute sets minimal width of graphic path line. If thickness of line is less than 1px Adobe Acrobat rounds it to this value. So this attribute can be used to emulate this behavior for HTML browsers. (optional) + * @param preventGlyphsGrouping This attribute switch on the mode when text glyphs will not be grouped into words and strings This mode allows to keep maximum precision during positioning of glyphs on the page and it can be used for conversion documents with music notes or glyphs that should be placed separately each other. This parameter will be applied to document only when the value of FixedLayout attribute is true. (optional) + * @param splitCssIntoPages When multipage-mode selected(i.e 'SplitIntoPages' is 'true'), then this attribute defines whether should be created separate CSS-file for each result HTML page. (optional) + * @param splitIntoPages The flag that indicates whether each page of source document will be converted into it's own target HTML document, i.e whether result HTML will be splitted into several HTML-pages. (optional) + * @param useZOrder If attribute UseZORder set to true, graphics and text are added to resultant HTML document accordingly Z-order in original PDF document. If this attribute is false all graphics is put as single layer which may cause some unnecessary effects for overlapped objects. (optional) + * @param antialiasingProcessing The parameter defines required antialiasing measures during conversion of compound background images from PDF to HTML. (optional) + * @param cssClassNamesPrefix When PDFtoHTML converter generates result CSSs, CSS class names (something like \".stl_01 {}\" ... \".stl_NN {}) are generated and used in result CSS. This property allows forcibly set class name prefix. (optional) + * @param explicitListOfSavedPages With this property You can explicitely define what pages of document should be converted. Pages in this list must have 1-based numbers. I.e. valid numbers of pages must be taken from range (1...[NumberOfPagesInConvertedDocument]) Order of appearing of pages in this list does not affect their order in result HTML page(s) - in result pages allways will go in order in which they are present in source PDF. (optional) + * @param fontEncodingStrategy Defines encoding special rule to tune PDF decoding for current document. (optional) + * @param fontSavingMode Defines font saving mode that will be used during saving of PDF to desirable format. (optional) + * @param htmlMarkupGenerationMode Sometimes specific reqirments to generation of HTML markup are present. This parameter defines HTML preparing modes that can be used during conversion of PDF to HTML to match such specific requirments. (optional) + * @param lettersPositioningMethod The mode of positioning of letters in words in result HTML. (optional) + * @param pagesFlowTypeDependsOnViewersScreenSize If attribute 'SplitOnPages=false', than whole HTML representing all input PDF pages will be put into one big result HTML file. This flag defines whether result HTML will be generated in such way that flow of areas that represent PDF pages in result HTML will depend on screen resolution of viewer. (optional) + * @param partsEmbeddingMode It defines whether referenced files (HTML, Fonts,Images, CSSes) will be embedded into main HTML file or will be generated as apart binary entities. (optional) + * @param rasterImagesSavingMode Converted PDF can contain raster images This parameter defines how they should be handled during conversion of PDF to HTML. (optional) + * @param removeEmptyAreasOnTopAndBottom Defines whether in created HTML will be removed top and bottom empty area without any content (if any). (optional) + * @param saveShadowedTextsAsTransparentTexts Pdf can contain texts that are shadowed by another elements (f.e. by images) but can be selected to clipboard in Acrobat Reader (usually it happen when document contains images and OCRed texts extracted from it). This settings tells to converter whether we need save such texts as transparent selectable texts in result HTML to mimic behaviour of Acrobat Reader (othervise such texts are usually saved as hidden, not available for copying to clipboard). (optional) + * @param saveTransparentTexts Pdf can contain transparent texts that can be selected to clipboard (usually it happen when document contains images and OCRed texts extracted from it). This settings tells to converter whether we need save such texts as transparent selectable texts in result HTML. (optional) + * @param specialFolderForAllImages The path to directory to which must be saved any images if they are encountered during saving of document as HTML. If parameter is empty or null then image files(if any) wil be saved together with other files linked to HTML It does not affect anything if CustomImageSavingStrategy property was successfully used to process relevant image file. (optional) + * @param specialFolderForSvgImages The path to directory to which must be saved only SVG-images if they are encountered during saving of document as HTML. If parameter is empty or null then SVG files(if any) wil be saved together with other image-files (near to output file) or in special folder for images (if it specified in SpecialImagesFolderIfAny option). It does not affect anything if CustomImageSavingStrategy property was successfully used to process relevant image file. (optional) + * @param trySaveTextUnderliningAndStrikeoutingInCss PDF itself does not contain underlining markers for texts. It emulated with line situated under text. This option allows converter try guess that this or that line is a text's underlining and put this info into CSS instead of drawing of underlining graphically. (optional) + * @param file A file to be converted. (optional) + * @return SaaSposeResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public SaaSposeResponse putPdfInRequestToHtml(String outPath, Integer additionalMarginWidthInPoints, Boolean compressSvgGraphicsIfAny, Boolean convertMarkedContentToLayers, String defaultFontName, String documentType, Boolean fixedLayout, Integer imageResolution, Integer minimalLineWidth, Boolean preventGlyphsGrouping, Boolean splitCssIntoPages, Boolean splitIntoPages, Boolean useZOrder, String antialiasingProcessing, String cssClassNamesPrefix, List explicitListOfSavedPages, String fontEncodingStrategy, String fontSavingMode, String htmlMarkupGenerationMode, String lettersPositioningMethod, Boolean pagesFlowTypeDependsOnViewersScreenSize, String partsEmbeddingMode, String rasterImagesSavingMode, Boolean removeEmptyAreasOnTopAndBottom, Boolean saveShadowedTextsAsTransparentTexts, Boolean saveTransparentTexts, String specialFolderForAllImages, String specialFolderForSvgImages, Boolean trySaveTextUnderliningAndStrikeoutingInCss, File file) throws ApiException { + ApiResponse resp = putPdfInRequestToHtmlWithHttpInfo(outPath, additionalMarginWidthInPoints, compressSvgGraphicsIfAny, convertMarkedContentToLayers, defaultFontName, documentType, fixedLayout, imageResolution, minimalLineWidth, preventGlyphsGrouping, splitCssIntoPages, splitIntoPages, useZOrder, antialiasingProcessing, cssClassNamesPrefix, explicitListOfSavedPages, fontEncodingStrategy, fontSavingMode, htmlMarkupGenerationMode, lettersPositioningMethod, pagesFlowTypeDependsOnViewersScreenSize, partsEmbeddingMode, rasterImagesSavingMode, removeEmptyAreasOnTopAndBottom, saveShadowedTextsAsTransparentTexts, saveTransparentTexts, specialFolderForAllImages, specialFolderForSvgImages, trySaveTextUnderliningAndStrikeoutingInCss, file); + return resp.getData(); + } + + /** + * Converts PDF document (in request content) to Html format and uploads resulting file to storage. + * + * @param outPath Full resulting filename (ex. /folder1/folder2/result.html) (required) + * @param additionalMarginWidthInPoints Defines width of margin that will be forcibly left around that output HTML-areas. (optional) + * @param compressSvgGraphicsIfAny The flag that indicates whether found SVG graphics(if any) will be compressed(zipped) into SVGZ format during saving. (optional) + * @param convertMarkedContentToLayers If attribute ConvertMarkedContentToLayers set to true then an all elements inside a PDF marked content (layer) will be put into an HTML div with \"data-pdflayer\" attribute specifying a layer name. This layer name will be extracted from optional properties of PDF marked content. If this attribute is false (by default) then no any layers will be created from PDF marked content. (optional) + * @param defaultFontName Specifies the name of an installed font which is used to substitute any document font that is not embedded and not installed in the system. If null then default substitution font is used. (optional) + * @param documentType Result document type. (optional) + * @param fixedLayout The value indicating whether that HTML is created as fixed layout. (optional) + * @param imageResolution Resolution for image rendering. (optional) + * @param minimalLineWidth This attribute sets minimal width of graphic path line. If thickness of line is less than 1px Adobe Acrobat rounds it to this value. So this attribute can be used to emulate this behavior for HTML browsers. (optional) + * @param preventGlyphsGrouping This attribute switch on the mode when text glyphs will not be grouped into words and strings This mode allows to keep maximum precision during positioning of glyphs on the page and it can be used for conversion documents with music notes or glyphs that should be placed separately each other. This parameter will be applied to document only when the value of FixedLayout attribute is true. (optional) + * @param splitCssIntoPages When multipage-mode selected(i.e 'SplitIntoPages' is 'true'), then this attribute defines whether should be created separate CSS-file for each result HTML page. (optional) + * @param splitIntoPages The flag that indicates whether each page of source document will be converted into it's own target HTML document, i.e whether result HTML will be splitted into several HTML-pages. (optional) + * @param useZOrder If attribute UseZORder set to true, graphics and text are added to resultant HTML document accordingly Z-order in original PDF document. If this attribute is false all graphics is put as single layer which may cause some unnecessary effects for overlapped objects. (optional) + * @param antialiasingProcessing The parameter defines required antialiasing measures during conversion of compound background images from PDF to HTML. (optional) + * @param cssClassNamesPrefix When PDFtoHTML converter generates result CSSs, CSS class names (something like \".stl_01 {}\" ... \".stl_NN {}) are generated and used in result CSS. This property allows forcibly set class name prefix. (optional) + * @param explicitListOfSavedPages With this property You can explicitely define what pages of document should be converted. Pages in this list must have 1-based numbers. I.e. valid numbers of pages must be taken from range (1...[NumberOfPagesInConvertedDocument]) Order of appearing of pages in this list does not affect their order in result HTML page(s) - in result pages allways will go in order in which they are present in source PDF. (optional) + * @param fontEncodingStrategy Defines encoding special rule to tune PDF decoding for current document. (optional) + * @param fontSavingMode Defines font saving mode that will be used during saving of PDF to desirable format. (optional) + * @param htmlMarkupGenerationMode Sometimes specific reqirments to generation of HTML markup are present. This parameter defines HTML preparing modes that can be used during conversion of PDF to HTML to match such specific requirments. (optional) + * @param lettersPositioningMethod The mode of positioning of letters in words in result HTML. (optional) + * @param pagesFlowTypeDependsOnViewersScreenSize If attribute 'SplitOnPages=false', than whole HTML representing all input PDF pages will be put into one big result HTML file. This flag defines whether result HTML will be generated in such way that flow of areas that represent PDF pages in result HTML will depend on screen resolution of viewer. (optional) + * @param partsEmbeddingMode It defines whether referenced files (HTML, Fonts,Images, CSSes) will be embedded into main HTML file or will be generated as apart binary entities. (optional) + * @param rasterImagesSavingMode Converted PDF can contain raster images This parameter defines how they should be handled during conversion of PDF to HTML. (optional) + * @param removeEmptyAreasOnTopAndBottom Defines whether in created HTML will be removed top and bottom empty area without any content (if any). (optional) + * @param saveShadowedTextsAsTransparentTexts Pdf can contain texts that are shadowed by another elements (f.e. by images) but can be selected to clipboard in Acrobat Reader (usually it happen when document contains images and OCRed texts extracted from it). This settings tells to converter whether we need save such texts as transparent selectable texts in result HTML to mimic behaviour of Acrobat Reader (othervise such texts are usually saved as hidden, not available for copying to clipboard). (optional) + * @param saveTransparentTexts Pdf can contain transparent texts that can be selected to clipboard (usually it happen when document contains images and OCRed texts extracted from it). This settings tells to converter whether we need save such texts as transparent selectable texts in result HTML. (optional) + * @param specialFolderForAllImages The path to directory to which must be saved any images if they are encountered during saving of document as HTML. If parameter is empty or null then image files(if any) wil be saved together with other files linked to HTML It does not affect anything if CustomImageSavingStrategy property was successfully used to process relevant image file. (optional) + * @param specialFolderForSvgImages The path to directory to which must be saved only SVG-images if they are encountered during saving of document as HTML. If parameter is empty or null then SVG files(if any) wil be saved together with other image-files (near to output file) or in special folder for images (if it specified in SpecialImagesFolderIfAny option). It does not affect anything if CustomImageSavingStrategy property was successfully used to process relevant image file. (optional) + * @param trySaveTextUnderliningAndStrikeoutingInCss PDF itself does not contain underlining markers for texts. It emulated with line situated under text. This option allows converter try guess that this or that line is a text's underlining and put this info into CSS instead of drawing of underlining graphically. (optional) + * @param file A file to be converted. (optional) + * @return ApiResponse<SaaSposeResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse putPdfInRequestToHtmlWithHttpInfo(String outPath, Integer additionalMarginWidthInPoints, Boolean compressSvgGraphicsIfAny, Boolean convertMarkedContentToLayers, String defaultFontName, String documentType, Boolean fixedLayout, Integer imageResolution, Integer minimalLineWidth, Boolean preventGlyphsGrouping, Boolean splitCssIntoPages, Boolean splitIntoPages, Boolean useZOrder, String antialiasingProcessing, String cssClassNamesPrefix, List explicitListOfSavedPages, String fontEncodingStrategy, String fontSavingMode, String htmlMarkupGenerationMode, String lettersPositioningMethod, Boolean pagesFlowTypeDependsOnViewersScreenSize, String partsEmbeddingMode, String rasterImagesSavingMode, Boolean removeEmptyAreasOnTopAndBottom, Boolean saveShadowedTextsAsTransparentTexts, Boolean saveTransparentTexts, String specialFolderForAllImages, String specialFolderForSvgImages, Boolean trySaveTextUnderliningAndStrikeoutingInCss, File file) throws ApiException { + com.squareup.okhttp.Call call = putPdfInRequestToHtmlValidateBeforeCall(outPath, additionalMarginWidthInPoints, compressSvgGraphicsIfAny, convertMarkedContentToLayers, defaultFontName, documentType, fixedLayout, imageResolution, minimalLineWidth, preventGlyphsGrouping, splitCssIntoPages, splitIntoPages, useZOrder, antialiasingProcessing, cssClassNamesPrefix, explicitListOfSavedPages, fontEncodingStrategy, fontSavingMode, htmlMarkupGenerationMode, lettersPositioningMethod, pagesFlowTypeDependsOnViewersScreenSize, partsEmbeddingMode, rasterImagesSavingMode, removeEmptyAreasOnTopAndBottom, saveShadowedTextsAsTransparentTexts, saveTransparentTexts, specialFolderForAllImages, specialFolderForSvgImages, trySaveTextUnderliningAndStrikeoutingInCss, file, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Converts PDF document (in request content) to Html format and uploads resulting file to storage. (asynchronously) + * + * @param outPath Full resulting filename (ex. /folder1/folder2/result.html) (required) + * @param additionalMarginWidthInPoints Defines width of margin that will be forcibly left around that output HTML-areas. (optional) + * @param compressSvgGraphicsIfAny The flag that indicates whether found SVG graphics(if any) will be compressed(zipped) into SVGZ format during saving. (optional) + * @param convertMarkedContentToLayers If attribute ConvertMarkedContentToLayers set to true then an all elements inside a PDF marked content (layer) will be put into an HTML div with \"data-pdflayer\" attribute specifying a layer name. This layer name will be extracted from optional properties of PDF marked content. If this attribute is false (by default) then no any layers will be created from PDF marked content. (optional) + * @param defaultFontName Specifies the name of an installed font which is used to substitute any document font that is not embedded and not installed in the system. If null then default substitution font is used. (optional) + * @param documentType Result document type. (optional) + * @param fixedLayout The value indicating whether that HTML is created as fixed layout. (optional) + * @param imageResolution Resolution for image rendering. (optional) + * @param minimalLineWidth This attribute sets minimal width of graphic path line. If thickness of line is less than 1px Adobe Acrobat rounds it to this value. So this attribute can be used to emulate this behavior for HTML browsers. (optional) + * @param preventGlyphsGrouping This attribute switch on the mode when text glyphs will not be grouped into words and strings This mode allows to keep maximum precision during positioning of glyphs on the page and it can be used for conversion documents with music notes or glyphs that should be placed separately each other. This parameter will be applied to document only when the value of FixedLayout attribute is true. (optional) + * @param splitCssIntoPages When multipage-mode selected(i.e 'SplitIntoPages' is 'true'), then this attribute defines whether should be created separate CSS-file for each result HTML page. (optional) + * @param splitIntoPages The flag that indicates whether each page of source document will be converted into it's own target HTML document, i.e whether result HTML will be splitted into several HTML-pages. (optional) + * @param useZOrder If attribute UseZORder set to true, graphics and text are added to resultant HTML document accordingly Z-order in original PDF document. If this attribute is false all graphics is put as single layer which may cause some unnecessary effects for overlapped objects. (optional) + * @param antialiasingProcessing The parameter defines required antialiasing measures during conversion of compound background images from PDF to HTML. (optional) + * @param cssClassNamesPrefix When PDFtoHTML converter generates result CSSs, CSS class names (something like \".stl_01 {}\" ... \".stl_NN {}) are generated and used in result CSS. This property allows forcibly set class name prefix. (optional) + * @param explicitListOfSavedPages With this property You can explicitely define what pages of document should be converted. Pages in this list must have 1-based numbers. I.e. valid numbers of pages must be taken from range (1...[NumberOfPagesInConvertedDocument]) Order of appearing of pages in this list does not affect their order in result HTML page(s) - in result pages allways will go in order in which they are present in source PDF. (optional) + * @param fontEncodingStrategy Defines encoding special rule to tune PDF decoding for current document. (optional) + * @param fontSavingMode Defines font saving mode that will be used during saving of PDF to desirable format. (optional) + * @param htmlMarkupGenerationMode Sometimes specific reqirments to generation of HTML markup are present. This parameter defines HTML preparing modes that can be used during conversion of PDF to HTML to match such specific requirments. (optional) + * @param lettersPositioningMethod The mode of positioning of letters in words in result HTML. (optional) + * @param pagesFlowTypeDependsOnViewersScreenSize If attribute 'SplitOnPages=false', than whole HTML representing all input PDF pages will be put into one big result HTML file. This flag defines whether result HTML will be generated in such way that flow of areas that represent PDF pages in result HTML will depend on screen resolution of viewer. (optional) + * @param partsEmbeddingMode It defines whether referenced files (HTML, Fonts,Images, CSSes) will be embedded into main HTML file or will be generated as apart binary entities. (optional) + * @param rasterImagesSavingMode Converted PDF can contain raster images This parameter defines how they should be handled during conversion of PDF to HTML. (optional) + * @param removeEmptyAreasOnTopAndBottom Defines whether in created HTML will be removed top and bottom empty area without any content (if any). (optional) + * @param saveShadowedTextsAsTransparentTexts Pdf can contain texts that are shadowed by another elements (f.e. by images) but can be selected to clipboard in Acrobat Reader (usually it happen when document contains images and OCRed texts extracted from it). This settings tells to converter whether we need save such texts as transparent selectable texts in result HTML to mimic behaviour of Acrobat Reader (othervise such texts are usually saved as hidden, not available for copying to clipboard). (optional) + * @param saveTransparentTexts Pdf can contain transparent texts that can be selected to clipboard (usually it happen when document contains images and OCRed texts extracted from it). This settings tells to converter whether we need save such texts as transparent selectable texts in result HTML. (optional) + * @param specialFolderForAllImages The path to directory to which must be saved any images if they are encountered during saving of document as HTML. If parameter is empty or null then image files(if any) wil be saved together with other files linked to HTML It does not affect anything if CustomImageSavingStrategy property was successfully used to process relevant image file. (optional) + * @param specialFolderForSvgImages The path to directory to which must be saved only SVG-images if they are encountered during saving of document as HTML. If parameter is empty or null then SVG files(if any) wil be saved together with other image-files (near to output file) or in special folder for images (if it specified in SpecialImagesFolderIfAny option). It does not affect anything if CustomImageSavingStrategy property was successfully used to process relevant image file. (optional) + * @param trySaveTextUnderliningAndStrikeoutingInCss PDF itself does not contain underlining markers for texts. It emulated with line situated under text. This option allows converter try guess that this or that line is a text's underlining and put this info into CSS instead of drawing of underlining graphically. (optional) + * @param file A file to be converted. (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call putPdfInRequestToHtmlAsync(String outPath, Integer additionalMarginWidthInPoints, Boolean compressSvgGraphicsIfAny, Boolean convertMarkedContentToLayers, String defaultFontName, String documentType, Boolean fixedLayout, Integer imageResolution, Integer minimalLineWidth, Boolean preventGlyphsGrouping, Boolean splitCssIntoPages, Boolean splitIntoPages, Boolean useZOrder, String antialiasingProcessing, String cssClassNamesPrefix, List explicitListOfSavedPages, String fontEncodingStrategy, String fontSavingMode, String htmlMarkupGenerationMode, String lettersPositioningMethod, Boolean pagesFlowTypeDependsOnViewersScreenSize, String partsEmbeddingMode, String rasterImagesSavingMode, Boolean removeEmptyAreasOnTopAndBottom, Boolean saveShadowedTextsAsTransparentTexts, Boolean saveTransparentTexts, String specialFolderForAllImages, String specialFolderForSvgImages, Boolean trySaveTextUnderliningAndStrikeoutingInCss, File file, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = putPdfInRequestToHtmlValidateBeforeCall(outPath, additionalMarginWidthInPoints, compressSvgGraphicsIfAny, convertMarkedContentToLayers, defaultFontName, documentType, fixedLayout, imageResolution, minimalLineWidth, preventGlyphsGrouping, splitCssIntoPages, splitIntoPages, useZOrder, antialiasingProcessing, cssClassNamesPrefix, explicitListOfSavedPages, fontEncodingStrategy, fontSavingMode, htmlMarkupGenerationMode, lettersPositioningMethod, pagesFlowTypeDependsOnViewersScreenSize, partsEmbeddingMode, rasterImagesSavingMode, removeEmptyAreasOnTopAndBottom, saveShadowedTextsAsTransparentTexts, saveTransparentTexts, specialFolderForAllImages, specialFolderForSvgImages, trySaveTextUnderliningAndStrikeoutingInCss, file, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for putPdfInRequestToLaTeX + * @param outPath Full resulting filename (ex. /folder1/folder2/result.tex) (required) + * @param pagesCount Pages count. (optional) + * @param file A file to be converted. (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call putPdfInRequestToLaTeXCall(String outPath, Integer pagesCount, File file, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = file; + + // create path and map variables + String localVarPath = "/pdf/convert/latex"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (outPath != null) + localVarQueryParams.addAll(apiClient.parameterToPair("outPath", outPath)); + if (pagesCount != null) + localVarQueryParams.addAll(apiClient.parameterToPair("pagesCount", pagesCount)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call putPdfInRequestToLaTeXValidateBeforeCall(String outPath, Integer pagesCount, File file, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + // verify the required parameter 'outPath' is set + if (outPath == null) { + throw new ApiException("Missing the required parameter 'outPath' when calling putPdfInRequestToLaTeX(Async)"); + } + + + com.squareup.okhttp.Call call = putPdfInRequestToLaTeXCall(outPath, pagesCount, file, progressListener, progressRequestListener); + return call; + + } + + /** + * Converts PDF document (in request content) to LaTeX format and uploads resulting file to storage. + * + * @param outPath Full resulting filename (ex. /folder1/folder2/result.tex) (required) + * @param pagesCount Pages count. (optional) + * @param file A file to be converted. (optional) + * @return SaaSposeResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public SaaSposeResponse putPdfInRequestToLaTeX(String outPath, Integer pagesCount, File file) throws ApiException { + ApiResponse resp = putPdfInRequestToLaTeXWithHttpInfo(outPath, pagesCount, file); + return resp.getData(); + } + + /** + * Converts PDF document (in request content) to LaTeX format and uploads resulting file to storage. + * + * @param outPath Full resulting filename (ex. /folder1/folder2/result.tex) (required) + * @param pagesCount Pages count. (optional) + * @param file A file to be converted. (optional) + * @return ApiResponse<SaaSposeResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse putPdfInRequestToLaTeXWithHttpInfo(String outPath, Integer pagesCount, File file) throws ApiException { + com.squareup.okhttp.Call call = putPdfInRequestToLaTeXValidateBeforeCall(outPath, pagesCount, file, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Converts PDF document (in request content) to LaTeX format and uploads resulting file to storage. (asynchronously) + * + * @param outPath Full resulting filename (ex. /folder1/folder2/result.tex) (required) + * @param pagesCount Pages count. (optional) + * @param file A file to be converted. (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call putPdfInRequestToLaTeXAsync(String outPath, Integer pagesCount, File file, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = putPdfInRequestToLaTeXValidateBeforeCall(outPath, pagesCount, file, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for putPdfInRequestToMobiXml + * @param outPath Full resulting filename (ex. /folder1/folder2/result.mobixml) (required) + * @param file A file to be converted. (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call putPdfInRequestToMobiXmlCall(String outPath, File file, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = file; + + // create path and map variables + String localVarPath = "/pdf/convert/mobixml"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (outPath != null) + localVarQueryParams.addAll(apiClient.parameterToPair("outPath", outPath)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call putPdfInRequestToMobiXmlValidateBeforeCall(String outPath, File file, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + // verify the required parameter 'outPath' is set + if (outPath == null) { + throw new ApiException("Missing the required parameter 'outPath' when calling putPdfInRequestToMobiXml(Async)"); + } + + + com.squareup.okhttp.Call call = putPdfInRequestToMobiXmlCall(outPath, file, progressListener, progressRequestListener); + return call; + + } + + /** + * Converts PDF document (in request content) to MOBIXML format and uploads resulting file to storage. + * + * @param outPath Full resulting filename (ex. /folder1/folder2/result.mobixml) (required) + * @param file A file to be converted. (optional) + * @return SaaSposeResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public SaaSposeResponse putPdfInRequestToMobiXml(String outPath, File file) throws ApiException { + ApiResponse resp = putPdfInRequestToMobiXmlWithHttpInfo(outPath, file); + return resp.getData(); + } + + /** + * Converts PDF document (in request content) to MOBIXML format and uploads resulting file to storage. + * + * @param outPath Full resulting filename (ex. /folder1/folder2/result.mobixml) (required) + * @param file A file to be converted. (optional) + * @return ApiResponse<SaaSposeResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse putPdfInRequestToMobiXmlWithHttpInfo(String outPath, File file) throws ApiException { + com.squareup.okhttp.Call call = putPdfInRequestToMobiXmlValidateBeforeCall(outPath, file, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Converts PDF document (in request content) to MOBIXML format and uploads resulting file to storage. (asynchronously) + * + * @param outPath Full resulting filename (ex. /folder1/folder2/result.mobixml) (required) + * @param file A file to be converted. (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call putPdfInRequestToMobiXmlAsync(String outPath, File file, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = putPdfInRequestToMobiXmlValidateBeforeCall(outPath, file, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for putPdfInRequestToPdfA + * @param outPath Full resulting filename (ex. /folder1/folder2/result.pdf) (required) + * @param type Type of PdfA format. (required) + * @param file A file to be converted. (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call putPdfInRequestToPdfACall(String outPath, String type, File file, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = file; + + // create path and map variables + String localVarPath = "/pdf/convert/pdfa"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (outPath != null) + localVarQueryParams.addAll(apiClient.parameterToPair("outPath", outPath)); + if (type != null) + localVarQueryParams.addAll(apiClient.parameterToPair("type", type)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call putPdfInRequestToPdfAValidateBeforeCall(String outPath, String type, File file, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + // verify the required parameter 'outPath' is set + if (outPath == null) { + throw new ApiException("Missing the required parameter 'outPath' when calling putPdfInRequestToPdfA(Async)"); + } + + // verify the required parameter 'type' is set + if (type == null) { + throw new ApiException("Missing the required parameter 'type' when calling putPdfInRequestToPdfA(Async)"); + } + + + com.squareup.okhttp.Call call = putPdfInRequestToPdfACall(outPath, type, file, progressListener, progressRequestListener); + return call; + + } + + /** + * Converts PDF document (in request content) to PdfA format and uploads resulting file to storage. + * + * @param outPath Full resulting filename (ex. /folder1/folder2/result.pdf) (required) + * @param type Type of PdfA format. (required) + * @param file A file to be converted. (optional) + * @return SaaSposeResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public SaaSposeResponse putPdfInRequestToPdfA(String outPath, String type, File file) throws ApiException { + ApiResponse resp = putPdfInRequestToPdfAWithHttpInfo(outPath, type, file); + return resp.getData(); + } + + /** + * Converts PDF document (in request content) to PdfA format and uploads resulting file to storage. + * + * @param outPath Full resulting filename (ex. /folder1/folder2/result.pdf) (required) + * @param type Type of PdfA format. (required) + * @param file A file to be converted. (optional) + * @return ApiResponse<SaaSposeResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse putPdfInRequestToPdfAWithHttpInfo(String outPath, String type, File file) throws ApiException { + com.squareup.okhttp.Call call = putPdfInRequestToPdfAValidateBeforeCall(outPath, type, file, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Converts PDF document (in request content) to PdfA format and uploads resulting file to storage. (asynchronously) + * + * @param outPath Full resulting filename (ex. /folder1/folder2/result.pdf) (required) + * @param type Type of PdfA format. (required) + * @param file A file to be converted. (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call putPdfInRequestToPdfAAsync(String outPath, String type, File file, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = putPdfInRequestToPdfAValidateBeforeCall(outPath, type, file, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for putPdfInRequestToPptx + * @param outPath Full resulting filename (ex. /folder1/folder2/result.pptx) (required) + * @param separateImages Separate images. (optional) + * @param slidesAsImages Slides as images. (optional) + * @param file A file to be converted. (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call putPdfInRequestToPptxCall(String outPath, Boolean separateImages, Boolean slidesAsImages, File file, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = file; + + // create path and map variables + String localVarPath = "/pdf/convert/pptx"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (outPath != null) + localVarQueryParams.addAll(apiClient.parameterToPair("outPath", outPath)); + if (separateImages != null) + localVarQueryParams.addAll(apiClient.parameterToPair("separateImages", separateImages)); + if (slidesAsImages != null) + localVarQueryParams.addAll(apiClient.parameterToPair("slidesAsImages", slidesAsImages)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call putPdfInRequestToPptxValidateBeforeCall(String outPath, Boolean separateImages, Boolean slidesAsImages, File file, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + // verify the required parameter 'outPath' is set + if (outPath == null) { + throw new ApiException("Missing the required parameter 'outPath' when calling putPdfInRequestToPptx(Async)"); + } + + + com.squareup.okhttp.Call call = putPdfInRequestToPptxCall(outPath, separateImages, slidesAsImages, file, progressListener, progressRequestListener); + return call; + + } + + /** + * Converts PDF document (in request content) to PPTX format and uploads resulting file to storage. + * + * @param outPath Full resulting filename (ex. /folder1/folder2/result.pptx) (required) + * @param separateImages Separate images. (optional) + * @param slidesAsImages Slides as images. (optional) + * @param file A file to be converted. (optional) + * @return SaaSposeResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public SaaSposeResponse putPdfInRequestToPptx(String outPath, Boolean separateImages, Boolean slidesAsImages, File file) throws ApiException { + ApiResponse resp = putPdfInRequestToPptxWithHttpInfo(outPath, separateImages, slidesAsImages, file); + return resp.getData(); + } + + /** + * Converts PDF document (in request content) to PPTX format and uploads resulting file to storage. + * + * @param outPath Full resulting filename (ex. /folder1/folder2/result.pptx) (required) + * @param separateImages Separate images. (optional) + * @param slidesAsImages Slides as images. (optional) + * @param file A file to be converted. (optional) + * @return ApiResponse<SaaSposeResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse putPdfInRequestToPptxWithHttpInfo(String outPath, Boolean separateImages, Boolean slidesAsImages, File file) throws ApiException { + com.squareup.okhttp.Call call = putPdfInRequestToPptxValidateBeforeCall(outPath, separateImages, slidesAsImages, file, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Converts PDF document (in request content) to PPTX format and uploads resulting file to storage. (asynchronously) + * + * @param outPath Full resulting filename (ex. /folder1/folder2/result.pptx) (required) + * @param separateImages Separate images. (optional) + * @param slidesAsImages Slides as images. (optional) + * @param file A file to be converted. (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call putPdfInRequestToPptxAsync(String outPath, Boolean separateImages, Boolean slidesAsImages, File file, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = putPdfInRequestToPptxValidateBeforeCall(outPath, separateImages, slidesAsImages, file, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for putPdfInRequestToSvg + * @param outPath Full resulting filename (ex. /folder1/folder2/result.svg) (required) + * @param compressOutputToZipArchive Specifies whether output will be created as one zip-archive. (optional) + * @param file A file to be converted. (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call putPdfInRequestToSvgCall(String outPath, Boolean compressOutputToZipArchive, File file, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = file; + + // create path and map variables + String localVarPath = "/pdf/convert/svg"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (outPath != null) + localVarQueryParams.addAll(apiClient.parameterToPair("outPath", outPath)); + if (compressOutputToZipArchive != null) + localVarQueryParams.addAll(apiClient.parameterToPair("compressOutputToZipArchive", compressOutputToZipArchive)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call putPdfInRequestToSvgValidateBeforeCall(String outPath, Boolean compressOutputToZipArchive, File file, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + // verify the required parameter 'outPath' is set + if (outPath == null) { + throw new ApiException("Missing the required parameter 'outPath' when calling putPdfInRequestToSvg(Async)"); + } + + + com.squareup.okhttp.Call call = putPdfInRequestToSvgCall(outPath, compressOutputToZipArchive, file, progressListener, progressRequestListener); + return call; + + } + + /** + * Converts PDF document (in request content) to SVG format and uploads resulting file to storage. + * + * @param outPath Full resulting filename (ex. /folder1/folder2/result.svg) (required) + * @param compressOutputToZipArchive Specifies whether output will be created as one zip-archive. (optional) + * @param file A file to be converted. (optional) + * @return SaaSposeResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public SaaSposeResponse putPdfInRequestToSvg(String outPath, Boolean compressOutputToZipArchive, File file) throws ApiException { + ApiResponse resp = putPdfInRequestToSvgWithHttpInfo(outPath, compressOutputToZipArchive, file); + return resp.getData(); + } + + /** + * Converts PDF document (in request content) to SVG format and uploads resulting file to storage. + * + * @param outPath Full resulting filename (ex. /folder1/folder2/result.svg) (required) + * @param compressOutputToZipArchive Specifies whether output will be created as one zip-archive. (optional) + * @param file A file to be converted. (optional) + * @return ApiResponse<SaaSposeResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse putPdfInRequestToSvgWithHttpInfo(String outPath, Boolean compressOutputToZipArchive, File file) throws ApiException { + com.squareup.okhttp.Call call = putPdfInRequestToSvgValidateBeforeCall(outPath, compressOutputToZipArchive, file, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Converts PDF document (in request content) to SVG format and uploads resulting file to storage. (asynchronously) + * + * @param outPath Full resulting filename (ex. /folder1/folder2/result.svg) (required) + * @param compressOutputToZipArchive Specifies whether output will be created as one zip-archive. (optional) + * @param file A file to be converted. (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call putPdfInRequestToSvgAsync(String outPath, Boolean compressOutputToZipArchive, File file, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = putPdfInRequestToSvgValidateBeforeCall(outPath, compressOutputToZipArchive, file, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for putPdfInRequestToTiff + * @param outPath Full resulting filename (ex. /folder1/folder2/result.tiff) (required) + * @param brightness Image brightness. (optional) + * @param compression Tiff compression. Possible values are: LZW, CCITT4, CCITT3, RLE, None. (optional) + * @param colorDepth Image color depth. Possible valuse are: Default, Format8bpp, Format4bpp, Format1bpp. (optional) + * @param leftMargin Left image margin. (optional) + * @param rightMargin Right image margin. (optional) + * @param topMargin Top image margin. (optional) + * @param bottomMargin Bottom image margin. (optional) + * @param orientation Image orientation. Possible values are: None, Landscape, Portait. (optional) + * @param skipBlankPages Skip blank pages flag. (optional) + * @param width Image width. (optional) + * @param height Image height. (optional) + * @param xResolution Horizontal resolution. (optional) + * @param yResolution Vertical resolution. (optional) + * @param pageIndex Start page to export. (optional) + * @param pageCount Number of pages to export. (optional) + * @param file A file to be converted. (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call putPdfInRequestToTiffCall(String outPath, Double brightness, String compression, String colorDepth, Integer leftMargin, Integer rightMargin, Integer topMargin, Integer bottomMargin, String orientation, Boolean skipBlankPages, Integer width, Integer height, Integer xResolution, Integer yResolution, Integer pageIndex, Integer pageCount, File file, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = file; + + // create path and map variables + String localVarPath = "/pdf/convert/tiff"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (outPath != null) + localVarQueryParams.addAll(apiClient.parameterToPair("outPath", outPath)); + if (brightness != null) + localVarQueryParams.addAll(apiClient.parameterToPair("brightness", brightness)); + if (compression != null) + localVarQueryParams.addAll(apiClient.parameterToPair("compression", compression)); + if (colorDepth != null) + localVarQueryParams.addAll(apiClient.parameterToPair("colorDepth", colorDepth)); + if (leftMargin != null) + localVarQueryParams.addAll(apiClient.parameterToPair("leftMargin", leftMargin)); + if (rightMargin != null) + localVarQueryParams.addAll(apiClient.parameterToPair("rightMargin", rightMargin)); + if (topMargin != null) + localVarQueryParams.addAll(apiClient.parameterToPair("topMargin", topMargin)); + if (bottomMargin != null) + localVarQueryParams.addAll(apiClient.parameterToPair("bottomMargin", bottomMargin)); + if (orientation != null) + localVarQueryParams.addAll(apiClient.parameterToPair("orientation", orientation)); + if (skipBlankPages != null) + localVarQueryParams.addAll(apiClient.parameterToPair("skipBlankPages", skipBlankPages)); + if (width != null) + localVarQueryParams.addAll(apiClient.parameterToPair("width", width)); + if (height != null) + localVarQueryParams.addAll(apiClient.parameterToPair("height", height)); + if (xResolution != null) + localVarQueryParams.addAll(apiClient.parameterToPair("xResolution", xResolution)); + if (yResolution != null) + localVarQueryParams.addAll(apiClient.parameterToPair("yResolution", yResolution)); + if (pageIndex != null) + localVarQueryParams.addAll(apiClient.parameterToPair("pageIndex", pageIndex)); + if (pageCount != null) + localVarQueryParams.addAll(apiClient.parameterToPair("pageCount", pageCount)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call putPdfInRequestToTiffValidateBeforeCall(String outPath, Double brightness, String compression, String colorDepth, Integer leftMargin, Integer rightMargin, Integer topMargin, Integer bottomMargin, String orientation, Boolean skipBlankPages, Integer width, Integer height, Integer xResolution, Integer yResolution, Integer pageIndex, Integer pageCount, File file, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + // verify the required parameter 'outPath' is set + if (outPath == null) { + throw new ApiException("Missing the required parameter 'outPath' when calling putPdfInRequestToTiff(Async)"); + } + + + com.squareup.okhttp.Call call = putPdfInRequestToTiffCall(outPath, brightness, compression, colorDepth, leftMargin, rightMargin, topMargin, bottomMargin, orientation, skipBlankPages, width, height, xResolution, yResolution, pageIndex, pageCount, file, progressListener, progressRequestListener); + return call; + + } + + /** + * Converts PDF document (in request content) to TIFF format and uploads resulting file to storage. + * + * @param outPath Full resulting filename (ex. /folder1/folder2/result.tiff) (required) + * @param brightness Image brightness. (optional) + * @param compression Tiff compression. Possible values are: LZW, CCITT4, CCITT3, RLE, None. (optional) + * @param colorDepth Image color depth. Possible valuse are: Default, Format8bpp, Format4bpp, Format1bpp. (optional) + * @param leftMargin Left image margin. (optional) + * @param rightMargin Right image margin. (optional) + * @param topMargin Top image margin. (optional) + * @param bottomMargin Bottom image margin. (optional) + * @param orientation Image orientation. Possible values are: None, Landscape, Portait. (optional) + * @param skipBlankPages Skip blank pages flag. (optional) + * @param width Image width. (optional) + * @param height Image height. (optional) + * @param xResolution Horizontal resolution. (optional) + * @param yResolution Vertical resolution. (optional) + * @param pageIndex Start page to export. (optional) + * @param pageCount Number of pages to export. (optional) + * @param file A file to be converted. (optional) + * @return SaaSposeResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public SaaSposeResponse putPdfInRequestToTiff(String outPath, Double brightness, String compression, String colorDepth, Integer leftMargin, Integer rightMargin, Integer topMargin, Integer bottomMargin, String orientation, Boolean skipBlankPages, Integer width, Integer height, Integer xResolution, Integer yResolution, Integer pageIndex, Integer pageCount, File file) throws ApiException { + ApiResponse resp = putPdfInRequestToTiffWithHttpInfo(outPath, brightness, compression, colorDepth, leftMargin, rightMargin, topMargin, bottomMargin, orientation, skipBlankPages, width, height, xResolution, yResolution, pageIndex, pageCount, file); + return resp.getData(); + } + + /** + * Converts PDF document (in request content) to TIFF format and uploads resulting file to storage. + * + * @param outPath Full resulting filename (ex. /folder1/folder2/result.tiff) (required) + * @param brightness Image brightness. (optional) + * @param compression Tiff compression. Possible values are: LZW, CCITT4, CCITT3, RLE, None. (optional) + * @param colorDepth Image color depth. Possible valuse are: Default, Format8bpp, Format4bpp, Format1bpp. (optional) + * @param leftMargin Left image margin. (optional) + * @param rightMargin Right image margin. (optional) + * @param topMargin Top image margin. (optional) + * @param bottomMargin Bottom image margin. (optional) + * @param orientation Image orientation. Possible values are: None, Landscape, Portait. (optional) + * @param skipBlankPages Skip blank pages flag. (optional) + * @param width Image width. (optional) + * @param height Image height. (optional) + * @param xResolution Horizontal resolution. (optional) + * @param yResolution Vertical resolution. (optional) + * @param pageIndex Start page to export. (optional) + * @param pageCount Number of pages to export. (optional) + * @param file A file to be converted. (optional) + * @return ApiResponse<SaaSposeResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse putPdfInRequestToTiffWithHttpInfo(String outPath, Double brightness, String compression, String colorDepth, Integer leftMargin, Integer rightMargin, Integer topMargin, Integer bottomMargin, String orientation, Boolean skipBlankPages, Integer width, Integer height, Integer xResolution, Integer yResolution, Integer pageIndex, Integer pageCount, File file) throws ApiException { + com.squareup.okhttp.Call call = putPdfInRequestToTiffValidateBeforeCall(outPath, brightness, compression, colorDepth, leftMargin, rightMargin, topMargin, bottomMargin, orientation, skipBlankPages, width, height, xResolution, yResolution, pageIndex, pageCount, file, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Converts PDF document (in request content) to TIFF format and uploads resulting file to storage. (asynchronously) + * + * @param outPath Full resulting filename (ex. /folder1/folder2/result.tiff) (required) + * @param brightness Image brightness. (optional) + * @param compression Tiff compression. Possible values are: LZW, CCITT4, CCITT3, RLE, None. (optional) + * @param colorDepth Image color depth. Possible valuse are: Default, Format8bpp, Format4bpp, Format1bpp. (optional) + * @param leftMargin Left image margin. (optional) + * @param rightMargin Right image margin. (optional) + * @param topMargin Top image margin. (optional) + * @param bottomMargin Bottom image margin. (optional) + * @param orientation Image orientation. Possible values are: None, Landscape, Portait. (optional) + * @param skipBlankPages Skip blank pages flag. (optional) + * @param width Image width. (optional) + * @param height Image height. (optional) + * @param xResolution Horizontal resolution. (optional) + * @param yResolution Vertical resolution. (optional) + * @param pageIndex Start page to export. (optional) + * @param pageCount Number of pages to export. (optional) + * @param file A file to be converted. (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call putPdfInRequestToTiffAsync(String outPath, Double brightness, String compression, String colorDepth, Integer leftMargin, Integer rightMargin, Integer topMargin, Integer bottomMargin, String orientation, Boolean skipBlankPages, Integer width, Integer height, Integer xResolution, Integer yResolution, Integer pageIndex, Integer pageCount, File file, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = putPdfInRequestToTiffValidateBeforeCall(outPath, brightness, compression, colorDepth, leftMargin, rightMargin, topMargin, bottomMargin, orientation, skipBlankPages, width, height, xResolution, yResolution, pageIndex, pageCount, file, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for putPdfInRequestToXls + * @param outPath Full resulting filename (ex. /folder1/folder2/result.xls) (required) + * @param insertBlankColumnAtFirst Insert blank column at first (optional) + * @param minimizeTheNumberOfWorksheets Minimize the number of worksheets (optional) + * @param scaleFactor Scale factor (optional) + * @param uniformWorksheets Uniform worksheets (optional) + * @param file A file to be converted. (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call putPdfInRequestToXlsCall(String outPath, Boolean insertBlankColumnAtFirst, Boolean minimizeTheNumberOfWorksheets, Double scaleFactor, Boolean uniformWorksheets, File file, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = file; + + // create path and map variables + String localVarPath = "/pdf/convert/xls"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (outPath != null) + localVarQueryParams.addAll(apiClient.parameterToPair("outPath", outPath)); + if (insertBlankColumnAtFirst != null) + localVarQueryParams.addAll(apiClient.parameterToPair("insertBlankColumnAtFirst", insertBlankColumnAtFirst)); + if (minimizeTheNumberOfWorksheets != null) + localVarQueryParams.addAll(apiClient.parameterToPair("minimizeTheNumberOfWorksheets", minimizeTheNumberOfWorksheets)); + if (scaleFactor != null) + localVarQueryParams.addAll(apiClient.parameterToPair("scaleFactor", scaleFactor)); + if (uniformWorksheets != null) + localVarQueryParams.addAll(apiClient.parameterToPair("uniformWorksheets", uniformWorksheets)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call putPdfInRequestToXlsValidateBeforeCall(String outPath, Boolean insertBlankColumnAtFirst, Boolean minimizeTheNumberOfWorksheets, Double scaleFactor, Boolean uniformWorksheets, File file, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + // verify the required parameter 'outPath' is set + if (outPath == null) { + throw new ApiException("Missing the required parameter 'outPath' when calling putPdfInRequestToXls(Async)"); + } + + + com.squareup.okhttp.Call call = putPdfInRequestToXlsCall(outPath, insertBlankColumnAtFirst, minimizeTheNumberOfWorksheets, scaleFactor, uniformWorksheets, file, progressListener, progressRequestListener); + return call; + + } + + /** + * Converts PDF document (in request content) to XLS format and uploads resulting file to storage. + * + * @param outPath Full resulting filename (ex. /folder1/folder2/result.xls) (required) + * @param insertBlankColumnAtFirst Insert blank column at first (optional) + * @param minimizeTheNumberOfWorksheets Minimize the number of worksheets (optional) + * @param scaleFactor Scale factor (optional) + * @param uniformWorksheets Uniform worksheets (optional) + * @param file A file to be converted. (optional) + * @return SaaSposeResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public SaaSposeResponse putPdfInRequestToXls(String outPath, Boolean insertBlankColumnAtFirst, Boolean minimizeTheNumberOfWorksheets, Double scaleFactor, Boolean uniformWorksheets, File file) throws ApiException { + ApiResponse resp = putPdfInRequestToXlsWithHttpInfo(outPath, insertBlankColumnAtFirst, minimizeTheNumberOfWorksheets, scaleFactor, uniformWorksheets, file); + return resp.getData(); + } + + /** + * Converts PDF document (in request content) to XLS format and uploads resulting file to storage. + * + * @param outPath Full resulting filename (ex. /folder1/folder2/result.xls) (required) + * @param insertBlankColumnAtFirst Insert blank column at first (optional) + * @param minimizeTheNumberOfWorksheets Minimize the number of worksheets (optional) + * @param scaleFactor Scale factor (optional) + * @param uniformWorksheets Uniform worksheets (optional) + * @param file A file to be converted. (optional) + * @return ApiResponse<SaaSposeResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse putPdfInRequestToXlsWithHttpInfo(String outPath, Boolean insertBlankColumnAtFirst, Boolean minimizeTheNumberOfWorksheets, Double scaleFactor, Boolean uniformWorksheets, File file) throws ApiException { + com.squareup.okhttp.Call call = putPdfInRequestToXlsValidateBeforeCall(outPath, insertBlankColumnAtFirst, minimizeTheNumberOfWorksheets, scaleFactor, uniformWorksheets, file, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Converts PDF document (in request content) to XLS format and uploads resulting file to storage. (asynchronously) + * + * @param outPath Full resulting filename (ex. /folder1/folder2/result.xls) (required) + * @param insertBlankColumnAtFirst Insert blank column at first (optional) + * @param minimizeTheNumberOfWorksheets Minimize the number of worksheets (optional) + * @param scaleFactor Scale factor (optional) + * @param uniformWorksheets Uniform worksheets (optional) + * @param file A file to be converted. (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call putPdfInRequestToXlsAsync(String outPath, Boolean insertBlankColumnAtFirst, Boolean minimizeTheNumberOfWorksheets, Double scaleFactor, Boolean uniformWorksheets, File file, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = putPdfInRequestToXlsValidateBeforeCall(outPath, insertBlankColumnAtFirst, minimizeTheNumberOfWorksheets, scaleFactor, uniformWorksheets, file, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for putPdfInRequestToXml + * @param outPath Full resulting filename (ex. /folder1/folder2/result.xml) (required) + * @param file A file to be converted. (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call putPdfInRequestToXmlCall(String outPath, File file, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = file; + + // create path and map variables + String localVarPath = "/pdf/convert/xml"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (outPath != null) + localVarQueryParams.addAll(apiClient.parameterToPair("outPath", outPath)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call putPdfInRequestToXmlValidateBeforeCall(String outPath, File file, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + // verify the required parameter 'outPath' is set + if (outPath == null) { + throw new ApiException("Missing the required parameter 'outPath' when calling putPdfInRequestToXml(Async)"); + } + + + com.squareup.okhttp.Call call = putPdfInRequestToXmlCall(outPath, file, progressListener, progressRequestListener); + return call; + + } + + /** + * Converts PDF document (in request content) to XML format and uploads resulting file to storage. + * + * @param outPath Full resulting filename (ex. /folder1/folder2/result.xml) (required) + * @param file A file to be converted. (optional) + * @return SaaSposeResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public SaaSposeResponse putPdfInRequestToXml(String outPath, File file) throws ApiException { + ApiResponse resp = putPdfInRequestToXmlWithHttpInfo(outPath, file); + return resp.getData(); + } + + /** + * Converts PDF document (in request content) to XML format and uploads resulting file to storage. + * + * @param outPath Full resulting filename (ex. /folder1/folder2/result.xml) (required) + * @param file A file to be converted. (optional) + * @return ApiResponse<SaaSposeResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse putPdfInRequestToXmlWithHttpInfo(String outPath, File file) throws ApiException { + com.squareup.okhttp.Call call = putPdfInRequestToXmlValidateBeforeCall(outPath, file, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Converts PDF document (in request content) to XML format and uploads resulting file to storage. (asynchronously) + * + * @param outPath Full resulting filename (ex. /folder1/folder2/result.xml) (required) + * @param file A file to be converted. (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call putPdfInRequestToXmlAsync(String outPath, File file, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = putPdfInRequestToXmlValidateBeforeCall(outPath, file, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for putPdfInRequestToXps + * @param outPath Full resulting filename (ex. /folder1/folder2/result.xps) (required) + * @param file A file to be converted. (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call putPdfInRequestToXpsCall(String outPath, File file, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = file; + + // create path and map variables + String localVarPath = "/pdf/convert/xps"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (outPath != null) + localVarQueryParams.addAll(apiClient.parameterToPair("outPath", outPath)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call putPdfInRequestToXpsValidateBeforeCall(String outPath, File file, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + // verify the required parameter 'outPath' is set + if (outPath == null) { + throw new ApiException("Missing the required parameter 'outPath' when calling putPdfInRequestToXps(Async)"); + } + + + com.squareup.okhttp.Call call = putPdfInRequestToXpsCall(outPath, file, progressListener, progressRequestListener); + return call; + + } + + /** + * Converts PDF document (in request content) to XPS format and uploads resulting file to storage. + * + * @param outPath Full resulting filename (ex. /folder1/folder2/result.xps) (required) + * @param file A file to be converted. (optional) + * @return SaaSposeResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public SaaSposeResponse putPdfInRequestToXps(String outPath, File file) throws ApiException { + ApiResponse resp = putPdfInRequestToXpsWithHttpInfo(outPath, file); + return resp.getData(); + } + + /** + * Converts PDF document (in request content) to XPS format and uploads resulting file to storage. + * + * @param outPath Full resulting filename (ex. /folder1/folder2/result.xps) (required) + * @param file A file to be converted. (optional) + * @return ApiResponse<SaaSposeResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse putPdfInRequestToXpsWithHttpInfo(String outPath, File file) throws ApiException { + com.squareup.okhttp.Call call = putPdfInRequestToXpsValidateBeforeCall(outPath, file, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Converts PDF document (in request content) to XPS format and uploads resulting file to storage. (asynchronously) + * + * @param outPath Full resulting filename (ex. /folder1/folder2/result.xps) (required) + * @param file A file to be converted. (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call putPdfInRequestToXpsAsync(String outPath, File file, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = putPdfInRequestToXpsValidateBeforeCall(outPath, file, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for putPdfInStorageToDoc + * @param name The document name. (required) + * @param outPath Full resulting filename (ex. /folder1/folder2/result.doc) (required) + * @param addReturnToLineEnd Add return to line end. (optional) + * @param format Allows to specify .doc or .docx file format. (optional) + * @param imageResolutionX Image resolution X. (optional) + * @param imageResolutionY Image resolution Y. (optional) + * @param maxDistanceBetweenTextLines Max distance between text lines. (optional) + * @param mode Allows to control how a PDF document is converted into a word processing document. (optional) + * @param recognizeBullets Recognize bullets. (optional) + * @param relativeHorizontalProximity Relative horizontal proximity. (optional) + * @param folder The document folder. (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call putPdfInStorageToDocCall(String name, String outPath, Boolean addReturnToLineEnd, String format, Integer imageResolutionX, Integer imageResolutionY, Integer maxDistanceBetweenTextLines, String mode, Boolean recognizeBullets, Double relativeHorizontalProximity, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/pdf/{name}/convert/doc" + .replaceAll("\\{" + "name" + "\\}", apiClient.escapeString(name.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (outPath != null) + localVarQueryParams.addAll(apiClient.parameterToPair("outPath", outPath)); + if (addReturnToLineEnd != null) + localVarQueryParams.addAll(apiClient.parameterToPair("addReturnToLineEnd", addReturnToLineEnd)); + if (format != null) + localVarQueryParams.addAll(apiClient.parameterToPair("format", format)); + if (imageResolutionX != null) + localVarQueryParams.addAll(apiClient.parameterToPair("imageResolutionX", imageResolutionX)); + if (imageResolutionY != null) + localVarQueryParams.addAll(apiClient.parameterToPair("imageResolutionY", imageResolutionY)); + if (maxDistanceBetweenTextLines != null) + localVarQueryParams.addAll(apiClient.parameterToPair("maxDistanceBetweenTextLines", maxDistanceBetweenTextLines)); + if (mode != null) + localVarQueryParams.addAll(apiClient.parameterToPair("mode", mode)); + if (recognizeBullets != null) + localVarQueryParams.addAll(apiClient.parameterToPair("recognizeBullets", recognizeBullets)); + if (relativeHorizontalProximity != null) + localVarQueryParams.addAll(apiClient.parameterToPair("relativeHorizontalProximity", relativeHorizontalProximity)); + if (folder != null) + localVarQueryParams.addAll(apiClient.parameterToPair("folder", folder)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call putPdfInStorageToDocValidateBeforeCall(String name, String outPath, Boolean addReturnToLineEnd, String format, Integer imageResolutionX, Integer imageResolutionY, Integer maxDistanceBetweenTextLines, String mode, Boolean recognizeBullets, Double relativeHorizontalProximity, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException("Missing the required parameter 'name' when calling putPdfInStorageToDoc(Async)"); + } + + // verify the required parameter 'outPath' is set + if (outPath == null) { + throw new ApiException("Missing the required parameter 'outPath' when calling putPdfInStorageToDoc(Async)"); + } + + + com.squareup.okhttp.Call call = putPdfInStorageToDocCall(name, outPath, addReturnToLineEnd, format, imageResolutionX, imageResolutionY, maxDistanceBetweenTextLines, mode, recognizeBullets, relativeHorizontalProximity, folder, progressListener, progressRequestListener); + return call; + + } + + /** + * Converts PDF document (located on storage) to DOC format and uploads resulting file to storage + * + * @param name The document name. (required) + * @param outPath Full resulting filename (ex. /folder1/folder2/result.doc) (required) + * @param addReturnToLineEnd Add return to line end. (optional) + * @param format Allows to specify .doc or .docx file format. (optional) + * @param imageResolutionX Image resolution X. (optional) + * @param imageResolutionY Image resolution Y. (optional) + * @param maxDistanceBetweenTextLines Max distance between text lines. (optional) + * @param mode Allows to control how a PDF document is converted into a word processing document. (optional) + * @param recognizeBullets Recognize bullets. (optional) + * @param relativeHorizontalProximity Relative horizontal proximity. (optional) + * @param folder The document folder. (optional) + * @return SaaSposeResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public SaaSposeResponse putPdfInStorageToDoc(String name, String outPath, Boolean addReturnToLineEnd, String format, Integer imageResolutionX, Integer imageResolutionY, Integer maxDistanceBetweenTextLines, String mode, Boolean recognizeBullets, Double relativeHorizontalProximity, String folder) throws ApiException { + ApiResponse resp = putPdfInStorageToDocWithHttpInfo(name, outPath, addReturnToLineEnd, format, imageResolutionX, imageResolutionY, maxDistanceBetweenTextLines, mode, recognizeBullets, relativeHorizontalProximity, folder); + return resp.getData(); + } + + /** + * Converts PDF document (located on storage) to DOC format and uploads resulting file to storage + * + * @param name The document name. (required) + * @param outPath Full resulting filename (ex. /folder1/folder2/result.doc) (required) + * @param addReturnToLineEnd Add return to line end. (optional) + * @param format Allows to specify .doc or .docx file format. (optional) + * @param imageResolutionX Image resolution X. (optional) + * @param imageResolutionY Image resolution Y. (optional) + * @param maxDistanceBetweenTextLines Max distance between text lines. (optional) + * @param mode Allows to control how a PDF document is converted into a word processing document. (optional) + * @param recognizeBullets Recognize bullets. (optional) + * @param relativeHorizontalProximity Relative horizontal proximity. (optional) + * @param folder The document folder. (optional) + * @return ApiResponse<SaaSposeResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse putPdfInStorageToDocWithHttpInfo(String name, String outPath, Boolean addReturnToLineEnd, String format, Integer imageResolutionX, Integer imageResolutionY, Integer maxDistanceBetweenTextLines, String mode, Boolean recognizeBullets, Double relativeHorizontalProximity, String folder) throws ApiException { + com.squareup.okhttp.Call call = putPdfInStorageToDocValidateBeforeCall(name, outPath, addReturnToLineEnd, format, imageResolutionX, imageResolutionY, maxDistanceBetweenTextLines, mode, recognizeBullets, relativeHorizontalProximity, folder, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Converts PDF document (located on storage) to DOC format and uploads resulting file to storage (asynchronously) + * + * @param name The document name. (required) + * @param outPath Full resulting filename (ex. /folder1/folder2/result.doc) (required) + * @param addReturnToLineEnd Add return to line end. (optional) + * @param format Allows to specify .doc or .docx file format. (optional) + * @param imageResolutionX Image resolution X. (optional) + * @param imageResolutionY Image resolution Y. (optional) + * @param maxDistanceBetweenTextLines Max distance between text lines. (optional) + * @param mode Allows to control how a PDF document is converted into a word processing document. (optional) + * @param recognizeBullets Recognize bullets. (optional) + * @param relativeHorizontalProximity Relative horizontal proximity. (optional) + * @param folder The document folder. (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call putPdfInStorageToDocAsync(String name, String outPath, Boolean addReturnToLineEnd, String format, Integer imageResolutionX, Integer imageResolutionY, Integer maxDistanceBetweenTextLines, String mode, Boolean recognizeBullets, Double relativeHorizontalProximity, String folder, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = putPdfInStorageToDocValidateBeforeCall(name, outPath, addReturnToLineEnd, format, imageResolutionX, imageResolutionY, maxDistanceBetweenTextLines, mode, recognizeBullets, relativeHorizontalProximity, folder, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for putPdfInStorageToEpub + * @param name The document name. (required) + * @param outPath Full resulting filename (ex. /folder1/folder2/result.epub) (required) + * @param contentRecognitionMode Рroperty tunes conversion for this or that desirable method of recognition of content. (optional) + * @param folder The document folder. (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call putPdfInStorageToEpubCall(String name, String outPath, String contentRecognitionMode, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/pdf/{name}/convert/epub" + .replaceAll("\\{" + "name" + "\\}", apiClient.escapeString(name.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (outPath != null) + localVarQueryParams.addAll(apiClient.parameterToPair("outPath", outPath)); + if (contentRecognitionMode != null) + localVarQueryParams.addAll(apiClient.parameterToPair("contentRecognitionMode", contentRecognitionMode)); + if (folder != null) + localVarQueryParams.addAll(apiClient.parameterToPair("folder", folder)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call putPdfInStorageToEpubValidateBeforeCall(String name, String outPath, String contentRecognitionMode, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException("Missing the required parameter 'name' when calling putPdfInStorageToEpub(Async)"); + } + + // verify the required parameter 'outPath' is set + if (outPath == null) { + throw new ApiException("Missing the required parameter 'outPath' when calling putPdfInStorageToEpub(Async)"); + } + + + com.squareup.okhttp.Call call = putPdfInStorageToEpubCall(name, outPath, contentRecognitionMode, folder, progressListener, progressRequestListener); + return call; + + } + + /** + * Converts PDF document (located on storage) to EPUB format and uploads resulting file to storage + * + * @param name The document name. (required) + * @param outPath Full resulting filename (ex. /folder1/folder2/result.epub) (required) + * @param contentRecognitionMode Рroperty tunes conversion for this or that desirable method of recognition of content. (optional) + * @param folder The document folder. (optional) + * @return SaaSposeResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public SaaSposeResponse putPdfInStorageToEpub(String name, String outPath, String contentRecognitionMode, String folder) throws ApiException { + ApiResponse resp = putPdfInStorageToEpubWithHttpInfo(name, outPath, contentRecognitionMode, folder); + return resp.getData(); + } + + /** + * Converts PDF document (located on storage) to EPUB format and uploads resulting file to storage + * + * @param name The document name. (required) + * @param outPath Full resulting filename (ex. /folder1/folder2/result.epub) (required) + * @param contentRecognitionMode Рroperty tunes conversion for this or that desirable method of recognition of content. (optional) + * @param folder The document folder. (optional) + * @return ApiResponse<SaaSposeResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse putPdfInStorageToEpubWithHttpInfo(String name, String outPath, String contentRecognitionMode, String folder) throws ApiException { + com.squareup.okhttp.Call call = putPdfInStorageToEpubValidateBeforeCall(name, outPath, contentRecognitionMode, folder, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Converts PDF document (located on storage) to EPUB format and uploads resulting file to storage (asynchronously) + * + * @param name The document name. (required) + * @param outPath Full resulting filename (ex. /folder1/folder2/result.epub) (required) + * @param contentRecognitionMode Рroperty tunes conversion for this or that desirable method of recognition of content. (optional) + * @param folder The document folder. (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call putPdfInStorageToEpubAsync(String name, String outPath, String contentRecognitionMode, String folder, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = putPdfInStorageToEpubValidateBeforeCall(name, outPath, contentRecognitionMode, folder, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for putPdfInStorageToHtml + * @param name The document name. (required) + * @param outPath Full resulting filename (ex. /folder1/folder2/result.html) (required) + * @param additionalMarginWidthInPoints Defines width of margin that will be forcibly left around that output HTML-areas. (optional) + * @param compressSvgGraphicsIfAny The flag that indicates whether found SVG graphics(if any) will be compressed(zipped) into SVGZ format during saving. (optional) + * @param convertMarkedContentToLayers If attribute ConvertMarkedContentToLayers set to true then an all elements inside a PDF marked content (layer) will be put into an HTML div with \"data-pdflayer\" attribute specifying a layer name. This layer name will be extracted from optional properties of PDF marked content. If this attribute is false (by default) then no any layers will be created from PDF marked content. (optional) + * @param defaultFontName Specifies the name of an installed font which is used to substitute any document font that is not embedded and not installed in the system. If null then default substitution font is used. (optional) + * @param documentType Result document type. (optional) + * @param fixedLayout The value indicating whether that HTML is created as fixed layout. (optional) + * @param imageResolution Resolution for image rendering. (optional) + * @param minimalLineWidth This attribute sets minimal width of graphic path line. If thickness of line is less than 1px Adobe Acrobat rounds it to this value. So this attribute can be used to emulate this behavior for HTML browsers. (optional) + * @param preventGlyphsGrouping This attribute switch on the mode when text glyphs will not be grouped into words and strings This mode allows to keep maximum precision during positioning of glyphs on the page and it can be used for conversion documents with music notes or glyphs that should be placed separately each other. This parameter will be applied to document only when the value of FixedLayout attribute is true. (optional) + * @param splitCssIntoPages When multipage-mode selected(i.e 'SplitIntoPages' is 'true'), then this attribute defines whether should be created separate CSS-file for each result HTML page. (optional) + * @param splitIntoPages The flag that indicates whether each page of source document will be converted into it's own target HTML document, i.e whether result HTML will be splitted into several HTML-pages. (optional) + * @param useZOrder If attribute UseZORder set to true, graphics and text are added to resultant HTML document accordingly Z-order in original PDF document. If this attribute is false all graphics is put as single layer which may cause some unnecessary effects for overlapped objects. (optional) + * @param antialiasingProcessing The parameter defines required antialiasing measures during conversion of compound background images from PDF to HTML. (optional) + * @param cssClassNamesPrefix When PDFtoHTML converter generates result CSSs, CSS class names (something like \".stl_01 {}\" ... \".stl_NN {}) are generated and used in result CSS. This property allows forcibly set class name prefix. (optional) + * @param explicitListOfSavedPages With this property You can explicitely define what pages of document should be converted. Pages in this list must have 1-based numbers. I.e. valid numbers of pages must be taken from range (1...[NumberOfPagesInConvertedDocument]) Order of appearing of pages in this list does not affect their order in result HTML page(s) - in result pages allways will go in order in which they are present in source PDF. (optional) + * @param fontEncodingStrategy Defines encoding special rule to tune PDF decoding for current document. (optional) + * @param fontSavingMode Defines font saving mode that will be used during saving of PDF to desirable format. (optional) + * @param htmlMarkupGenerationMode Sometimes specific reqirments to generation of HTML markup are present. This parameter defines HTML preparing modes that can be used during conversion of PDF to HTML to match such specific requirments. (optional) + * @param lettersPositioningMethod The mode of positioning of letters in words in result HTML. (optional) + * @param pagesFlowTypeDependsOnViewersScreenSize If attribute 'SplitOnPages=false', than whole HTML representing all input PDF pages will be put into one big result HTML file. This flag defines whether result HTML will be generated in such way that flow of areas that represent PDF pages in result HTML will depend on screen resolution of viewer. (optional) + * @param partsEmbeddingMode It defines whether referenced files (HTML, Fonts,Images, CSSes) will be embedded into main HTML file or will be generated as apart binary entities. (optional) + * @param rasterImagesSavingMode Converted PDF can contain raster images This parameter defines how they should be handled during conversion of PDF to HTML. (optional) + * @param removeEmptyAreasOnTopAndBottom Defines whether in created HTML will be removed top and bottom empty area without any content (if any). (optional) + * @param saveShadowedTextsAsTransparentTexts Pdf can contain texts that are shadowed by another elements (f.e. by images) but can be selected to clipboard in Acrobat Reader (usually it happen when document contains images and OCRed texts extracted from it). This settings tells to converter whether we need save such texts as transparent selectable texts in result HTML to mimic behaviour of Acrobat Reader (othervise such texts are usually saved as hidden, not available for copying to clipboard). (optional) + * @param saveTransparentTexts Pdf can contain transparent texts that can be selected to clipboard (usually it happen when document contains images and OCRed texts extracted from it). This settings tells to converter whether we need save such texts as transparent selectable texts in result HTML. (optional) + * @param specialFolderForAllImages The path to directory to which must be saved any images if they are encountered during saving of document as HTML. If parameter is empty or null then image files(if any) wil be saved together with other files linked to HTML It does not affect anything if CustomImageSavingStrategy property was successfully used to process relevant image file. (optional) + * @param specialFolderForSvgImages The path to directory to which must be saved only SVG-images if they are encountered during saving of document as HTML. If parameter is empty or null then SVG files(if any) wil be saved together with other image-files (near to output file) or in special folder for images (if it specified in SpecialImagesFolderIfAny option). It does not affect anything if CustomImageSavingStrategy property was successfully used to process relevant image file. (optional) + * @param trySaveTextUnderliningAndStrikeoutingInCss PDF itself does not contain underlining markers for texts. It emulated with line situated under text. This option allows converter try guess that this or that line is a text's underlining and put this info into CSS instead of drawing of underlining graphically. (optional) + * @param folder The document folder. (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call putPdfInStorageToHtmlCall(String name, String outPath, Integer additionalMarginWidthInPoints, Boolean compressSvgGraphicsIfAny, Boolean convertMarkedContentToLayers, String defaultFontName, String documentType, Boolean fixedLayout, Integer imageResolution, Integer minimalLineWidth, Boolean preventGlyphsGrouping, Boolean splitCssIntoPages, Boolean splitIntoPages, Boolean useZOrder, String antialiasingProcessing, String cssClassNamesPrefix, List explicitListOfSavedPages, String fontEncodingStrategy, String fontSavingMode, String htmlMarkupGenerationMode, String lettersPositioningMethod, Boolean pagesFlowTypeDependsOnViewersScreenSize, String partsEmbeddingMode, String rasterImagesSavingMode, Boolean removeEmptyAreasOnTopAndBottom, Boolean saveShadowedTextsAsTransparentTexts, Boolean saveTransparentTexts, String specialFolderForAllImages, String specialFolderForSvgImages, Boolean trySaveTextUnderliningAndStrikeoutingInCss, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/pdf/{name}/convert/html" + .replaceAll("\\{" + "name" + "\\}", apiClient.escapeString(name.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (outPath != null) + localVarQueryParams.addAll(apiClient.parameterToPair("outPath", outPath)); + if (additionalMarginWidthInPoints != null) + localVarQueryParams.addAll(apiClient.parameterToPair("additionalMarginWidthInPoints", additionalMarginWidthInPoints)); + if (compressSvgGraphicsIfAny != null) + localVarQueryParams.addAll(apiClient.parameterToPair("compressSvgGraphicsIfAny", compressSvgGraphicsIfAny)); + if (convertMarkedContentToLayers != null) + localVarQueryParams.addAll(apiClient.parameterToPair("convertMarkedContentToLayers", convertMarkedContentToLayers)); + if (defaultFontName != null) + localVarQueryParams.addAll(apiClient.parameterToPair("defaultFontName", defaultFontName)); + if (documentType != null) + localVarQueryParams.addAll(apiClient.parameterToPair("documentType", documentType)); + if (fixedLayout != null) + localVarQueryParams.addAll(apiClient.parameterToPair("fixedLayout", fixedLayout)); + if (imageResolution != null) + localVarQueryParams.addAll(apiClient.parameterToPair("imageResolution", imageResolution)); + if (minimalLineWidth != null) + localVarQueryParams.addAll(apiClient.parameterToPair("minimalLineWidth", minimalLineWidth)); + if (preventGlyphsGrouping != null) + localVarQueryParams.addAll(apiClient.parameterToPair("preventGlyphsGrouping", preventGlyphsGrouping)); + if (splitCssIntoPages != null) + localVarQueryParams.addAll(apiClient.parameterToPair("splitCssIntoPages", splitCssIntoPages)); + if (splitIntoPages != null) + localVarQueryParams.addAll(apiClient.parameterToPair("splitIntoPages", splitIntoPages)); + if (useZOrder != null) + localVarQueryParams.addAll(apiClient.parameterToPair("useZOrder", useZOrder)); + if (antialiasingProcessing != null) + localVarQueryParams.addAll(apiClient.parameterToPair("antialiasingProcessing", antialiasingProcessing)); + if (cssClassNamesPrefix != null) + localVarQueryParams.addAll(apiClient.parameterToPair("cssClassNamesPrefix", cssClassNamesPrefix)); + if (explicitListOfSavedPages != null) + localVarCollectionQueryParams.addAll(apiClient.parameterToPairs("multi", "explicitListOfSavedPages", explicitListOfSavedPages)); + if (fontEncodingStrategy != null) + localVarQueryParams.addAll(apiClient.parameterToPair("fontEncodingStrategy", fontEncodingStrategy)); + if (fontSavingMode != null) + localVarQueryParams.addAll(apiClient.parameterToPair("fontSavingMode", fontSavingMode)); + if (htmlMarkupGenerationMode != null) + localVarQueryParams.addAll(apiClient.parameterToPair("htmlMarkupGenerationMode", htmlMarkupGenerationMode)); + if (lettersPositioningMethod != null) + localVarQueryParams.addAll(apiClient.parameterToPair("lettersPositioningMethod", lettersPositioningMethod)); + if (pagesFlowTypeDependsOnViewersScreenSize != null) + localVarQueryParams.addAll(apiClient.parameterToPair("pagesFlowTypeDependsOnViewersScreenSize", pagesFlowTypeDependsOnViewersScreenSize)); + if (partsEmbeddingMode != null) + localVarQueryParams.addAll(apiClient.parameterToPair("partsEmbeddingMode", partsEmbeddingMode)); + if (rasterImagesSavingMode != null) + localVarQueryParams.addAll(apiClient.parameterToPair("rasterImagesSavingMode", rasterImagesSavingMode)); + if (removeEmptyAreasOnTopAndBottom != null) + localVarQueryParams.addAll(apiClient.parameterToPair("removeEmptyAreasOnTopAndBottom", removeEmptyAreasOnTopAndBottom)); + if (saveShadowedTextsAsTransparentTexts != null) + localVarQueryParams.addAll(apiClient.parameterToPair("saveShadowedTextsAsTransparentTexts", saveShadowedTextsAsTransparentTexts)); + if (saveTransparentTexts != null) + localVarQueryParams.addAll(apiClient.parameterToPair("saveTransparentTexts", saveTransparentTexts)); + if (specialFolderForAllImages != null) + localVarQueryParams.addAll(apiClient.parameterToPair("specialFolderForAllImages", specialFolderForAllImages)); + if (specialFolderForSvgImages != null) + localVarQueryParams.addAll(apiClient.parameterToPair("specialFolderForSvgImages", specialFolderForSvgImages)); + if (trySaveTextUnderliningAndStrikeoutingInCss != null) + localVarQueryParams.addAll(apiClient.parameterToPair("trySaveTextUnderliningAndStrikeoutingInCss", trySaveTextUnderliningAndStrikeoutingInCss)); + if (folder != null) + localVarQueryParams.addAll(apiClient.parameterToPair("folder", folder)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call putPdfInStorageToHtmlValidateBeforeCall(String name, String outPath, Integer additionalMarginWidthInPoints, Boolean compressSvgGraphicsIfAny, Boolean convertMarkedContentToLayers, String defaultFontName, String documentType, Boolean fixedLayout, Integer imageResolution, Integer minimalLineWidth, Boolean preventGlyphsGrouping, Boolean splitCssIntoPages, Boolean splitIntoPages, Boolean useZOrder, String antialiasingProcessing, String cssClassNamesPrefix, List explicitListOfSavedPages, String fontEncodingStrategy, String fontSavingMode, String htmlMarkupGenerationMode, String lettersPositioningMethod, Boolean pagesFlowTypeDependsOnViewersScreenSize, String partsEmbeddingMode, String rasterImagesSavingMode, Boolean removeEmptyAreasOnTopAndBottom, Boolean saveShadowedTextsAsTransparentTexts, Boolean saveTransparentTexts, String specialFolderForAllImages, String specialFolderForSvgImages, Boolean trySaveTextUnderliningAndStrikeoutingInCss, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException("Missing the required parameter 'name' when calling putPdfInStorageToHtml(Async)"); + } + + // verify the required parameter 'outPath' is set + if (outPath == null) { + throw new ApiException("Missing the required parameter 'outPath' when calling putPdfInStorageToHtml(Async)"); + } + + + com.squareup.okhttp.Call call = putPdfInStorageToHtmlCall(name, outPath, additionalMarginWidthInPoints, compressSvgGraphicsIfAny, convertMarkedContentToLayers, defaultFontName, documentType, fixedLayout, imageResolution, minimalLineWidth, preventGlyphsGrouping, splitCssIntoPages, splitIntoPages, useZOrder, antialiasingProcessing, cssClassNamesPrefix, explicitListOfSavedPages, fontEncodingStrategy, fontSavingMode, htmlMarkupGenerationMode, lettersPositioningMethod, pagesFlowTypeDependsOnViewersScreenSize, partsEmbeddingMode, rasterImagesSavingMode, removeEmptyAreasOnTopAndBottom, saveShadowedTextsAsTransparentTexts, saveTransparentTexts, specialFolderForAllImages, specialFolderForSvgImages, trySaveTextUnderliningAndStrikeoutingInCss, folder, progressListener, progressRequestListener); + return call; + + } + + /** + * Converts PDF document (located on storage) to Html format and uploads resulting file to storage + * + * @param name The document name. (required) + * @param outPath Full resulting filename (ex. /folder1/folder2/result.html) (required) + * @param additionalMarginWidthInPoints Defines width of margin that will be forcibly left around that output HTML-areas. (optional) + * @param compressSvgGraphicsIfAny The flag that indicates whether found SVG graphics(if any) will be compressed(zipped) into SVGZ format during saving. (optional) + * @param convertMarkedContentToLayers If attribute ConvertMarkedContentToLayers set to true then an all elements inside a PDF marked content (layer) will be put into an HTML div with \"data-pdflayer\" attribute specifying a layer name. This layer name will be extracted from optional properties of PDF marked content. If this attribute is false (by default) then no any layers will be created from PDF marked content. (optional) + * @param defaultFontName Specifies the name of an installed font which is used to substitute any document font that is not embedded and not installed in the system. If null then default substitution font is used. (optional) + * @param documentType Result document type. (optional) + * @param fixedLayout The value indicating whether that HTML is created as fixed layout. (optional) + * @param imageResolution Resolution for image rendering. (optional) + * @param minimalLineWidth This attribute sets minimal width of graphic path line. If thickness of line is less than 1px Adobe Acrobat rounds it to this value. So this attribute can be used to emulate this behavior for HTML browsers. (optional) + * @param preventGlyphsGrouping This attribute switch on the mode when text glyphs will not be grouped into words and strings This mode allows to keep maximum precision during positioning of glyphs on the page and it can be used for conversion documents with music notes or glyphs that should be placed separately each other. This parameter will be applied to document only when the value of FixedLayout attribute is true. (optional) + * @param splitCssIntoPages When multipage-mode selected(i.e 'SplitIntoPages' is 'true'), then this attribute defines whether should be created separate CSS-file for each result HTML page. (optional) + * @param splitIntoPages The flag that indicates whether each page of source document will be converted into it's own target HTML document, i.e whether result HTML will be splitted into several HTML-pages. (optional) + * @param useZOrder If attribute UseZORder set to true, graphics and text are added to resultant HTML document accordingly Z-order in original PDF document. If this attribute is false all graphics is put as single layer which may cause some unnecessary effects for overlapped objects. (optional) + * @param antialiasingProcessing The parameter defines required antialiasing measures during conversion of compound background images from PDF to HTML. (optional) + * @param cssClassNamesPrefix When PDFtoHTML converter generates result CSSs, CSS class names (something like \".stl_01 {}\" ... \".stl_NN {}) are generated and used in result CSS. This property allows forcibly set class name prefix. (optional) + * @param explicitListOfSavedPages With this property You can explicitely define what pages of document should be converted. Pages in this list must have 1-based numbers. I.e. valid numbers of pages must be taken from range (1...[NumberOfPagesInConvertedDocument]) Order of appearing of pages in this list does not affect their order in result HTML page(s) - in result pages allways will go in order in which they are present in source PDF. (optional) + * @param fontEncodingStrategy Defines encoding special rule to tune PDF decoding for current document. (optional) + * @param fontSavingMode Defines font saving mode that will be used during saving of PDF to desirable format. (optional) + * @param htmlMarkupGenerationMode Sometimes specific reqirments to generation of HTML markup are present. This parameter defines HTML preparing modes that can be used during conversion of PDF to HTML to match such specific requirments. (optional) + * @param lettersPositioningMethod The mode of positioning of letters in words in result HTML. (optional) + * @param pagesFlowTypeDependsOnViewersScreenSize If attribute 'SplitOnPages=false', than whole HTML representing all input PDF pages will be put into one big result HTML file. This flag defines whether result HTML will be generated in such way that flow of areas that represent PDF pages in result HTML will depend on screen resolution of viewer. (optional) + * @param partsEmbeddingMode It defines whether referenced files (HTML, Fonts,Images, CSSes) will be embedded into main HTML file or will be generated as apart binary entities. (optional) + * @param rasterImagesSavingMode Converted PDF can contain raster images This parameter defines how they should be handled during conversion of PDF to HTML. (optional) + * @param removeEmptyAreasOnTopAndBottom Defines whether in created HTML will be removed top and bottom empty area without any content (if any). (optional) + * @param saveShadowedTextsAsTransparentTexts Pdf can contain texts that are shadowed by another elements (f.e. by images) but can be selected to clipboard in Acrobat Reader (usually it happen when document contains images and OCRed texts extracted from it). This settings tells to converter whether we need save such texts as transparent selectable texts in result HTML to mimic behaviour of Acrobat Reader (othervise such texts are usually saved as hidden, not available for copying to clipboard). (optional) + * @param saveTransparentTexts Pdf can contain transparent texts that can be selected to clipboard (usually it happen when document contains images and OCRed texts extracted from it). This settings tells to converter whether we need save such texts as transparent selectable texts in result HTML. (optional) + * @param specialFolderForAllImages The path to directory to which must be saved any images if they are encountered during saving of document as HTML. If parameter is empty or null then image files(if any) wil be saved together with other files linked to HTML It does not affect anything if CustomImageSavingStrategy property was successfully used to process relevant image file. (optional) + * @param specialFolderForSvgImages The path to directory to which must be saved only SVG-images if they are encountered during saving of document as HTML. If parameter is empty or null then SVG files(if any) wil be saved together with other image-files (near to output file) or in special folder for images (if it specified in SpecialImagesFolderIfAny option). It does not affect anything if CustomImageSavingStrategy property was successfully used to process relevant image file. (optional) + * @param trySaveTextUnderliningAndStrikeoutingInCss PDF itself does not contain underlining markers for texts. It emulated with line situated under text. This option allows converter try guess that this or that line is a text's underlining and put this info into CSS instead of drawing of underlining graphically. (optional) + * @param folder The document folder. (optional) + * @return SaaSposeResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public SaaSposeResponse putPdfInStorageToHtml(String name, String outPath, Integer additionalMarginWidthInPoints, Boolean compressSvgGraphicsIfAny, Boolean convertMarkedContentToLayers, String defaultFontName, String documentType, Boolean fixedLayout, Integer imageResolution, Integer minimalLineWidth, Boolean preventGlyphsGrouping, Boolean splitCssIntoPages, Boolean splitIntoPages, Boolean useZOrder, String antialiasingProcessing, String cssClassNamesPrefix, List explicitListOfSavedPages, String fontEncodingStrategy, String fontSavingMode, String htmlMarkupGenerationMode, String lettersPositioningMethod, Boolean pagesFlowTypeDependsOnViewersScreenSize, String partsEmbeddingMode, String rasterImagesSavingMode, Boolean removeEmptyAreasOnTopAndBottom, Boolean saveShadowedTextsAsTransparentTexts, Boolean saveTransparentTexts, String specialFolderForAllImages, String specialFolderForSvgImages, Boolean trySaveTextUnderliningAndStrikeoutingInCss, String folder) throws ApiException { + ApiResponse resp = putPdfInStorageToHtmlWithHttpInfo(name, outPath, additionalMarginWidthInPoints, compressSvgGraphicsIfAny, convertMarkedContentToLayers, defaultFontName, documentType, fixedLayout, imageResolution, minimalLineWidth, preventGlyphsGrouping, splitCssIntoPages, splitIntoPages, useZOrder, antialiasingProcessing, cssClassNamesPrefix, explicitListOfSavedPages, fontEncodingStrategy, fontSavingMode, htmlMarkupGenerationMode, lettersPositioningMethod, pagesFlowTypeDependsOnViewersScreenSize, partsEmbeddingMode, rasterImagesSavingMode, removeEmptyAreasOnTopAndBottom, saveShadowedTextsAsTransparentTexts, saveTransparentTexts, specialFolderForAllImages, specialFolderForSvgImages, trySaveTextUnderliningAndStrikeoutingInCss, folder); + return resp.getData(); + } + + /** + * Converts PDF document (located on storage) to Html format and uploads resulting file to storage + * + * @param name The document name. (required) + * @param outPath Full resulting filename (ex. /folder1/folder2/result.html) (required) + * @param additionalMarginWidthInPoints Defines width of margin that will be forcibly left around that output HTML-areas. (optional) + * @param compressSvgGraphicsIfAny The flag that indicates whether found SVG graphics(if any) will be compressed(zipped) into SVGZ format during saving. (optional) + * @param convertMarkedContentToLayers If attribute ConvertMarkedContentToLayers set to true then an all elements inside a PDF marked content (layer) will be put into an HTML div with \"data-pdflayer\" attribute specifying a layer name. This layer name will be extracted from optional properties of PDF marked content. If this attribute is false (by default) then no any layers will be created from PDF marked content. (optional) + * @param defaultFontName Specifies the name of an installed font which is used to substitute any document font that is not embedded and not installed in the system. If null then default substitution font is used. (optional) + * @param documentType Result document type. (optional) + * @param fixedLayout The value indicating whether that HTML is created as fixed layout. (optional) + * @param imageResolution Resolution for image rendering. (optional) + * @param minimalLineWidth This attribute sets minimal width of graphic path line. If thickness of line is less than 1px Adobe Acrobat rounds it to this value. So this attribute can be used to emulate this behavior for HTML browsers. (optional) + * @param preventGlyphsGrouping This attribute switch on the mode when text glyphs will not be grouped into words and strings This mode allows to keep maximum precision during positioning of glyphs on the page and it can be used for conversion documents with music notes or glyphs that should be placed separately each other. This parameter will be applied to document only when the value of FixedLayout attribute is true. (optional) + * @param splitCssIntoPages When multipage-mode selected(i.e 'SplitIntoPages' is 'true'), then this attribute defines whether should be created separate CSS-file for each result HTML page. (optional) + * @param splitIntoPages The flag that indicates whether each page of source document will be converted into it's own target HTML document, i.e whether result HTML will be splitted into several HTML-pages. (optional) + * @param useZOrder If attribute UseZORder set to true, graphics and text are added to resultant HTML document accordingly Z-order in original PDF document. If this attribute is false all graphics is put as single layer which may cause some unnecessary effects for overlapped objects. (optional) + * @param antialiasingProcessing The parameter defines required antialiasing measures during conversion of compound background images from PDF to HTML. (optional) + * @param cssClassNamesPrefix When PDFtoHTML converter generates result CSSs, CSS class names (something like \".stl_01 {}\" ... \".stl_NN {}) are generated and used in result CSS. This property allows forcibly set class name prefix. (optional) + * @param explicitListOfSavedPages With this property You can explicitely define what pages of document should be converted. Pages in this list must have 1-based numbers. I.e. valid numbers of pages must be taken from range (1...[NumberOfPagesInConvertedDocument]) Order of appearing of pages in this list does not affect their order in result HTML page(s) - in result pages allways will go in order in which they are present in source PDF. (optional) + * @param fontEncodingStrategy Defines encoding special rule to tune PDF decoding for current document. (optional) + * @param fontSavingMode Defines font saving mode that will be used during saving of PDF to desirable format. (optional) + * @param htmlMarkupGenerationMode Sometimes specific reqirments to generation of HTML markup are present. This parameter defines HTML preparing modes that can be used during conversion of PDF to HTML to match such specific requirments. (optional) + * @param lettersPositioningMethod The mode of positioning of letters in words in result HTML. (optional) + * @param pagesFlowTypeDependsOnViewersScreenSize If attribute 'SplitOnPages=false', than whole HTML representing all input PDF pages will be put into one big result HTML file. This flag defines whether result HTML will be generated in such way that flow of areas that represent PDF pages in result HTML will depend on screen resolution of viewer. (optional) + * @param partsEmbeddingMode It defines whether referenced files (HTML, Fonts,Images, CSSes) will be embedded into main HTML file or will be generated as apart binary entities. (optional) + * @param rasterImagesSavingMode Converted PDF can contain raster images This parameter defines how they should be handled during conversion of PDF to HTML. (optional) + * @param removeEmptyAreasOnTopAndBottom Defines whether in created HTML will be removed top and bottom empty area without any content (if any). (optional) + * @param saveShadowedTextsAsTransparentTexts Pdf can contain texts that are shadowed by another elements (f.e. by images) but can be selected to clipboard in Acrobat Reader (usually it happen when document contains images and OCRed texts extracted from it). This settings tells to converter whether we need save such texts as transparent selectable texts in result HTML to mimic behaviour of Acrobat Reader (othervise such texts are usually saved as hidden, not available for copying to clipboard). (optional) + * @param saveTransparentTexts Pdf can contain transparent texts that can be selected to clipboard (usually it happen when document contains images and OCRed texts extracted from it). This settings tells to converter whether we need save such texts as transparent selectable texts in result HTML. (optional) + * @param specialFolderForAllImages The path to directory to which must be saved any images if they are encountered during saving of document as HTML. If parameter is empty or null then image files(if any) wil be saved together with other files linked to HTML It does not affect anything if CustomImageSavingStrategy property was successfully used to process relevant image file. (optional) + * @param specialFolderForSvgImages The path to directory to which must be saved only SVG-images if they are encountered during saving of document as HTML. If parameter is empty or null then SVG files(if any) wil be saved together with other image-files (near to output file) or in special folder for images (if it specified in SpecialImagesFolderIfAny option). It does not affect anything if CustomImageSavingStrategy property was successfully used to process relevant image file. (optional) + * @param trySaveTextUnderliningAndStrikeoutingInCss PDF itself does not contain underlining markers for texts. It emulated with line situated under text. This option allows converter try guess that this or that line is a text's underlining and put this info into CSS instead of drawing of underlining graphically. (optional) + * @param folder The document folder. (optional) + * @return ApiResponse<SaaSposeResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse putPdfInStorageToHtmlWithHttpInfo(String name, String outPath, Integer additionalMarginWidthInPoints, Boolean compressSvgGraphicsIfAny, Boolean convertMarkedContentToLayers, String defaultFontName, String documentType, Boolean fixedLayout, Integer imageResolution, Integer minimalLineWidth, Boolean preventGlyphsGrouping, Boolean splitCssIntoPages, Boolean splitIntoPages, Boolean useZOrder, String antialiasingProcessing, String cssClassNamesPrefix, List explicitListOfSavedPages, String fontEncodingStrategy, String fontSavingMode, String htmlMarkupGenerationMode, String lettersPositioningMethod, Boolean pagesFlowTypeDependsOnViewersScreenSize, String partsEmbeddingMode, String rasterImagesSavingMode, Boolean removeEmptyAreasOnTopAndBottom, Boolean saveShadowedTextsAsTransparentTexts, Boolean saveTransparentTexts, String specialFolderForAllImages, String specialFolderForSvgImages, Boolean trySaveTextUnderliningAndStrikeoutingInCss, String folder) throws ApiException { + com.squareup.okhttp.Call call = putPdfInStorageToHtmlValidateBeforeCall(name, outPath, additionalMarginWidthInPoints, compressSvgGraphicsIfAny, convertMarkedContentToLayers, defaultFontName, documentType, fixedLayout, imageResolution, minimalLineWidth, preventGlyphsGrouping, splitCssIntoPages, splitIntoPages, useZOrder, antialiasingProcessing, cssClassNamesPrefix, explicitListOfSavedPages, fontEncodingStrategy, fontSavingMode, htmlMarkupGenerationMode, lettersPositioningMethod, pagesFlowTypeDependsOnViewersScreenSize, partsEmbeddingMode, rasterImagesSavingMode, removeEmptyAreasOnTopAndBottom, saveShadowedTextsAsTransparentTexts, saveTransparentTexts, specialFolderForAllImages, specialFolderForSvgImages, trySaveTextUnderliningAndStrikeoutingInCss, folder, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Converts PDF document (located on storage) to Html format and uploads resulting file to storage (asynchronously) + * + * @param name The document name. (required) + * @param outPath Full resulting filename (ex. /folder1/folder2/result.html) (required) + * @param additionalMarginWidthInPoints Defines width of margin that will be forcibly left around that output HTML-areas. (optional) + * @param compressSvgGraphicsIfAny The flag that indicates whether found SVG graphics(if any) will be compressed(zipped) into SVGZ format during saving. (optional) + * @param convertMarkedContentToLayers If attribute ConvertMarkedContentToLayers set to true then an all elements inside a PDF marked content (layer) will be put into an HTML div with \"data-pdflayer\" attribute specifying a layer name. This layer name will be extracted from optional properties of PDF marked content. If this attribute is false (by default) then no any layers will be created from PDF marked content. (optional) + * @param defaultFontName Specifies the name of an installed font which is used to substitute any document font that is not embedded and not installed in the system. If null then default substitution font is used. (optional) + * @param documentType Result document type. (optional) + * @param fixedLayout The value indicating whether that HTML is created as fixed layout. (optional) + * @param imageResolution Resolution for image rendering. (optional) + * @param minimalLineWidth This attribute sets minimal width of graphic path line. If thickness of line is less than 1px Adobe Acrobat rounds it to this value. So this attribute can be used to emulate this behavior for HTML browsers. (optional) + * @param preventGlyphsGrouping This attribute switch on the mode when text glyphs will not be grouped into words and strings This mode allows to keep maximum precision during positioning of glyphs on the page and it can be used for conversion documents with music notes or glyphs that should be placed separately each other. This parameter will be applied to document only when the value of FixedLayout attribute is true. (optional) + * @param splitCssIntoPages When multipage-mode selected(i.e 'SplitIntoPages' is 'true'), then this attribute defines whether should be created separate CSS-file for each result HTML page. (optional) + * @param splitIntoPages The flag that indicates whether each page of source document will be converted into it's own target HTML document, i.e whether result HTML will be splitted into several HTML-pages. (optional) + * @param useZOrder If attribute UseZORder set to true, graphics and text are added to resultant HTML document accordingly Z-order in original PDF document. If this attribute is false all graphics is put as single layer which may cause some unnecessary effects for overlapped objects. (optional) + * @param antialiasingProcessing The parameter defines required antialiasing measures during conversion of compound background images from PDF to HTML. (optional) + * @param cssClassNamesPrefix When PDFtoHTML converter generates result CSSs, CSS class names (something like \".stl_01 {}\" ... \".stl_NN {}) are generated and used in result CSS. This property allows forcibly set class name prefix. (optional) + * @param explicitListOfSavedPages With this property You can explicitely define what pages of document should be converted. Pages in this list must have 1-based numbers. I.e. valid numbers of pages must be taken from range (1...[NumberOfPagesInConvertedDocument]) Order of appearing of pages in this list does not affect their order in result HTML page(s) - in result pages allways will go in order in which they are present in source PDF. (optional) + * @param fontEncodingStrategy Defines encoding special rule to tune PDF decoding for current document. (optional) + * @param fontSavingMode Defines font saving mode that will be used during saving of PDF to desirable format. (optional) + * @param htmlMarkupGenerationMode Sometimes specific reqirments to generation of HTML markup are present. This parameter defines HTML preparing modes that can be used during conversion of PDF to HTML to match such specific requirments. (optional) + * @param lettersPositioningMethod The mode of positioning of letters in words in result HTML. (optional) + * @param pagesFlowTypeDependsOnViewersScreenSize If attribute 'SplitOnPages=false', than whole HTML representing all input PDF pages will be put into one big result HTML file. This flag defines whether result HTML will be generated in such way that flow of areas that represent PDF pages in result HTML will depend on screen resolution of viewer. (optional) + * @param partsEmbeddingMode It defines whether referenced files (HTML, Fonts,Images, CSSes) will be embedded into main HTML file or will be generated as apart binary entities. (optional) + * @param rasterImagesSavingMode Converted PDF can contain raster images This parameter defines how they should be handled during conversion of PDF to HTML. (optional) + * @param removeEmptyAreasOnTopAndBottom Defines whether in created HTML will be removed top and bottom empty area without any content (if any). (optional) + * @param saveShadowedTextsAsTransparentTexts Pdf can contain texts that are shadowed by another elements (f.e. by images) but can be selected to clipboard in Acrobat Reader (usually it happen when document contains images and OCRed texts extracted from it). This settings tells to converter whether we need save such texts as transparent selectable texts in result HTML to mimic behaviour of Acrobat Reader (othervise such texts are usually saved as hidden, not available for copying to clipboard). (optional) + * @param saveTransparentTexts Pdf can contain transparent texts that can be selected to clipboard (usually it happen when document contains images and OCRed texts extracted from it). This settings tells to converter whether we need save such texts as transparent selectable texts in result HTML. (optional) + * @param specialFolderForAllImages The path to directory to which must be saved any images if they are encountered during saving of document as HTML. If parameter is empty or null then image files(if any) wil be saved together with other files linked to HTML It does not affect anything if CustomImageSavingStrategy property was successfully used to process relevant image file. (optional) + * @param specialFolderForSvgImages The path to directory to which must be saved only SVG-images if they are encountered during saving of document as HTML. If parameter is empty or null then SVG files(if any) wil be saved together with other image-files (near to output file) or in special folder for images (if it specified in SpecialImagesFolderIfAny option). It does not affect anything if CustomImageSavingStrategy property was successfully used to process relevant image file. (optional) + * @param trySaveTextUnderliningAndStrikeoutingInCss PDF itself does not contain underlining markers for texts. It emulated with line situated under text. This option allows converter try guess that this or that line is a text's underlining and put this info into CSS instead of drawing of underlining graphically. (optional) + * @param folder The document folder. (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call putPdfInStorageToHtmlAsync(String name, String outPath, Integer additionalMarginWidthInPoints, Boolean compressSvgGraphicsIfAny, Boolean convertMarkedContentToLayers, String defaultFontName, String documentType, Boolean fixedLayout, Integer imageResolution, Integer minimalLineWidth, Boolean preventGlyphsGrouping, Boolean splitCssIntoPages, Boolean splitIntoPages, Boolean useZOrder, String antialiasingProcessing, String cssClassNamesPrefix, List explicitListOfSavedPages, String fontEncodingStrategy, String fontSavingMode, String htmlMarkupGenerationMode, String lettersPositioningMethod, Boolean pagesFlowTypeDependsOnViewersScreenSize, String partsEmbeddingMode, String rasterImagesSavingMode, Boolean removeEmptyAreasOnTopAndBottom, Boolean saveShadowedTextsAsTransparentTexts, Boolean saveTransparentTexts, String specialFolderForAllImages, String specialFolderForSvgImages, Boolean trySaveTextUnderliningAndStrikeoutingInCss, String folder, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = putPdfInStorageToHtmlValidateBeforeCall(name, outPath, additionalMarginWidthInPoints, compressSvgGraphicsIfAny, convertMarkedContentToLayers, defaultFontName, documentType, fixedLayout, imageResolution, minimalLineWidth, preventGlyphsGrouping, splitCssIntoPages, splitIntoPages, useZOrder, antialiasingProcessing, cssClassNamesPrefix, explicitListOfSavedPages, fontEncodingStrategy, fontSavingMode, htmlMarkupGenerationMode, lettersPositioningMethod, pagesFlowTypeDependsOnViewersScreenSize, partsEmbeddingMode, rasterImagesSavingMode, removeEmptyAreasOnTopAndBottom, saveShadowedTextsAsTransparentTexts, saveTransparentTexts, specialFolderForAllImages, specialFolderForSvgImages, trySaveTextUnderliningAndStrikeoutingInCss, folder, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for putPdfInStorageToLaTeX + * @param name The document name. (required) + * @param outPath Full resulting filename (ex. /folder1/folder2/result.tex) (required) + * @param pagesCount Pages count. (optional) + * @param folder The document folder. (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call putPdfInStorageToLaTeXCall(String name, String outPath, Integer pagesCount, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/pdf/{name}/convert/latex" + .replaceAll("\\{" + "name" + "\\}", apiClient.escapeString(name.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (outPath != null) + localVarQueryParams.addAll(apiClient.parameterToPair("outPath", outPath)); + if (pagesCount != null) + localVarQueryParams.addAll(apiClient.parameterToPair("pagesCount", pagesCount)); + if (folder != null) + localVarQueryParams.addAll(apiClient.parameterToPair("folder", folder)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call putPdfInStorageToLaTeXValidateBeforeCall(String name, String outPath, Integer pagesCount, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException("Missing the required parameter 'name' when calling putPdfInStorageToLaTeX(Async)"); + } + + // verify the required parameter 'outPath' is set + if (outPath == null) { + throw new ApiException("Missing the required parameter 'outPath' when calling putPdfInStorageToLaTeX(Async)"); + } + + + com.squareup.okhttp.Call call = putPdfInStorageToLaTeXCall(name, outPath, pagesCount, folder, progressListener, progressRequestListener); + return call; + + } + + /** + * Converts PDF document (located on storage) to LaTeX format and uploads resulting file to storage + * + * @param name The document name. (required) + * @param outPath Full resulting filename (ex. /folder1/folder2/result.tex) (required) + * @param pagesCount Pages count. (optional) + * @param folder The document folder. (optional) + * @return SaaSposeResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public SaaSposeResponse putPdfInStorageToLaTeX(String name, String outPath, Integer pagesCount, String folder) throws ApiException { + ApiResponse resp = putPdfInStorageToLaTeXWithHttpInfo(name, outPath, pagesCount, folder); + return resp.getData(); + } + + /** + * Converts PDF document (located on storage) to LaTeX format and uploads resulting file to storage + * + * @param name The document name. (required) + * @param outPath Full resulting filename (ex. /folder1/folder2/result.tex) (required) + * @param pagesCount Pages count. (optional) + * @param folder The document folder. (optional) + * @return ApiResponse<SaaSposeResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse putPdfInStorageToLaTeXWithHttpInfo(String name, String outPath, Integer pagesCount, String folder) throws ApiException { + com.squareup.okhttp.Call call = putPdfInStorageToLaTeXValidateBeforeCall(name, outPath, pagesCount, folder, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Converts PDF document (located on storage) to LaTeX format and uploads resulting file to storage (asynchronously) + * + * @param name The document name. (required) + * @param outPath Full resulting filename (ex. /folder1/folder2/result.tex) (required) + * @param pagesCount Pages count. (optional) + * @param folder The document folder. (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call putPdfInStorageToLaTeXAsync(String name, String outPath, Integer pagesCount, String folder, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = putPdfInStorageToLaTeXValidateBeforeCall(name, outPath, pagesCount, folder, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for putPdfInStorageToMobiXml + * @param name The document name. (required) + * @param outPath Full resulting filename (ex. /folder1/folder2/result.mobixml) (required) + * @param folder The document folder. (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call putPdfInStorageToMobiXmlCall(String name, String outPath, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/pdf/{name}/convert/mobixml" + .replaceAll("\\{" + "name" + "\\}", apiClient.escapeString(name.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (outPath != null) + localVarQueryParams.addAll(apiClient.parameterToPair("outPath", outPath)); + if (folder != null) + localVarQueryParams.addAll(apiClient.parameterToPair("folder", folder)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call putPdfInStorageToMobiXmlValidateBeforeCall(String name, String outPath, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException("Missing the required parameter 'name' when calling putPdfInStorageToMobiXml(Async)"); + } + + // verify the required parameter 'outPath' is set + if (outPath == null) { + throw new ApiException("Missing the required parameter 'outPath' when calling putPdfInStorageToMobiXml(Async)"); + } + + + com.squareup.okhttp.Call call = putPdfInStorageToMobiXmlCall(name, outPath, folder, progressListener, progressRequestListener); + return call; + + } + + /** + * Converts PDF document (located on storage) to MOBIXML format and uploads resulting file to storage + * + * @param name The document name. (required) + * @param outPath Full resulting filename (ex. /folder1/folder2/result.mobixml) (required) + * @param folder The document folder. (optional) + * @return SaaSposeResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public SaaSposeResponse putPdfInStorageToMobiXml(String name, String outPath, String folder) throws ApiException { + ApiResponse resp = putPdfInStorageToMobiXmlWithHttpInfo(name, outPath, folder); + return resp.getData(); + } + + /** + * Converts PDF document (located on storage) to MOBIXML format and uploads resulting file to storage + * + * @param name The document name. (required) + * @param outPath Full resulting filename (ex. /folder1/folder2/result.mobixml) (required) + * @param folder The document folder. (optional) + * @return ApiResponse<SaaSposeResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse putPdfInStorageToMobiXmlWithHttpInfo(String name, String outPath, String folder) throws ApiException { + com.squareup.okhttp.Call call = putPdfInStorageToMobiXmlValidateBeforeCall(name, outPath, folder, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Converts PDF document (located on storage) to MOBIXML format and uploads resulting file to storage (asynchronously) + * + * @param name The document name. (required) + * @param outPath Full resulting filename (ex. /folder1/folder2/result.mobixml) (required) + * @param folder The document folder. (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call putPdfInStorageToMobiXmlAsync(String name, String outPath, String folder, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = putPdfInStorageToMobiXmlValidateBeforeCall(name, outPath, folder, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for putPdfInStorageToPdfA + * @param name The document name. (required) + * @param outPath Full resulting filename (ex. /folder1/folder2/result.pdf) (required) + * @param type Type of PdfA format. (required) + * @param folder The document folder. (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call putPdfInStorageToPdfACall(String name, String outPath, String type, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/pdf/{name}/convert/pdfa" + .replaceAll("\\{" + "name" + "\\}", apiClient.escapeString(name.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (outPath != null) + localVarQueryParams.addAll(apiClient.parameterToPair("outPath", outPath)); + if (type != null) + localVarQueryParams.addAll(apiClient.parameterToPair("type", type)); + if (folder != null) + localVarQueryParams.addAll(apiClient.parameterToPair("folder", folder)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call putPdfInStorageToPdfAValidateBeforeCall(String name, String outPath, String type, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException("Missing the required parameter 'name' when calling putPdfInStorageToPdfA(Async)"); + } + + // verify the required parameter 'outPath' is set + if (outPath == null) { + throw new ApiException("Missing the required parameter 'outPath' when calling putPdfInStorageToPdfA(Async)"); + } + + // verify the required parameter 'type' is set + if (type == null) { + throw new ApiException("Missing the required parameter 'type' when calling putPdfInStorageToPdfA(Async)"); + } + + + com.squareup.okhttp.Call call = putPdfInStorageToPdfACall(name, outPath, type, folder, progressListener, progressRequestListener); + return call; + + } + + /** + * Converts PDF document (located on storage) to PdfA format and uploads resulting file to storage + * + * @param name The document name. (required) + * @param outPath Full resulting filename (ex. /folder1/folder2/result.pdf) (required) + * @param type Type of PdfA format. (required) + * @param folder The document folder. (optional) + * @return SaaSposeResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public SaaSposeResponse putPdfInStorageToPdfA(String name, String outPath, String type, String folder) throws ApiException { + ApiResponse resp = putPdfInStorageToPdfAWithHttpInfo(name, outPath, type, folder); + return resp.getData(); + } + + /** + * Converts PDF document (located on storage) to PdfA format and uploads resulting file to storage + * + * @param name The document name. (required) + * @param outPath Full resulting filename (ex. /folder1/folder2/result.pdf) (required) + * @param type Type of PdfA format. (required) + * @param folder The document folder. (optional) + * @return ApiResponse<SaaSposeResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse putPdfInStorageToPdfAWithHttpInfo(String name, String outPath, String type, String folder) throws ApiException { + com.squareup.okhttp.Call call = putPdfInStorageToPdfAValidateBeforeCall(name, outPath, type, folder, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Converts PDF document (located on storage) to PdfA format and uploads resulting file to storage (asynchronously) + * + * @param name The document name. (required) + * @param outPath Full resulting filename (ex. /folder1/folder2/result.pdf) (required) + * @param type Type of PdfA format. (required) + * @param folder The document folder. (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call putPdfInStorageToPdfAAsync(String name, String outPath, String type, String folder, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = putPdfInStorageToPdfAValidateBeforeCall(name, outPath, type, folder, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for putPdfInStorageToPptx + * @param name The document name. (required) + * @param outPath Full resulting filename (ex. /folder1/folder2/result.pptx) (required) + * @param separateImages Separate images. (optional) + * @param slidesAsImages Slides as images. (optional) + * @param folder The document folder. (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call putPdfInStorageToPptxCall(String name, String outPath, Boolean separateImages, Boolean slidesAsImages, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/pdf/{name}/convert/pptx" + .replaceAll("\\{" + "name" + "\\}", apiClient.escapeString(name.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (outPath != null) + localVarQueryParams.addAll(apiClient.parameterToPair("outPath", outPath)); + if (separateImages != null) + localVarQueryParams.addAll(apiClient.parameterToPair("separateImages", separateImages)); + if (slidesAsImages != null) + localVarQueryParams.addAll(apiClient.parameterToPair("slidesAsImages", slidesAsImages)); + if (folder != null) + localVarQueryParams.addAll(apiClient.parameterToPair("folder", folder)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call putPdfInStorageToPptxValidateBeforeCall(String name, String outPath, Boolean separateImages, Boolean slidesAsImages, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException("Missing the required parameter 'name' when calling putPdfInStorageToPptx(Async)"); + } + + // verify the required parameter 'outPath' is set + if (outPath == null) { + throw new ApiException("Missing the required parameter 'outPath' when calling putPdfInStorageToPptx(Async)"); + } + + + com.squareup.okhttp.Call call = putPdfInStorageToPptxCall(name, outPath, separateImages, slidesAsImages, folder, progressListener, progressRequestListener); + return call; + + } + + /** + * Converts PDF document (located on storage) to PPTX format and uploads resulting file to storage + * + * @param name The document name. (required) + * @param outPath Full resulting filename (ex. /folder1/folder2/result.pptx) (required) + * @param separateImages Separate images. (optional) + * @param slidesAsImages Slides as images. (optional) + * @param folder The document folder. (optional) + * @return SaaSposeResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public SaaSposeResponse putPdfInStorageToPptx(String name, String outPath, Boolean separateImages, Boolean slidesAsImages, String folder) throws ApiException { + ApiResponse resp = putPdfInStorageToPptxWithHttpInfo(name, outPath, separateImages, slidesAsImages, folder); + return resp.getData(); + } + + /** + * Converts PDF document (located on storage) to PPTX format and uploads resulting file to storage + * + * @param name The document name. (required) + * @param outPath Full resulting filename (ex. /folder1/folder2/result.pptx) (required) + * @param separateImages Separate images. (optional) + * @param slidesAsImages Slides as images. (optional) + * @param folder The document folder. (optional) + * @return ApiResponse<SaaSposeResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse putPdfInStorageToPptxWithHttpInfo(String name, String outPath, Boolean separateImages, Boolean slidesAsImages, String folder) throws ApiException { + com.squareup.okhttp.Call call = putPdfInStorageToPptxValidateBeforeCall(name, outPath, separateImages, slidesAsImages, folder, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Converts PDF document (located on storage) to PPTX format and uploads resulting file to storage (asynchronously) + * + * @param name The document name. (required) + * @param outPath Full resulting filename (ex. /folder1/folder2/result.pptx) (required) + * @param separateImages Separate images. (optional) + * @param slidesAsImages Slides as images. (optional) + * @param folder The document folder. (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call putPdfInStorageToPptxAsync(String name, String outPath, Boolean separateImages, Boolean slidesAsImages, String folder, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = putPdfInStorageToPptxValidateBeforeCall(name, outPath, separateImages, slidesAsImages, folder, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for putPdfInStorageToSvg + * @param name The document name. (required) + * @param outPath Full resulting filename (ex. /folder1/folder2/result.svg) (required) + * @param compressOutputToZipArchive Specifies whether output will be created as one zip-archive. (optional) + * @param folder The document folder. (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call putPdfInStorageToSvgCall(String name, String outPath, Boolean compressOutputToZipArchive, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/pdf/{name}/convert/svg" + .replaceAll("\\{" + "name" + "\\}", apiClient.escapeString(name.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (outPath != null) + localVarQueryParams.addAll(apiClient.parameterToPair("outPath", outPath)); + if (compressOutputToZipArchive != null) + localVarQueryParams.addAll(apiClient.parameterToPair("compressOutputToZipArchive", compressOutputToZipArchive)); + if (folder != null) + localVarQueryParams.addAll(apiClient.parameterToPair("folder", folder)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call putPdfInStorageToSvgValidateBeforeCall(String name, String outPath, Boolean compressOutputToZipArchive, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException("Missing the required parameter 'name' when calling putPdfInStorageToSvg(Async)"); + } + + // verify the required parameter 'outPath' is set + if (outPath == null) { + throw new ApiException("Missing the required parameter 'outPath' when calling putPdfInStorageToSvg(Async)"); + } + + + com.squareup.okhttp.Call call = putPdfInStorageToSvgCall(name, outPath, compressOutputToZipArchive, folder, progressListener, progressRequestListener); + return call; + + } + + /** + * Converts PDF document (located on storage) to SVG format and uploads resulting file to storage + * + * @param name The document name. (required) + * @param outPath Full resulting filename (ex. /folder1/folder2/result.svg) (required) + * @param compressOutputToZipArchive Specifies whether output will be created as one zip-archive. (optional) + * @param folder The document folder. (optional) + * @return SaaSposeResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public SaaSposeResponse putPdfInStorageToSvg(String name, String outPath, Boolean compressOutputToZipArchive, String folder) throws ApiException { + ApiResponse resp = putPdfInStorageToSvgWithHttpInfo(name, outPath, compressOutputToZipArchive, folder); + return resp.getData(); + } + + /** + * Converts PDF document (located on storage) to SVG format and uploads resulting file to storage + * + * @param name The document name. (required) + * @param outPath Full resulting filename (ex. /folder1/folder2/result.svg) (required) + * @param compressOutputToZipArchive Specifies whether output will be created as one zip-archive. (optional) + * @param folder The document folder. (optional) + * @return ApiResponse<SaaSposeResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse putPdfInStorageToSvgWithHttpInfo(String name, String outPath, Boolean compressOutputToZipArchive, String folder) throws ApiException { + com.squareup.okhttp.Call call = putPdfInStorageToSvgValidateBeforeCall(name, outPath, compressOutputToZipArchive, folder, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Converts PDF document (located on storage) to SVG format and uploads resulting file to storage (asynchronously) + * + * @param name The document name. (required) + * @param outPath Full resulting filename (ex. /folder1/folder2/result.svg) (required) + * @param compressOutputToZipArchive Specifies whether output will be created as one zip-archive. (optional) + * @param folder The document folder. (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call putPdfInStorageToSvgAsync(String name, String outPath, Boolean compressOutputToZipArchive, String folder, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = putPdfInStorageToSvgValidateBeforeCall(name, outPath, compressOutputToZipArchive, folder, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for putPdfInStorageToTiff + * @param name The document name. (required) + * @param outPath Full resulting filename (ex. /folder1/folder2/result.tiff) (required) + * @param brightness Image brightness. (optional) + * @param compression Tiff compression. Possible values are: LZW, CCITT4, CCITT3, RLE, None. (optional) + * @param colorDepth Image color depth. Possible valuse are: Default, Format8bpp, Format4bpp, Format1bpp. (optional) + * @param leftMargin Left image margin. (optional) + * @param rightMargin Right image margin. (optional) + * @param topMargin Top image margin. (optional) + * @param bottomMargin Bottom image margin. (optional) + * @param orientation Image orientation. Possible values are: None, Landscape, Portait. (optional) + * @param skipBlankPages Skip blank pages flag. (optional) + * @param width Image width. (optional) + * @param height Image height. (optional) + * @param xResolution Horizontal resolution. (optional) + * @param yResolution Vertical resolution. (optional) + * @param pageIndex Start page to export. (optional) + * @param pageCount Number of pages to export. (optional) + * @param folder The document folder. (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call putPdfInStorageToTiffCall(String name, String outPath, Double brightness, String compression, String colorDepth, Integer leftMargin, Integer rightMargin, Integer topMargin, Integer bottomMargin, String orientation, Boolean skipBlankPages, Integer width, Integer height, Integer xResolution, Integer yResolution, Integer pageIndex, Integer pageCount, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/pdf/{name}/convert/tiff" + .replaceAll("\\{" + "name" + "\\}", apiClient.escapeString(name.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (outPath != null) + localVarQueryParams.addAll(apiClient.parameterToPair("outPath", outPath)); + if (brightness != null) + localVarQueryParams.addAll(apiClient.parameterToPair("brightness", brightness)); + if (compression != null) + localVarQueryParams.addAll(apiClient.parameterToPair("compression", compression)); + if (colorDepth != null) + localVarQueryParams.addAll(apiClient.parameterToPair("colorDepth", colorDepth)); + if (leftMargin != null) + localVarQueryParams.addAll(apiClient.parameterToPair("leftMargin", leftMargin)); + if (rightMargin != null) + localVarQueryParams.addAll(apiClient.parameterToPair("rightMargin", rightMargin)); + if (topMargin != null) + localVarQueryParams.addAll(apiClient.parameterToPair("topMargin", topMargin)); + if (bottomMargin != null) + localVarQueryParams.addAll(apiClient.parameterToPair("bottomMargin", bottomMargin)); + if (orientation != null) + localVarQueryParams.addAll(apiClient.parameterToPair("orientation", orientation)); + if (skipBlankPages != null) + localVarQueryParams.addAll(apiClient.parameterToPair("skipBlankPages", skipBlankPages)); + if (width != null) + localVarQueryParams.addAll(apiClient.parameterToPair("width", width)); + if (height != null) + localVarQueryParams.addAll(apiClient.parameterToPair("height", height)); + if (xResolution != null) + localVarQueryParams.addAll(apiClient.parameterToPair("xResolution", xResolution)); + if (yResolution != null) + localVarQueryParams.addAll(apiClient.parameterToPair("yResolution", yResolution)); + if (pageIndex != null) + localVarQueryParams.addAll(apiClient.parameterToPair("pageIndex", pageIndex)); + if (pageCount != null) + localVarQueryParams.addAll(apiClient.parameterToPair("pageCount", pageCount)); + if (folder != null) + localVarQueryParams.addAll(apiClient.parameterToPair("folder", folder)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call putPdfInStorageToTiffValidateBeforeCall(String name, String outPath, Double brightness, String compression, String colorDepth, Integer leftMargin, Integer rightMargin, Integer topMargin, Integer bottomMargin, String orientation, Boolean skipBlankPages, Integer width, Integer height, Integer xResolution, Integer yResolution, Integer pageIndex, Integer pageCount, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException("Missing the required parameter 'name' when calling putPdfInStorageToTiff(Async)"); + } + + // verify the required parameter 'outPath' is set + if (outPath == null) { + throw new ApiException("Missing the required parameter 'outPath' when calling putPdfInStorageToTiff(Async)"); + } + + + com.squareup.okhttp.Call call = putPdfInStorageToTiffCall(name, outPath, brightness, compression, colorDepth, leftMargin, rightMargin, topMargin, bottomMargin, orientation, skipBlankPages, width, height, xResolution, yResolution, pageIndex, pageCount, folder, progressListener, progressRequestListener); + return call; + + } + + /** + * Converts PDF document (located on storage) to TIFF format and uploads resulting file to storage + * + * @param name The document name. (required) + * @param outPath Full resulting filename (ex. /folder1/folder2/result.tiff) (required) + * @param brightness Image brightness. (optional) + * @param compression Tiff compression. Possible values are: LZW, CCITT4, CCITT3, RLE, None. (optional) + * @param colorDepth Image color depth. Possible valuse are: Default, Format8bpp, Format4bpp, Format1bpp. (optional) + * @param leftMargin Left image margin. (optional) + * @param rightMargin Right image margin. (optional) + * @param topMargin Top image margin. (optional) + * @param bottomMargin Bottom image margin. (optional) + * @param orientation Image orientation. Possible values are: None, Landscape, Portait. (optional) + * @param skipBlankPages Skip blank pages flag. (optional) + * @param width Image width. (optional) + * @param height Image height. (optional) + * @param xResolution Horizontal resolution. (optional) + * @param yResolution Vertical resolution. (optional) + * @param pageIndex Start page to export. (optional) + * @param pageCount Number of pages to export. (optional) + * @param folder The document folder. (optional) + * @return SaaSposeResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public SaaSposeResponse putPdfInStorageToTiff(String name, String outPath, Double brightness, String compression, String colorDepth, Integer leftMargin, Integer rightMargin, Integer topMargin, Integer bottomMargin, String orientation, Boolean skipBlankPages, Integer width, Integer height, Integer xResolution, Integer yResolution, Integer pageIndex, Integer pageCount, String folder) throws ApiException { + ApiResponse resp = putPdfInStorageToTiffWithHttpInfo(name, outPath, brightness, compression, colorDepth, leftMargin, rightMargin, topMargin, bottomMargin, orientation, skipBlankPages, width, height, xResolution, yResolution, pageIndex, pageCount, folder); + return resp.getData(); + } + + /** + * Converts PDF document (located on storage) to TIFF format and uploads resulting file to storage + * + * @param name The document name. (required) + * @param outPath Full resulting filename (ex. /folder1/folder2/result.tiff) (required) + * @param brightness Image brightness. (optional) + * @param compression Tiff compression. Possible values are: LZW, CCITT4, CCITT3, RLE, None. (optional) + * @param colorDepth Image color depth. Possible valuse are: Default, Format8bpp, Format4bpp, Format1bpp. (optional) + * @param leftMargin Left image margin. (optional) + * @param rightMargin Right image margin. (optional) + * @param topMargin Top image margin. (optional) + * @param bottomMargin Bottom image margin. (optional) + * @param orientation Image orientation. Possible values are: None, Landscape, Portait. (optional) + * @param skipBlankPages Skip blank pages flag. (optional) + * @param width Image width. (optional) + * @param height Image height. (optional) + * @param xResolution Horizontal resolution. (optional) + * @param yResolution Vertical resolution. (optional) + * @param pageIndex Start page to export. (optional) + * @param pageCount Number of pages to export. (optional) + * @param folder The document folder. (optional) + * @return ApiResponse<SaaSposeResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse putPdfInStorageToTiffWithHttpInfo(String name, String outPath, Double brightness, String compression, String colorDepth, Integer leftMargin, Integer rightMargin, Integer topMargin, Integer bottomMargin, String orientation, Boolean skipBlankPages, Integer width, Integer height, Integer xResolution, Integer yResolution, Integer pageIndex, Integer pageCount, String folder) throws ApiException { + com.squareup.okhttp.Call call = putPdfInStorageToTiffValidateBeforeCall(name, outPath, brightness, compression, colorDepth, leftMargin, rightMargin, topMargin, bottomMargin, orientation, skipBlankPages, width, height, xResolution, yResolution, pageIndex, pageCount, folder, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Converts PDF document (located on storage) to TIFF format and uploads resulting file to storage (asynchronously) + * + * @param name The document name. (required) + * @param outPath Full resulting filename (ex. /folder1/folder2/result.tiff) (required) + * @param brightness Image brightness. (optional) + * @param compression Tiff compression. Possible values are: LZW, CCITT4, CCITT3, RLE, None. (optional) + * @param colorDepth Image color depth. Possible valuse are: Default, Format8bpp, Format4bpp, Format1bpp. (optional) + * @param leftMargin Left image margin. (optional) + * @param rightMargin Right image margin. (optional) + * @param topMargin Top image margin. (optional) + * @param bottomMargin Bottom image margin. (optional) + * @param orientation Image orientation. Possible values are: None, Landscape, Portait. (optional) + * @param skipBlankPages Skip blank pages flag. (optional) + * @param width Image width. (optional) + * @param height Image height. (optional) + * @param xResolution Horizontal resolution. (optional) + * @param yResolution Vertical resolution. (optional) + * @param pageIndex Start page to export. (optional) + * @param pageCount Number of pages to export. (optional) + * @param folder The document folder. (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call putPdfInStorageToTiffAsync(String name, String outPath, Double brightness, String compression, String colorDepth, Integer leftMargin, Integer rightMargin, Integer topMargin, Integer bottomMargin, String orientation, Boolean skipBlankPages, Integer width, Integer height, Integer xResolution, Integer yResolution, Integer pageIndex, Integer pageCount, String folder, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = putPdfInStorageToTiffValidateBeforeCall(name, outPath, brightness, compression, colorDepth, leftMargin, rightMargin, topMargin, bottomMargin, orientation, skipBlankPages, width, height, xResolution, yResolution, pageIndex, pageCount, folder, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for putPdfInStorageToXls + * @param name The document name. (required) + * @param outPath Full resulting filename (ex. /folder1/folder2/result.xls) (required) + * @param insertBlankColumnAtFirst Insert blank column at first (optional) + * @param minimizeTheNumberOfWorksheets Minimize the number of worksheets (optional) + * @param scaleFactor Scale factor (optional) + * @param uniformWorksheets Uniform worksheets (optional) + * @param folder The document folder. (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call putPdfInStorageToXlsCall(String name, String outPath, Boolean insertBlankColumnAtFirst, Boolean minimizeTheNumberOfWorksheets, Double scaleFactor, Boolean uniformWorksheets, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/pdf/{name}/convert/xls" + .replaceAll("\\{" + "name" + "\\}", apiClient.escapeString(name.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (outPath != null) + localVarQueryParams.addAll(apiClient.parameterToPair("outPath", outPath)); + if (insertBlankColumnAtFirst != null) + localVarQueryParams.addAll(apiClient.parameterToPair("insertBlankColumnAtFirst", insertBlankColumnAtFirst)); + if (minimizeTheNumberOfWorksheets != null) + localVarQueryParams.addAll(apiClient.parameterToPair("minimizeTheNumberOfWorksheets", minimizeTheNumberOfWorksheets)); + if (scaleFactor != null) + localVarQueryParams.addAll(apiClient.parameterToPair("scaleFactor", scaleFactor)); + if (uniformWorksheets != null) + localVarQueryParams.addAll(apiClient.parameterToPair("uniformWorksheets", uniformWorksheets)); + if (folder != null) + localVarQueryParams.addAll(apiClient.parameterToPair("folder", folder)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call putPdfInStorageToXlsValidateBeforeCall(String name, String outPath, Boolean insertBlankColumnAtFirst, Boolean minimizeTheNumberOfWorksheets, Double scaleFactor, Boolean uniformWorksheets, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException("Missing the required parameter 'name' when calling putPdfInStorageToXls(Async)"); + } + + // verify the required parameter 'outPath' is set + if (outPath == null) { + throw new ApiException("Missing the required parameter 'outPath' when calling putPdfInStorageToXls(Async)"); + } + + + com.squareup.okhttp.Call call = putPdfInStorageToXlsCall(name, outPath, insertBlankColumnAtFirst, minimizeTheNumberOfWorksheets, scaleFactor, uniformWorksheets, folder, progressListener, progressRequestListener); + return call; + + } + + /** + * Converts PDF document (located on storage) to XLS format and uploads resulting file to storage + * + * @param name The document name. (required) + * @param outPath Full resulting filename (ex. /folder1/folder2/result.xls) (required) + * @param insertBlankColumnAtFirst Insert blank column at first (optional) + * @param minimizeTheNumberOfWorksheets Minimize the number of worksheets (optional) + * @param scaleFactor Scale factor (optional) + * @param uniformWorksheets Uniform worksheets (optional) + * @param folder The document folder. (optional) + * @return SaaSposeResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public SaaSposeResponse putPdfInStorageToXls(String name, String outPath, Boolean insertBlankColumnAtFirst, Boolean minimizeTheNumberOfWorksheets, Double scaleFactor, Boolean uniformWorksheets, String folder) throws ApiException { + ApiResponse resp = putPdfInStorageToXlsWithHttpInfo(name, outPath, insertBlankColumnAtFirst, minimizeTheNumberOfWorksheets, scaleFactor, uniformWorksheets, folder); + return resp.getData(); + } + + /** + * Converts PDF document (located on storage) to XLS format and uploads resulting file to storage + * + * @param name The document name. (required) + * @param outPath Full resulting filename (ex. /folder1/folder2/result.xls) (required) + * @param insertBlankColumnAtFirst Insert blank column at first (optional) + * @param minimizeTheNumberOfWorksheets Minimize the number of worksheets (optional) + * @param scaleFactor Scale factor (optional) + * @param uniformWorksheets Uniform worksheets (optional) + * @param folder The document folder. (optional) + * @return ApiResponse<SaaSposeResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse putPdfInStorageToXlsWithHttpInfo(String name, String outPath, Boolean insertBlankColumnAtFirst, Boolean minimizeTheNumberOfWorksheets, Double scaleFactor, Boolean uniformWorksheets, String folder) throws ApiException { + com.squareup.okhttp.Call call = putPdfInStorageToXlsValidateBeforeCall(name, outPath, insertBlankColumnAtFirst, minimizeTheNumberOfWorksheets, scaleFactor, uniformWorksheets, folder, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Converts PDF document (located on storage) to XLS format and uploads resulting file to storage (asynchronously) + * + * @param name The document name. (required) + * @param outPath Full resulting filename (ex. /folder1/folder2/result.xls) (required) + * @param insertBlankColumnAtFirst Insert blank column at first (optional) + * @param minimizeTheNumberOfWorksheets Minimize the number of worksheets (optional) + * @param scaleFactor Scale factor (optional) + * @param uniformWorksheets Uniform worksheets (optional) + * @param folder The document folder. (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call putPdfInStorageToXlsAsync(String name, String outPath, Boolean insertBlankColumnAtFirst, Boolean minimizeTheNumberOfWorksheets, Double scaleFactor, Boolean uniformWorksheets, String folder, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = putPdfInStorageToXlsValidateBeforeCall(name, outPath, insertBlankColumnAtFirst, minimizeTheNumberOfWorksheets, scaleFactor, uniformWorksheets, folder, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for putPdfInStorageToXml + * @param name The document name. (required) + * @param outPath Full resulting filename (ex. /folder1/folder2/result.xml) (required) + * @param folder The document folder. (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call putPdfInStorageToXmlCall(String name, String outPath, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/pdf/{name}/convert/xml" + .replaceAll("\\{" + "name" + "\\}", apiClient.escapeString(name.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (outPath != null) + localVarQueryParams.addAll(apiClient.parameterToPair("outPath", outPath)); + if (folder != null) + localVarQueryParams.addAll(apiClient.parameterToPair("folder", folder)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call putPdfInStorageToXmlValidateBeforeCall(String name, String outPath, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException("Missing the required parameter 'name' when calling putPdfInStorageToXml(Async)"); + } + + // verify the required parameter 'outPath' is set + if (outPath == null) { + throw new ApiException("Missing the required parameter 'outPath' when calling putPdfInStorageToXml(Async)"); + } + + + com.squareup.okhttp.Call call = putPdfInStorageToXmlCall(name, outPath, folder, progressListener, progressRequestListener); + return call; + + } + + /** + * Converts PDF document (located on storage) to XML format and uploads resulting file to storage + * + * @param name The document name. (required) + * @param outPath Full resulting filename (ex. /folder1/folder2/result.xml) (required) + * @param folder The document folder. (optional) + * @return SaaSposeResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public SaaSposeResponse putPdfInStorageToXml(String name, String outPath, String folder) throws ApiException { + ApiResponse resp = putPdfInStorageToXmlWithHttpInfo(name, outPath, folder); + return resp.getData(); + } + + /** + * Converts PDF document (located on storage) to XML format and uploads resulting file to storage + * + * @param name The document name. (required) + * @param outPath Full resulting filename (ex. /folder1/folder2/result.xml) (required) + * @param folder The document folder. (optional) + * @return ApiResponse<SaaSposeResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse putPdfInStorageToXmlWithHttpInfo(String name, String outPath, String folder) throws ApiException { + com.squareup.okhttp.Call call = putPdfInStorageToXmlValidateBeforeCall(name, outPath, folder, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Converts PDF document (located on storage) to XML format and uploads resulting file to storage (asynchronously) + * + * @param name The document name. (required) + * @param outPath Full resulting filename (ex. /folder1/folder2/result.xml) (required) + * @param folder The document folder. (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call putPdfInStorageToXmlAsync(String name, String outPath, String folder, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = putPdfInStorageToXmlValidateBeforeCall(name, outPath, folder, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for putPdfInStorageToXps + * @param name The document name. (required) + * @param outPath Full resulting filename (ex. /folder1/folder2/result.xps) (required) + * @param folder The document folder. (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call putPdfInStorageToXpsCall(String name, String outPath, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/pdf/{name}/convert/xps" + .replaceAll("\\{" + "name" + "\\}", apiClient.escapeString(name.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (outPath != null) + localVarQueryParams.addAll(apiClient.parameterToPair("outPath", outPath)); + if (folder != null) + localVarQueryParams.addAll(apiClient.parameterToPair("folder", folder)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call putPdfInStorageToXpsValidateBeforeCall(String name, String outPath, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException("Missing the required parameter 'name' when calling putPdfInStorageToXps(Async)"); + } + + // verify the required parameter 'outPath' is set + if (outPath == null) { + throw new ApiException("Missing the required parameter 'outPath' when calling putPdfInStorageToXps(Async)"); + } + + + com.squareup.okhttp.Call call = putPdfInStorageToXpsCall(name, outPath, folder, progressListener, progressRequestListener); + return call; + + } + + /** + * Converts PDF document (located on storage) to XPS format and uploads resulting file to storage + * + * @param name The document name. (required) + * @param outPath Full resulting filename (ex. /folder1/folder2/result.xps) (required) + * @param folder The document folder. (optional) + * @return SaaSposeResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public SaaSposeResponse putPdfInStorageToXps(String name, String outPath, String folder) throws ApiException { + ApiResponse resp = putPdfInStorageToXpsWithHttpInfo(name, outPath, folder); + return resp.getData(); + } + + /** + * Converts PDF document (located on storage) to XPS format and uploads resulting file to storage + * + * @param name The document name. (required) + * @param outPath Full resulting filename (ex. /folder1/folder2/result.xps) (required) + * @param folder The document folder. (optional) + * @return ApiResponse<SaaSposeResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse putPdfInStorageToXpsWithHttpInfo(String name, String outPath, String folder) throws ApiException { + com.squareup.okhttp.Call call = putPdfInStorageToXpsValidateBeforeCall(name, outPath, folder, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Converts PDF document (located on storage) to XPS format and uploads resulting file to storage (asynchronously) + * + * @param name The document name. (required) + * @param outPath Full resulting filename (ex. /folder1/folder2/result.xps) (required) + * @param folder The document folder. (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call putPdfInStorageToXpsAsync(String name, String outPath, String folder, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = putPdfInStorageToXpsValidateBeforeCall(name, outPath, folder, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for putPrivileges + * @param name The document name. (required) + * @param privileges Document privileges. (optional) + * @param folder The document folder. (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call putPrivilegesCall(String name, DocumentPrivilege privileges, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = privileges; + + // create path and map variables + String localVarPath = "/pdf/{name}/privileges" + .replaceAll("\\{" + "name" + "\\}", apiClient.escapeString(name.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (folder != null) + localVarQueryParams.addAll(apiClient.parameterToPair("folder", folder)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call putPrivilegesValidateBeforeCall(String name, DocumentPrivilege privileges, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException("Missing the required parameter 'name' when calling putPrivileges(Async)"); + } + + + com.squareup.okhttp.Call call = putPrivilegesCall(name, privileges, folder, progressListener, progressRequestListener); + return call; + + } + + /** + * Update privilege document. + * + * @param name The document name. (required) + * @param privileges Document privileges. (optional) + * @param folder The document folder. (optional) + * @return SaaSposeResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public SaaSposeResponse putPrivileges(String name, DocumentPrivilege privileges, String folder) throws ApiException { + ApiResponse resp = putPrivilegesWithHttpInfo(name, privileges, folder); + return resp.getData(); + } + + /** + * Update privilege document. + * + * @param name The document name. (required) + * @param privileges Document privileges. (optional) + * @param folder The document folder. (optional) + * @return ApiResponse<SaaSposeResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse putPrivilegesWithHttpInfo(String name, DocumentPrivilege privileges, String folder) throws ApiException { + com.squareup.okhttp.Call call = putPrivilegesValidateBeforeCall(name, privileges, folder, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Update privilege document. (asynchronously) + * + * @param name The document name. (required) + * @param privileges Document privileges. (optional) + * @param folder The document folder. (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call putPrivilegesAsync(String name, DocumentPrivilege privileges, String folder, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = putPrivilegesValidateBeforeCall(name, privileges, folder, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for putSearchableDocument + * @param name The document name. (required) + * @param storage The document storage. (optional) + * @param folder The document folder. (optional) + * @param lang language for OCR engine. Possible values: eng, ara, bel, ben, bul, ces, dan, deu, ell, fin, fra, heb, hin, ind, isl, ita, jpn, kor, nld, nor, pol, por, ron, rus, spa, swe, tha, tur, ukr, vie, chi_sim, chi_tra or thier combination e.g. eng,rus (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call putSearchableDocumentCall(String name, String storage, String folder, String lang, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/pdf/{name}/ocr" + .replaceAll("\\{" + "name" + "\\}", apiClient.escapeString(name.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (storage != null) + localVarQueryParams.addAll(apiClient.parameterToPair("storage", storage)); + if (folder != null) + localVarQueryParams.addAll(apiClient.parameterToPair("folder", folder)); + if (lang != null) + localVarQueryParams.addAll(apiClient.parameterToPair("lang", lang)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call putSearchableDocumentValidateBeforeCall(String name, String storage, String folder, String lang, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException("Missing the required parameter 'name' when calling putSearchableDocument(Async)"); + } + + + com.squareup.okhttp.Call call = putSearchableDocumentCall(name, storage, folder, lang, progressListener, progressRequestListener); + return call; + + } + + /** + * Create searchable PDF document. Generate OCR layer for images in input PDF document. + * + * @param name The document name. (required) + * @param storage The document storage. (optional) + * @param folder The document folder. (optional) + * @param lang language for OCR engine. Possible values: eng, ara, bel, ben, bul, ces, dan, deu, ell, fin, fra, heb, hin, ind, isl, ita, jpn, kor, nld, nor, pol, por, ron, rus, spa, swe, tha, tur, ukr, vie, chi_sim, chi_tra or thier combination e.g. eng,rus (optional) + * @return SaaSposeResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public SaaSposeResponse putSearchableDocument(String name, String storage, String folder, String lang) throws ApiException { + ApiResponse resp = putSearchableDocumentWithHttpInfo(name, storage, folder, lang); + return resp.getData(); + } + + /** + * Create searchable PDF document. Generate OCR layer for images in input PDF document. + * + * @param name The document name. (required) + * @param storage The document storage. (optional) + * @param folder The document folder. (optional) + * @param lang language for OCR engine. Possible values: eng, ara, bel, ben, bul, ces, dan, deu, ell, fin, fra, heb, hin, ind, isl, ita, jpn, kor, nld, nor, pol, por, ron, rus, spa, swe, tha, tur, ukr, vie, chi_sim, chi_tra or thier combination e.g. eng,rus (optional) + * @return ApiResponse<SaaSposeResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse putSearchableDocumentWithHttpInfo(String name, String storage, String folder, String lang) throws ApiException { + com.squareup.okhttp.Call call = putSearchableDocumentValidateBeforeCall(name, storage, folder, lang, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Create searchable PDF document. Generate OCR layer for images in input PDF document. (asynchronously) + * + * @param name The document name. (required) + * @param storage The document storage. (optional) + * @param folder The document folder. (optional) + * @param lang language for OCR engine. Possible values: eng, ara, bel, ben, bul, ces, dan, deu, ell, fin, fra, heb, hin, ind, isl, ita, jpn, kor, nld, nor, pol, por, ron, rus, spa, swe, tha, tur, ukr, vie, chi_sim, chi_tra or thier combination e.g. eng,rus (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call putSearchableDocumentAsync(String name, String storage, String folder, String lang, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = putSearchableDocumentValidateBeforeCall(name, storage, folder, lang, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for putSetProperty + * @param name (required) + * @param propertyName (required) + * @param property (optional) + * @param storage (optional) + * @param folder (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call putSetPropertyCall(String name, String propertyName, DocumentProperty property, String storage, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = property; + + // create path and map variables + String localVarPath = "/pdf/{name}/documentproperties/{propertyName}" + .replaceAll("\\{" + "name" + "\\}", apiClient.escapeString(name.toString())) + .replaceAll("\\{" + "propertyName" + "\\}", apiClient.escapeString(propertyName.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (storage != null) + localVarQueryParams.addAll(apiClient.parameterToPair("storage", storage)); + if (folder != null) + localVarQueryParams.addAll(apiClient.parameterToPair("folder", folder)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call putSetPropertyValidateBeforeCall(String name, String propertyName, DocumentProperty property, String storage, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException("Missing the required parameter 'name' when calling putSetProperty(Async)"); + } + + // verify the required parameter 'propertyName' is set + if (propertyName == null) { + throw new ApiException("Missing the required parameter 'propertyName' when calling putSetProperty(Async)"); + } + + + com.squareup.okhttp.Call call = putSetPropertyCall(name, propertyName, property, storage, folder, progressListener, progressRequestListener); + return call; + + } + + /** + * Add/update document property. + * + * @param name (required) + * @param propertyName (required) + * @param property (optional) + * @param storage (optional) + * @param folder (optional) + * @return DocumentPropertyResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public DocumentPropertyResponse putSetProperty(String name, String propertyName, DocumentProperty property, String storage, String folder) throws ApiException { + ApiResponse resp = putSetPropertyWithHttpInfo(name, propertyName, property, storage, folder); + return resp.getData(); + } + + /** + * Add/update document property. + * + * @param name (required) + * @param propertyName (required) + * @param property (optional) + * @param storage (optional) + * @param folder (optional) + * @return ApiResponse<DocumentPropertyResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse putSetPropertyWithHttpInfo(String name, String propertyName, DocumentProperty property, String storage, String folder) throws ApiException { + com.squareup.okhttp.Call call = putSetPropertyValidateBeforeCall(name, propertyName, property, storage, folder, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Add/update document property. (asynchronously) + * + * @param name (required) + * @param propertyName (required) + * @param property (optional) + * @param storage (optional) + * @param folder (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call putSetPropertyAsync(String name, String propertyName, DocumentProperty property, String storage, String folder, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = putSetPropertyValidateBeforeCall(name, propertyName, property, storage, folder, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for putSvgInStorageToPdf + * @param name The document name. (required) + * @param srcPath Full source filename (ex. /folder1/folder2/template.svg) (required) + * @param adjustPageSize Adjust page size (optional) + * @param height Page height (optional) + * @param width Page width (optional) + * @param isLandscape Is page landscaped (optional) + * @param marginLeft Page margin left (optional) + * @param marginBottom Page margin bottom (optional) + * @param marginRight Page margin right (optional) + * @param marginTop Page margin top (optional) + * @param dstFolder The destination document folder. (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call putSvgInStorageToPdfCall(String name, String srcPath, Boolean adjustPageSize, Double height, Double width, Boolean isLandscape, Double marginLeft, Double marginBottom, Double marginRight, Double marginTop, String dstFolder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/pdf/{name}/create/svg" + .replaceAll("\\{" + "name" + "\\}", apiClient.escapeString(name.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (srcPath != null) + localVarQueryParams.addAll(apiClient.parameterToPair("srcPath", srcPath)); + if (adjustPageSize != null) + localVarQueryParams.addAll(apiClient.parameterToPair("adjustPageSize", adjustPageSize)); + if (height != null) + localVarQueryParams.addAll(apiClient.parameterToPair("height", height)); + if (width != null) + localVarQueryParams.addAll(apiClient.parameterToPair("width", width)); + if (isLandscape != null) + localVarQueryParams.addAll(apiClient.parameterToPair("isLandscape", isLandscape)); + if (marginLeft != null) + localVarQueryParams.addAll(apiClient.parameterToPair("marginLeft", marginLeft)); + if (marginBottom != null) + localVarQueryParams.addAll(apiClient.parameterToPair("marginBottom", marginBottom)); + if (marginRight != null) + localVarQueryParams.addAll(apiClient.parameterToPair("marginRight", marginRight)); + if (marginTop != null) + localVarQueryParams.addAll(apiClient.parameterToPair("marginTop", marginTop)); + if (dstFolder != null) + localVarQueryParams.addAll(apiClient.parameterToPair("dstFolder", dstFolder)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call putSvgInStorageToPdfValidateBeforeCall(String name, String srcPath, Boolean adjustPageSize, Double height, Double width, Boolean isLandscape, Double marginLeft, Double marginBottom, Double marginRight, Double marginTop, String dstFolder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException("Missing the required parameter 'name' when calling putSvgInStorageToPdf(Async)"); + } + + // verify the required parameter 'srcPath' is set + if (srcPath == null) { + throw new ApiException("Missing the required parameter 'srcPath' when calling putSvgInStorageToPdf(Async)"); + } + + + com.squareup.okhttp.Call call = putSvgInStorageToPdfCall(name, srcPath, adjustPageSize, height, width, isLandscape, marginLeft, marginBottom, marginRight, marginTop, dstFolder, progressListener, progressRequestListener); + return call; + + } + + /** + * Convert SVG file (located on storage) to PDF format and upload resulting file to storage. + * + * @param name The document name. (required) + * @param srcPath Full source filename (ex. /folder1/folder2/template.svg) (required) + * @param adjustPageSize Adjust page size (optional) + * @param height Page height (optional) + * @param width Page width (optional) + * @param isLandscape Is page landscaped (optional) + * @param marginLeft Page margin left (optional) + * @param marginBottom Page margin bottom (optional) + * @param marginRight Page margin right (optional) + * @param marginTop Page margin top (optional) + * @param dstFolder The destination document folder. (optional) + * @return SaaSposeResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public SaaSposeResponse putSvgInStorageToPdf(String name, String srcPath, Boolean adjustPageSize, Double height, Double width, Boolean isLandscape, Double marginLeft, Double marginBottom, Double marginRight, Double marginTop, String dstFolder) throws ApiException { + ApiResponse resp = putSvgInStorageToPdfWithHttpInfo(name, srcPath, adjustPageSize, height, width, isLandscape, marginLeft, marginBottom, marginRight, marginTop, dstFolder); + return resp.getData(); + } + + /** + * Convert SVG file (located on storage) to PDF format and upload resulting file to storage. + * + * @param name The document name. (required) + * @param srcPath Full source filename (ex. /folder1/folder2/template.svg) (required) + * @param adjustPageSize Adjust page size (optional) + * @param height Page height (optional) + * @param width Page width (optional) + * @param isLandscape Is page landscaped (optional) + * @param marginLeft Page margin left (optional) + * @param marginBottom Page margin bottom (optional) + * @param marginRight Page margin right (optional) + * @param marginTop Page margin top (optional) + * @param dstFolder The destination document folder. (optional) + * @return ApiResponse<SaaSposeResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse putSvgInStorageToPdfWithHttpInfo(String name, String srcPath, Boolean adjustPageSize, Double height, Double width, Boolean isLandscape, Double marginLeft, Double marginBottom, Double marginRight, Double marginTop, String dstFolder) throws ApiException { + com.squareup.okhttp.Call call = putSvgInStorageToPdfValidateBeforeCall(name, srcPath, adjustPageSize, height, width, isLandscape, marginLeft, marginBottom, marginRight, marginTop, dstFolder, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Convert SVG file (located on storage) to PDF format and upload resulting file to storage. (asynchronously) + * + * @param name The document name. (required) + * @param srcPath Full source filename (ex. /folder1/folder2/template.svg) (required) + * @param adjustPageSize Adjust page size (optional) + * @param height Page height (optional) + * @param width Page width (optional) + * @param isLandscape Is page landscaped (optional) + * @param marginLeft Page margin left (optional) + * @param marginBottom Page margin bottom (optional) + * @param marginRight Page margin right (optional) + * @param marginTop Page margin top (optional) + * @param dstFolder The destination document folder. (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call putSvgInStorageToPdfAsync(String name, String srcPath, Boolean adjustPageSize, Double height, Double width, Boolean isLandscape, Double marginLeft, Double marginBottom, Double marginRight, Double marginTop, String dstFolder, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = putSvgInStorageToPdfValidateBeforeCall(name, srcPath, adjustPageSize, height, width, isLandscape, marginLeft, marginBottom, marginRight, marginTop, dstFolder, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for putUpdateField + * @param name The document name. (required) + * @param fieldName The name of a field to be updated. (required) + * @param field with the field data. (optional) + * @param storage The document storage. (optional) + * @param folder The document folder. (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call putUpdateFieldCall(String name, String fieldName, Field field, String storage, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = field; + + // create path and map variables + String localVarPath = "/pdf/{name}/fields/{fieldName}" + .replaceAll("\\{" + "name" + "\\}", apiClient.escapeString(name.toString())) + .replaceAll("\\{" + "fieldName" + "\\}", apiClient.escapeString(fieldName.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (storage != null) + localVarQueryParams.addAll(apiClient.parameterToPair("storage", storage)); + if (folder != null) + localVarQueryParams.addAll(apiClient.parameterToPair("folder", folder)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call putUpdateFieldValidateBeforeCall(String name, String fieldName, Field field, String storage, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException("Missing the required parameter 'name' when calling putUpdateField(Async)"); + } + + // verify the required parameter 'fieldName' is set + if (fieldName == null) { + throw new ApiException("Missing the required parameter 'fieldName' when calling putUpdateField(Async)"); + } + + + com.squareup.okhttp.Call call = putUpdateFieldCall(name, fieldName, field, storage, folder, progressListener, progressRequestListener); + return call; + + } + + /** + * Update field. + * + * @param name The document name. (required) + * @param fieldName The name of a field to be updated. (required) + * @param field with the field data. (optional) + * @param storage The document storage. (optional) + * @param folder The document folder. (optional) + * @return FieldResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public FieldResponse putUpdateField(String name, String fieldName, Field field, String storage, String folder) throws ApiException { + ApiResponse resp = putUpdateFieldWithHttpInfo(name, fieldName, field, storage, folder); + return resp.getData(); + } + + /** + * Update field. + * + * @param name The document name. (required) + * @param fieldName The name of a field to be updated. (required) + * @param field with the field data. (optional) + * @param storage The document storage. (optional) + * @param folder The document folder. (optional) + * @return ApiResponse<FieldResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse putUpdateFieldWithHttpInfo(String name, String fieldName, Field field, String storage, String folder) throws ApiException { + com.squareup.okhttp.Call call = putUpdateFieldValidateBeforeCall(name, fieldName, field, storage, folder, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Update field. (asynchronously) + * + * @param name The document name. (required) + * @param fieldName The name of a field to be updated. (required) + * @param field with the field data. (optional) + * @param storage The document storage. (optional) + * @param folder The document folder. (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call putUpdateFieldAsync(String name, String fieldName, Field field, String storage, String folder, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = putUpdateFieldValidateBeforeCall(name, fieldName, field, storage, folder, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for putUpdateFields + * @param name The document name. (required) + * @param fields with the fields data. (optional) + * @param storage The document storage. (optional) + * @param folder The document folder. (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call putUpdateFieldsCall(String name, Fields fields, String storage, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = fields; + + // create path and map variables + String localVarPath = "/pdf/{name}/fields" + .replaceAll("\\{" + "name" + "\\}", apiClient.escapeString(name.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (storage != null) + localVarQueryParams.addAll(apiClient.parameterToPair("storage", storage)); + if (folder != null) + localVarQueryParams.addAll(apiClient.parameterToPair("folder", folder)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call putUpdateFieldsValidateBeforeCall(String name, Fields fields, String storage, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException("Missing the required parameter 'name' when calling putUpdateFields(Async)"); + } + + + com.squareup.okhttp.Call call = putUpdateFieldsCall(name, fields, storage, folder, progressListener, progressRequestListener); + return call; + + } + + /** + * Update fields. + * + * @param name The document name. (required) + * @param fields with the fields data. (optional) + * @param storage The document storage. (optional) + * @param folder The document folder. (optional) + * @return FieldsResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public FieldsResponse putUpdateFields(String name, Fields fields, String storage, String folder) throws ApiException { + ApiResponse resp = putUpdateFieldsWithHttpInfo(name, fields, storage, folder); + return resp.getData(); + } + + /** + * Update fields. + * + * @param name The document name. (required) + * @param fields with the fields data. (optional) + * @param storage The document storage. (optional) + * @param folder The document folder. (optional) + * @return ApiResponse<FieldsResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse putUpdateFieldsWithHttpInfo(String name, Fields fields, String storage, String folder) throws ApiException { + com.squareup.okhttp.Call call = putUpdateFieldsValidateBeforeCall(name, fields, storage, folder, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Update fields. (asynchronously) + * + * @param name The document name. (required) + * @param fields with the fields data. (optional) + * @param storage The document storage. (optional) + * @param folder The document folder. (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call putUpdateFieldsAsync(String name, Fields fields, String storage, String folder, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = putUpdateFieldsValidateBeforeCall(name, fields, storage, folder, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for putWebInStorageToPdf + * @param name The document name. (required) + * @param url Source url (required) + * @param height Page height (optional) + * @param width Page width (optional) + * @param isLandscape Is page landscaped (optional) + * @param marginLeft Page margin left (optional) + * @param marginBottom Page margin bottom (optional) + * @param marginRight Page margin right (optional) + * @param marginTop Page margin top (optional) + * @param dstFolder The destination document folder. (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call putWebInStorageToPdfCall(String name, String url, Double height, Double width, Boolean isLandscape, Double marginLeft, Double marginBottom, Double marginRight, Double marginTop, String dstFolder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/pdf/{name}/create/web" + .replaceAll("\\{" + "name" + "\\}", apiClient.escapeString(name.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (url != null) + localVarQueryParams.addAll(apiClient.parameterToPair("url", url)); + if (height != null) + localVarQueryParams.addAll(apiClient.parameterToPair("height", height)); + if (width != null) + localVarQueryParams.addAll(apiClient.parameterToPair("width", width)); + if (isLandscape != null) + localVarQueryParams.addAll(apiClient.parameterToPair("isLandscape", isLandscape)); + if (marginLeft != null) + localVarQueryParams.addAll(apiClient.parameterToPair("marginLeft", marginLeft)); + if (marginBottom != null) + localVarQueryParams.addAll(apiClient.parameterToPair("marginBottom", marginBottom)); + if (marginRight != null) + localVarQueryParams.addAll(apiClient.parameterToPair("marginRight", marginRight)); + if (marginTop != null) + localVarQueryParams.addAll(apiClient.parameterToPair("marginTop", marginTop)); + if (dstFolder != null) + localVarQueryParams.addAll(apiClient.parameterToPair("dstFolder", dstFolder)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call putWebInStorageToPdfValidateBeforeCall(String name, String url, Double height, Double width, Boolean isLandscape, Double marginLeft, Double marginBottom, Double marginRight, Double marginTop, String dstFolder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException("Missing the required parameter 'name' when calling putWebInStorageToPdf(Async)"); + } + + // verify the required parameter 'url' is set + if (url == null) { + throw new ApiException("Missing the required parameter 'url' when calling putWebInStorageToPdf(Async)"); + } + + + com.squareup.okhttp.Call call = putWebInStorageToPdfCall(name, url, height, width, isLandscape, marginLeft, marginBottom, marginRight, marginTop, dstFolder, progressListener, progressRequestListener); + return call; + + } + + /** + * Convert web page to PDF format and upload resulting file to storage. + * + * @param name The document name. (required) + * @param url Source url (required) + * @param height Page height (optional) + * @param width Page width (optional) + * @param isLandscape Is page landscaped (optional) + * @param marginLeft Page margin left (optional) + * @param marginBottom Page margin bottom (optional) + * @param marginRight Page margin right (optional) + * @param marginTop Page margin top (optional) + * @param dstFolder The destination document folder. (optional) + * @return SaaSposeResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public SaaSposeResponse putWebInStorageToPdf(String name, String url, Double height, Double width, Boolean isLandscape, Double marginLeft, Double marginBottom, Double marginRight, Double marginTop, String dstFolder) throws ApiException { + ApiResponse resp = putWebInStorageToPdfWithHttpInfo(name, url, height, width, isLandscape, marginLeft, marginBottom, marginRight, marginTop, dstFolder); + return resp.getData(); + } + + /** + * Convert web page to PDF format and upload resulting file to storage. + * + * @param name The document name. (required) + * @param url Source url (required) + * @param height Page height (optional) + * @param width Page width (optional) + * @param isLandscape Is page landscaped (optional) + * @param marginLeft Page margin left (optional) + * @param marginBottom Page margin bottom (optional) + * @param marginRight Page margin right (optional) + * @param marginTop Page margin top (optional) + * @param dstFolder The destination document folder. (optional) + * @return ApiResponse<SaaSposeResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse putWebInStorageToPdfWithHttpInfo(String name, String url, Double height, Double width, Boolean isLandscape, Double marginLeft, Double marginBottom, Double marginRight, Double marginTop, String dstFolder) throws ApiException { + com.squareup.okhttp.Call call = putWebInStorageToPdfValidateBeforeCall(name, url, height, width, isLandscape, marginLeft, marginBottom, marginRight, marginTop, dstFolder, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Convert web page to PDF format and upload resulting file to storage. (asynchronously) + * + * @param name The document name. (required) + * @param url Source url (required) + * @param height Page height (optional) + * @param width Page width (optional) + * @param isLandscape Is page landscaped (optional) + * @param marginLeft Page margin left (optional) + * @param marginBottom Page margin bottom (optional) + * @param marginRight Page margin right (optional) + * @param marginTop Page margin top (optional) + * @param dstFolder The destination document folder. (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call putWebInStorageToPdfAsync(String name, String url, Double height, Double width, Boolean isLandscape, Double marginLeft, Double marginBottom, Double marginRight, Double marginTop, String dstFolder, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = putWebInStorageToPdfValidateBeforeCall(name, url, height, width, isLandscape, marginLeft, marginBottom, marginRight, marginTop, dstFolder, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for putXfaPdfInRequestToAcroForm + * @param outPath Full resulting filename (ex. /folder1/folder2/result.pdf) (required) + * @param file A file to be converted. (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call putXfaPdfInRequestToAcroFormCall(String outPath, File file, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = file; + + // create path and map variables + String localVarPath = "/pdf/convert/xfatoacroform"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (outPath != null) + localVarQueryParams.addAll(apiClient.parameterToPair("outPath", outPath)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call putXfaPdfInRequestToAcroFormValidateBeforeCall(String outPath, File file, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + // verify the required parameter 'outPath' is set + if (outPath == null) { + throw new ApiException("Missing the required parameter 'outPath' when calling putXfaPdfInRequestToAcroForm(Async)"); + } + + + com.squareup.okhttp.Call call = putXfaPdfInRequestToAcroFormCall(outPath, file, progressListener, progressRequestListener); + return call; + + } + + /** + * Converts PDF document which contatins XFA form (in request content) to PDF with AcroForm and uploads resulting file to storage. + * + * @param outPath Full resulting filename (ex. /folder1/folder2/result.pdf) (required) + * @param file A file to be converted. (optional) + * @return SaaSposeResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public SaaSposeResponse putXfaPdfInRequestToAcroForm(String outPath, File file) throws ApiException { + ApiResponse resp = putXfaPdfInRequestToAcroFormWithHttpInfo(outPath, file); + return resp.getData(); + } + + /** + * Converts PDF document which contatins XFA form (in request content) to PDF with AcroForm and uploads resulting file to storage. + * + * @param outPath Full resulting filename (ex. /folder1/folder2/result.pdf) (required) + * @param file A file to be converted. (optional) + * @return ApiResponse<SaaSposeResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse putXfaPdfInRequestToAcroFormWithHttpInfo(String outPath, File file) throws ApiException { + com.squareup.okhttp.Call call = putXfaPdfInRequestToAcroFormValidateBeforeCall(outPath, file, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Converts PDF document which contatins XFA form (in request content) to PDF with AcroForm and uploads resulting file to storage. (asynchronously) + * + * @param outPath Full resulting filename (ex. /folder1/folder2/result.pdf) (required) + * @param file A file to be converted. (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call putXfaPdfInRequestToAcroFormAsync(String outPath, File file, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = putXfaPdfInRequestToAcroFormValidateBeforeCall(outPath, file, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for putXfaPdfInStorageToAcroForm + * @param name The document name. (required) + * @param outPath Full resulting filename (ex. /folder1/folder2/result.pdf) (required) + * @param folder The document folder. (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call putXfaPdfInStorageToAcroFormCall(String name, String outPath, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/pdf/{name}/convert/xfatoacroform" + .replaceAll("\\{" + "name" + "\\}", apiClient.escapeString(name.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (outPath != null) + localVarQueryParams.addAll(apiClient.parameterToPair("outPath", outPath)); + if (folder != null) + localVarQueryParams.addAll(apiClient.parameterToPair("folder", folder)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call putXfaPdfInStorageToAcroFormValidateBeforeCall(String name, String outPath, String folder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException("Missing the required parameter 'name' when calling putXfaPdfInStorageToAcroForm(Async)"); + } + + // verify the required parameter 'outPath' is set + if (outPath == null) { + throw new ApiException("Missing the required parameter 'outPath' when calling putXfaPdfInStorageToAcroForm(Async)"); + } + + + com.squareup.okhttp.Call call = putXfaPdfInStorageToAcroFormCall(name, outPath, folder, progressListener, progressRequestListener); + return call; + + } + + /** + * Converts PDF document which contatins XFA form (located on storage) to PDF with AcroForm and uploads resulting file to storage + * + * @param name The document name. (required) + * @param outPath Full resulting filename (ex. /folder1/folder2/result.pdf) (required) + * @param folder The document folder. (optional) + * @return SaaSposeResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public SaaSposeResponse putXfaPdfInStorageToAcroForm(String name, String outPath, String folder) throws ApiException { + ApiResponse resp = putXfaPdfInStorageToAcroFormWithHttpInfo(name, outPath, folder); + return resp.getData(); + } + + /** + * Converts PDF document which contatins XFA form (located on storage) to PDF with AcroForm and uploads resulting file to storage + * + * @param name The document name. (required) + * @param outPath Full resulting filename (ex. /folder1/folder2/result.pdf) (required) + * @param folder The document folder. (optional) + * @return ApiResponse<SaaSposeResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse putXfaPdfInStorageToAcroFormWithHttpInfo(String name, String outPath, String folder) throws ApiException { + com.squareup.okhttp.Call call = putXfaPdfInStorageToAcroFormValidateBeforeCall(name, outPath, folder, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Converts PDF document which contatins XFA form (located on storage) to PDF with AcroForm and uploads resulting file to storage (asynchronously) + * + * @param name The document name. (required) + * @param outPath Full resulting filename (ex. /folder1/folder2/result.pdf) (required) + * @param folder The document folder. (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call putXfaPdfInStorageToAcroFormAsync(String name, String outPath, String folder, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = putXfaPdfInStorageToAcroFormValidateBeforeCall(name, outPath, folder, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for putXmlInStorageToPdf + * @param name The document name. (required) + * @param srcPath Full source filename (ex. /folder1/folder2/template.xml) (required) + * @param xslFilePath Full XSL source filename (ex. /folder1/folder2/template.xsl) (optional) + * @param dstFolder The destination document folder. (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call putXmlInStorageToPdfCall(String name, String srcPath, String xslFilePath, String dstFolder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/pdf/{name}/create/xml" + .replaceAll("\\{" + "name" + "\\}", apiClient.escapeString(name.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (srcPath != null) + localVarQueryParams.addAll(apiClient.parameterToPair("srcPath", srcPath)); + if (xslFilePath != null) + localVarQueryParams.addAll(apiClient.parameterToPair("xslFilePath", xslFilePath)); + if (dstFolder != null) + localVarQueryParams.addAll(apiClient.parameterToPair("dstFolder", dstFolder)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call putXmlInStorageToPdfValidateBeforeCall(String name, String srcPath, String xslFilePath, String dstFolder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException("Missing the required parameter 'name' when calling putXmlInStorageToPdf(Async)"); + } + + // verify the required parameter 'srcPath' is set + if (srcPath == null) { + throw new ApiException("Missing the required parameter 'srcPath' when calling putXmlInStorageToPdf(Async)"); + } + + + com.squareup.okhttp.Call call = putXmlInStorageToPdfCall(name, srcPath, xslFilePath, dstFolder, progressListener, progressRequestListener); + return call; + + } + + /** + * Convert XML file (located on storage) to PDF format and upload resulting file to storage. + * + * @param name The document name. (required) + * @param srcPath Full source filename (ex. /folder1/folder2/template.xml) (required) + * @param xslFilePath Full XSL source filename (ex. /folder1/folder2/template.xsl) (optional) + * @param dstFolder The destination document folder. (optional) + * @return SaaSposeResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public SaaSposeResponse putXmlInStorageToPdf(String name, String srcPath, String xslFilePath, String dstFolder) throws ApiException { + ApiResponse resp = putXmlInStorageToPdfWithHttpInfo(name, srcPath, xslFilePath, dstFolder); + return resp.getData(); + } + + /** + * Convert XML file (located on storage) to PDF format and upload resulting file to storage. + * + * @param name The document name. (required) + * @param srcPath Full source filename (ex. /folder1/folder2/template.xml) (required) + * @param xslFilePath Full XSL source filename (ex. /folder1/folder2/template.xsl) (optional) + * @param dstFolder The destination document folder. (optional) + * @return ApiResponse<SaaSposeResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse putXmlInStorageToPdfWithHttpInfo(String name, String srcPath, String xslFilePath, String dstFolder) throws ApiException { + com.squareup.okhttp.Call call = putXmlInStorageToPdfValidateBeforeCall(name, srcPath, xslFilePath, dstFolder, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Convert XML file (located on storage) to PDF format and upload resulting file to storage. (asynchronously) + * + * @param name The document name. (required) + * @param srcPath Full source filename (ex. /folder1/folder2/template.xml) (required) + * @param xslFilePath Full XSL source filename (ex. /folder1/folder2/template.xsl) (optional) + * @param dstFolder The destination document folder. (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call putXmlInStorageToPdfAsync(String name, String srcPath, String xslFilePath, String dstFolder, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = putXmlInStorageToPdfValidateBeforeCall(name, srcPath, xslFilePath, dstFolder, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for putXpsInStorageToPdf + * @param name The document name. (required) + * @param srcPath Full source filename (ex. /folder1/folder2/template.xps) (required) + * @param dstFolder The destination document folder. (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call putXpsInStorageToPdfCall(String name, String srcPath, String dstFolder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/pdf/{name}/create/xps" + .replaceAll("\\{" + "name" + "\\}", apiClient.escapeString(name.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (srcPath != null) + localVarQueryParams.addAll(apiClient.parameterToPair("srcPath", srcPath)); + if (dstFolder != null) + localVarQueryParams.addAll(apiClient.parameterToPair("dstFolder", dstFolder)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call putXpsInStorageToPdfValidateBeforeCall(String name, String srcPath, String dstFolder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException("Missing the required parameter 'name' when calling putXpsInStorageToPdf(Async)"); + } + + // verify the required parameter 'srcPath' is set + if (srcPath == null) { + throw new ApiException("Missing the required parameter 'srcPath' when calling putXpsInStorageToPdf(Async)"); + } + + + com.squareup.okhttp.Call call = putXpsInStorageToPdfCall(name, srcPath, dstFolder, progressListener, progressRequestListener); + return call; + + } + + /** + * Convert XPS file (located on storage) to PDF format and upload resulting file to storage. + * + * @param name The document name. (required) + * @param srcPath Full source filename (ex. /folder1/folder2/template.xps) (required) + * @param dstFolder The destination document folder. (optional) + * @return SaaSposeResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public SaaSposeResponse putXpsInStorageToPdf(String name, String srcPath, String dstFolder) throws ApiException { + ApiResponse resp = putXpsInStorageToPdfWithHttpInfo(name, srcPath, dstFolder); + return resp.getData(); + } + + /** + * Convert XPS file (located on storage) to PDF format and upload resulting file to storage. + * + * @param name The document name. (required) + * @param srcPath Full source filename (ex. /folder1/folder2/template.xps) (required) + * @param dstFolder The destination document folder. (optional) + * @return ApiResponse<SaaSposeResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse putXpsInStorageToPdfWithHttpInfo(String name, String srcPath, String dstFolder) throws ApiException { + com.squareup.okhttp.Call call = putXpsInStorageToPdfValidateBeforeCall(name, srcPath, dstFolder, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Convert XPS file (located on storage) to PDF format and upload resulting file to storage. (asynchronously) + * + * @param name The document name. (required) + * @param srcPath Full source filename (ex. /folder1/folder2/template.xps) (required) + * @param dstFolder The destination document folder. (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call putXpsInStorageToPdfAsync(String name, String srcPath, String dstFolder, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = putXpsInStorageToPdfValidateBeforeCall(name, srcPath, dstFolder, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for putXslFoInStorageToPdf + * @param name The document name. (required) + * @param srcPath Full source filename (ex. /folder1/folder2/template.xpsfo) (required) + * @param dstFolder The destination document folder. (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call putXslFoInStorageToPdfCall(String name, String srcPath, String dstFolder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/pdf/{name}/create/xslfo" + .replaceAll("\\{" + "name" + "\\}", apiClient.escapeString(name.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (srcPath != null) + localVarQueryParams.addAll(apiClient.parameterToPair("srcPath", srcPath)); + if (dstFolder != null) + localVarQueryParams.addAll(apiClient.parameterToPair("dstFolder", dstFolder)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call putXslFoInStorageToPdfValidateBeforeCall(String name, String srcPath, String dstFolder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException("Missing the required parameter 'name' when calling putXslFoInStorageToPdf(Async)"); + } + + // verify the required parameter 'srcPath' is set + if (srcPath == null) { + throw new ApiException("Missing the required parameter 'srcPath' when calling putXslFoInStorageToPdf(Async)"); + } + + + com.squareup.okhttp.Call call = putXslFoInStorageToPdfCall(name, srcPath, dstFolder, progressListener, progressRequestListener); + return call; + + } + + /** + * Convert XslFo file (located on storage) to PDF format and upload resulting file to storage. + * + * @param name The document name. (required) + * @param srcPath Full source filename (ex. /folder1/folder2/template.xpsfo) (required) + * @param dstFolder The destination document folder. (optional) + * @return SaaSposeResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public SaaSposeResponse putXslFoInStorageToPdf(String name, String srcPath, String dstFolder) throws ApiException { + ApiResponse resp = putXslFoInStorageToPdfWithHttpInfo(name, srcPath, dstFolder); + return resp.getData(); + } + + /** + * Convert XslFo file (located on storage) to PDF format and upload resulting file to storage. + * + * @param name The document name. (required) + * @param srcPath Full source filename (ex. /folder1/folder2/template.xpsfo) (required) + * @param dstFolder The destination document folder. (optional) + * @return ApiResponse<SaaSposeResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse putXslFoInStorageToPdfWithHttpInfo(String name, String srcPath, String dstFolder) throws ApiException { + com.squareup.okhttp.Call call = putXslFoInStorageToPdfValidateBeforeCall(name, srcPath, dstFolder, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Convert XslFo file (located on storage) to PDF format and upload resulting file to storage. (asynchronously) + * + * @param name The document name. (required) + * @param srcPath Full source filename (ex. /folder1/folder2/template.xpsfo) (required) + * @param dstFolder The destination document folder. (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call putXslFoInStorageToPdfAsync(String name, String srcPath, String dstFolder, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = putXslFoInStorageToPdfValidateBeforeCall(name, srcPath, dstFolder, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } +} diff --git a/src/main/java/com/aspose/asposecloudpdf/model/Annotation.java b/src/main/java/com/aspose/asposecloudpdf/model/Annotation.java new file mode 100644 index 0000000..c93d71b --- /dev/null +++ b/src/main/java/com/aspose/asposecloudpdf/model/Annotation.java @@ -0,0 +1,223 @@ +/** + * + * Copyright (c) 2018 Aspose.Pdf for Cloud + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + */ + + +package com.aspose.asposecloudpdf.model; + +import java.util.Objects; +import com.aspose.asposecloudpdf.model.Color; +import com.aspose.asposecloudpdf.model.Link; +import com.aspose.asposecloudpdf.model.LinkElement; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.List; + +/** + * Provides annotation. + */ +@ApiModel(description = "Provides annotation.") + +public class Annotation extends LinkElement { + @SerializedName("Color") + private Color color = null; + + @SerializedName("Contents") + private String contents = null; + + @SerializedName("CreationDate") + private String creationDate = null; + + @SerializedName("Subject") + private String subject = null; + + @SerializedName("Title") + private String title = null; + + @SerializedName("Modified") + private String modified = null; + + public Annotation color(Color color) { + this.color = color; + return this; + } + + /** + * Get the annotation color. + * @return color + **/ + @ApiModelProperty(value = "Get the annotation color.") + public Color getColor() { + return color; + } + + public void setColor(Color color) { + this.color = color; + } + + public Annotation contents(String contents) { + this.contents = contents; + return this; + } + + /** + * Get the annotation content. + * @return contents + **/ + @ApiModelProperty(value = "Get the annotation content.") + public String getContents() { + return contents; + } + + public void setContents(String contents) { + this.contents = contents; + } + + public Annotation creationDate(String creationDate) { + this.creationDate = creationDate; + return this; + } + + /** + * The date and time when the annotation was created. + * @return creationDate + **/ + @ApiModelProperty(value = "The date and time when the annotation was created.") + public String getCreationDate() { + return creationDate; + } + + public void setCreationDate(String creationDate) { + this.creationDate = creationDate; + } + + public Annotation subject(String subject) { + this.subject = subject; + return this; + } + + /** + * Get the annotation subject. + * @return subject + **/ + @ApiModelProperty(value = "Get the annotation subject.") + public String getSubject() { + return subject; + } + + public void setSubject(String subject) { + this.subject = subject; + } + + public Annotation title(String title) { + this.title = title; + return this; + } + + /** + * Get the annotation title. + * @return title + **/ + @ApiModelProperty(value = "Get the annotation title.") + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public Annotation modified(String modified) { + this.modified = modified; + return this; + } + + /** + * The date and time when the annotation was last modified. + * @return modified + **/ + @ApiModelProperty(value = "The date and time when the annotation was last modified.") + public String getModified() { + return modified; + } + + public void setModified(String modified) { + this.modified = modified; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Annotation annotation = (Annotation) o; + return Objects.equals(this.color, annotation.color) && + Objects.equals(this.contents, annotation.contents) && + Objects.equals(this.creationDate, annotation.creationDate) && + Objects.equals(this.subject, annotation.subject) && + Objects.equals(this.title, annotation.title) && + Objects.equals(this.modified, annotation.modified) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(color, contents, creationDate, subject, title, modified, super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Annotation {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" color: ").append(toIndentedString(color)).append("\n"); + sb.append(" contents: ").append(toIndentedString(contents)).append("\n"); + sb.append(" creationDate: ").append(toIndentedString(creationDate)).append("\n"); + sb.append(" subject: ").append(toIndentedString(subject)).append("\n"); + sb.append(" title: ").append(toIndentedString(title)).append("\n"); + sb.append(" modified: ").append(toIndentedString(modified)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/aspose/asposecloudpdf/model/AnnotationResponse.java b/src/main/java/com/aspose/asposecloudpdf/model/AnnotationResponse.java new file mode 100644 index 0000000..e4fa618 --- /dev/null +++ b/src/main/java/com/aspose/asposecloudpdf/model/AnnotationResponse.java @@ -0,0 +1,106 @@ +/** + * + * Copyright (c) 2018 Aspose.Pdf for Cloud + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + */ + + +package com.aspose.asposecloudpdf.model; + +import java.util.Objects; +import com.aspose.asposecloudpdf.model.Annotation; +import com.aspose.asposecloudpdf.model.HttpStatusCode; +import com.aspose.asposecloudpdf.model.SaaSposeResponse; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +/** + * AnnotationResponse + */ + +public class AnnotationResponse extends SaaSposeResponse { + @SerializedName("Annotation") + private Annotation annotation = null; + + public AnnotationResponse annotation(Annotation annotation) { + this.annotation = annotation; + return this; + } + + /** + * Get annotation + * @return annotation + **/ + @ApiModelProperty(value = "") + public Annotation getAnnotation() { + return annotation; + } + + public void setAnnotation(Annotation annotation) { + this.annotation = annotation; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AnnotationResponse annotationResponse = (AnnotationResponse) o; + return Objects.equals(this.annotation, annotationResponse.annotation) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(annotation, super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AnnotationResponse {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" annotation: ").append(toIndentedString(annotation)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/aspose/asposecloudpdf/model/Annotations.java b/src/main/java/com/aspose/asposecloudpdf/model/Annotations.java new file mode 100644 index 0000000..7c6717d --- /dev/null +++ b/src/main/java/com/aspose/asposecloudpdf/model/Annotations.java @@ -0,0 +1,116 @@ +/** + * + * Copyright (c) 2018 Aspose.Pdf for Cloud + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + */ + + +package com.aspose.asposecloudpdf.model; + +import java.util.Objects; +import com.aspose.asposecloudpdf.model.Link; +import com.aspose.asposecloudpdf.model.LinkElement; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +/** + * List of annotations. + */ +@ApiModel(description = "List of annotations.") + +public class Annotations extends LinkElement { + @SerializedName("List") + private List list = null; + + public Annotations list(List list) { + this.list = list; + return this; + } + + public Annotations addListItem(LinkElement listItem) { + if (this.list == null) { + this.list = new ArrayList(); + } + this.list.add(listItem); + return this; + } + + /** + * Get list + * @return list + **/ + @ApiModelProperty(value = "") + public List getList() { + return list; + } + + public void setList(List list) { + this.list = list; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Annotations annotations = (Annotations) o; + return Objects.equals(this.list, annotations.list) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(list, super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Annotations {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" list: ").append(toIndentedString(list)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/aspose/asposecloudpdf/model/AnnotationsResponse.java b/src/main/java/com/aspose/asposecloudpdf/model/AnnotationsResponse.java new file mode 100644 index 0000000..57a82f6 --- /dev/null +++ b/src/main/java/com/aspose/asposecloudpdf/model/AnnotationsResponse.java @@ -0,0 +1,106 @@ +/** + * + * Copyright (c) 2018 Aspose.Pdf for Cloud + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + */ + + +package com.aspose.asposecloudpdf.model; + +import java.util.Objects; +import com.aspose.asposecloudpdf.model.Annotations; +import com.aspose.asposecloudpdf.model.HttpStatusCode; +import com.aspose.asposecloudpdf.model.SaaSposeResponse; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +/** + * AnnotationsResponse + */ + +public class AnnotationsResponse extends SaaSposeResponse { + @SerializedName("Annotations") + private Annotations annotations = null; + + public AnnotationsResponse annotations(Annotations annotations) { + this.annotations = annotations; + return this; + } + + /** + * Get annotations + * @return annotations + **/ + @ApiModelProperty(value = "") + public Annotations getAnnotations() { + return annotations; + } + + public void setAnnotations(Annotations annotations) { + this.annotations = annotations; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AnnotationsResponse annotationsResponse = (AnnotationsResponse) o; + return Objects.equals(this.annotations, annotationsResponse.annotations) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(annotations, super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AnnotationsResponse {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" annotations: ").append(toIndentedString(annotations)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/aspose/asposecloudpdf/model/AntialiasingProcessingType.java b/src/main/java/com/aspose/asposecloudpdf/model/AntialiasingProcessingType.java new file mode 100644 index 0000000..1dbbdb0 --- /dev/null +++ b/src/main/java/com/aspose/asposecloudpdf/model/AntialiasingProcessingType.java @@ -0,0 +1,82 @@ +/** + * + * Copyright (c) 2018 Aspose.Pdf for Cloud + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + */ + + +package com.aspose.asposecloudpdf.model; + +import java.util.Objects; +import io.swagger.annotations.ApiModel; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * This enum describes possible antialiasing measures during conversion + */ +@JsonAdapter(AntialiasingProcessingType.Adapter.class) +public enum AntialiasingProcessingType { + + NOADDITIONALPROCESSING("NoAdditionalProcessing"), + + TRYCORRECTRESULTHTML("TryCorrectResultHtml"); + + private String value; + + AntialiasingProcessingType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static AntialiasingProcessingType fromValue(String text) { + for (AntialiasingProcessingType b : AntialiasingProcessingType.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final AntialiasingProcessingType enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public AntialiasingProcessingType read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return AntialiasingProcessingType.fromValue(String.valueOf(value)); + } + } +} + diff --git a/src/main/java/com/aspose/asposecloudpdf/model/AppendDocument.java b/src/main/java/com/aspose/asposecloudpdf/model/AppendDocument.java new file mode 100644 index 0000000..50b32ca --- /dev/null +++ b/src/main/java/com/aspose/asposecloudpdf/model/AppendDocument.java @@ -0,0 +1,149 @@ +/** + * + * Copyright (c) 2018 Aspose.Pdf for Cloud + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + */ + + +package com.aspose.asposecloudpdf.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +/** + * Class for appendDocument service request building. + */ +@ApiModel(description = "Class for appendDocument service request building.") + +public class AppendDocument { + @SerializedName("Document") + private String document = null; + + @SerializedName("StartPage") + private Integer startPage = null; + + @SerializedName("EndPage") + private Integer endPage = null; + + public AppendDocument document(String document) { + this.document = document; + return this; + } + + /** + * Document to append (server path). + * @return document + **/ + @ApiModelProperty(value = "Document to append (server path).") + public String getDocument() { + return document; + } + + public void setDocument(String document) { + this.document = document; + } + + public AppendDocument startPage(Integer startPage) { + this.startPage = startPage; + return this; + } + + /** + * Appending start page. + * @return startPage + **/ + @ApiModelProperty(required = true, value = "Appending start page.") + public Integer getStartPage() { + return startPage; + } + + public void setStartPage(Integer startPage) { + this.startPage = startPage; + } + + public AppendDocument endPage(Integer endPage) { + this.endPage = endPage; + return this; + } + + /** + * Appending end page. + * @return endPage + **/ + @ApiModelProperty(required = true, value = "Appending end page.") + public Integer getEndPage() { + return endPage; + } + + public void setEndPage(Integer endPage) { + this.endPage = endPage; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AppendDocument appendDocument = (AppendDocument) o; + return Objects.equals(this.document, appendDocument.document) && + Objects.equals(this.startPage, appendDocument.startPage) && + Objects.equals(this.endPage, appendDocument.endPage); + } + + @Override + public int hashCode() { + return Objects.hash(document, startPage, endPage); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AppendDocument {\n"); + + sb.append(" document: ").append(toIndentedString(document)).append("\n"); + sb.append(" startPage: ").append(toIndentedString(startPage)).append("\n"); + sb.append(" endPage: ").append(toIndentedString(endPage)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/aspose/asposecloudpdf/model/Attachment.java b/src/main/java/com/aspose/asposecloudpdf/model/Attachment.java new file mode 100644 index 0000000..73f8294 --- /dev/null +++ b/src/main/java/com/aspose/asposecloudpdf/model/Attachment.java @@ -0,0 +1,245 @@ +/** + * + * Copyright (c) 2018 Aspose.Pdf for Cloud + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + */ + + +package com.aspose.asposecloudpdf.model; + +import java.util.Objects; +import com.aspose.asposecloudpdf.model.Link; +import com.aspose.asposecloudpdf.model.LinkElement; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.List; + +/** + * Provides link to attachment. + */ +@ApiModel(description = "Provides link to attachment.") + +public class Attachment extends LinkElement { + @SerializedName("Description") + private String description = null; + + @SerializedName("MimeType") + private String mimeType = null; + + @SerializedName("Name") + private String name = null; + + @SerializedName("CreationDate") + private String creationDate = null; + + @SerializedName("ModificationDate") + private String modificationDate = null; + + @SerializedName("Size") + private Integer size = null; + + @SerializedName("CheckSum") + private String checkSum = null; + + public Attachment description(String description) { + this.description = description; + return this; + } + + /** + * Gets text associated with the attachment. + * @return description + **/ + @ApiModelProperty(value = "Gets text associated with the attachment. ") + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public Attachment mimeType(String mimeType) { + this.mimeType = mimeType; + return this; + } + + /** + * Gets subtype of the attachment file. + * @return mimeType + **/ + @ApiModelProperty(value = "Gets subtype of the attachment file.") + public String getMimeType() { + return mimeType; + } + + public void setMimeType(String mimeType) { + this.mimeType = mimeType; + } + + public Attachment name(String name) { + this.name = name; + return this; + } + + /** + * Gets the name of the attachment. + * @return name + **/ + @ApiModelProperty(value = "Gets the name of the attachment. ") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Attachment creationDate(String creationDate) { + this.creationDate = creationDate; + return this; + } + + /** + * The date and time when the embedded file was created. + * @return creationDate + **/ + @ApiModelProperty(value = "The date and time when the embedded file was created.") + public String getCreationDate() { + return creationDate; + } + + public void setCreationDate(String creationDate) { + this.creationDate = creationDate; + } + + public Attachment modificationDate(String modificationDate) { + this.modificationDate = modificationDate; + return this; + } + + /** + * The date and time when the embedded file was last modified. + * @return modificationDate + **/ + @ApiModelProperty(value = "The date and time when the embedded file was last modified.") + public String getModificationDate() { + return modificationDate; + } + + public void setModificationDate(String modificationDate) { + this.modificationDate = modificationDate; + } + + public Attachment size(Integer size) { + this.size = size; + return this; + } + + /** + * The size of the uncompressed embedded file, in bytes. + * @return size + **/ + @ApiModelProperty(value = "The size of the uncompressed embedded file, in bytes.") + public Integer getSize() { + return size; + } + + public void setSize(Integer size) { + this.size = size; + } + + public Attachment checkSum(String checkSum) { + this.checkSum = checkSum; + return this; + } + + /** + * A 16-byte string that is the checksum of the bytes of the uncompressed embedded file. The checksum is calculated by applying the standard MD5 message-digest algorithm to the bytes of the embedded file stream. + * @return checkSum + **/ + @ApiModelProperty(value = "A 16-byte string that is the checksum of the bytes of the uncompressed embedded file. The checksum is calculated by applying the standard MD5 message-digest algorithm to the bytes of the embedded file stream.") + public String getCheckSum() { + return checkSum; + } + + public void setCheckSum(String checkSum) { + this.checkSum = checkSum; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Attachment attachment = (Attachment) o; + return Objects.equals(this.description, attachment.description) && + Objects.equals(this.mimeType, attachment.mimeType) && + Objects.equals(this.name, attachment.name) && + Objects.equals(this.creationDate, attachment.creationDate) && + Objects.equals(this.modificationDate, attachment.modificationDate) && + Objects.equals(this.size, attachment.size) && + Objects.equals(this.checkSum, attachment.checkSum) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(description, mimeType, name, creationDate, modificationDate, size, checkSum, super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Attachment {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" mimeType: ").append(toIndentedString(mimeType)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" creationDate: ").append(toIndentedString(creationDate)).append("\n"); + sb.append(" modificationDate: ").append(toIndentedString(modificationDate)).append("\n"); + sb.append(" size: ").append(toIndentedString(size)).append("\n"); + sb.append(" checkSum: ").append(toIndentedString(checkSum)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/aspose/asposecloudpdf/model/AttachmentResponse.java b/src/main/java/com/aspose/asposecloudpdf/model/AttachmentResponse.java new file mode 100644 index 0000000..2b279d2 --- /dev/null +++ b/src/main/java/com/aspose/asposecloudpdf/model/AttachmentResponse.java @@ -0,0 +1,106 @@ +/** + * + * Copyright (c) 2018 Aspose.Pdf for Cloud + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + */ + + +package com.aspose.asposecloudpdf.model; + +import java.util.Objects; +import com.aspose.asposecloudpdf.model.Attachment; +import com.aspose.asposecloudpdf.model.HttpStatusCode; +import com.aspose.asposecloudpdf.model.SaaSposeResponse; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +/** + * AttachmentResponse + */ + +public class AttachmentResponse extends SaaSposeResponse { + @SerializedName("Attachment") + private Attachment attachment = null; + + public AttachmentResponse attachment(Attachment attachment) { + this.attachment = attachment; + return this; + } + + /** + * Get attachment + * @return attachment + **/ + @ApiModelProperty(value = "") + public Attachment getAttachment() { + return attachment; + } + + public void setAttachment(Attachment attachment) { + this.attachment = attachment; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AttachmentResponse attachmentResponse = (AttachmentResponse) o; + return Objects.equals(this.attachment, attachmentResponse.attachment) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(attachment, super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AttachmentResponse {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" attachment: ").append(toIndentedString(attachment)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/aspose/asposecloudpdf/model/Attachments.java b/src/main/java/com/aspose/asposecloudpdf/model/Attachments.java new file mode 100644 index 0000000..478fa3f --- /dev/null +++ b/src/main/java/com/aspose/asposecloudpdf/model/Attachments.java @@ -0,0 +1,116 @@ +/** + * + * Copyright (c) 2018 Aspose.Pdf for Cloud + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + */ + + +package com.aspose.asposecloudpdf.model; + +import java.util.Objects; +import com.aspose.asposecloudpdf.model.Link; +import com.aspose.asposecloudpdf.model.LinkElement; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +/** + * List of attachment. + */ +@ApiModel(description = "List of attachment.") + +public class Attachments extends LinkElement { + @SerializedName("List") + private List list = null; + + public Attachments list(List list) { + this.list = list; + return this; + } + + public Attachments addListItem(LinkElement listItem) { + if (this.list == null) { + this.list = new ArrayList(); + } + this.list.add(listItem); + return this; + } + + /** + * Get list + * @return list + **/ + @ApiModelProperty(value = "") + public List getList() { + return list; + } + + public void setList(List list) { + this.list = list; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Attachments attachments = (Attachments) o; + return Objects.equals(this.list, attachments.list) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(list, super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Attachments {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" list: ").append(toIndentedString(list)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/aspose/asposecloudpdf/model/AttachmentsResponse.java b/src/main/java/com/aspose/asposecloudpdf/model/AttachmentsResponse.java new file mode 100644 index 0000000..e73922c --- /dev/null +++ b/src/main/java/com/aspose/asposecloudpdf/model/AttachmentsResponse.java @@ -0,0 +1,106 @@ +/** + * + * Copyright (c) 2018 Aspose.Pdf for Cloud + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + */ + + +package com.aspose.asposecloudpdf.model; + +import java.util.Objects; +import com.aspose.asposecloudpdf.model.Attachments; +import com.aspose.asposecloudpdf.model.HttpStatusCode; +import com.aspose.asposecloudpdf.model.SaaSposeResponse; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +/** + * AttachmentsResponse + */ + +public class AttachmentsResponse extends SaaSposeResponse { + @SerializedName("Attachments") + private Attachments attachments = null; + + public AttachmentsResponse attachments(Attachments attachments) { + this.attachments = attachments; + return this; + } + + /** + * Get attachments + * @return attachments + **/ + @ApiModelProperty(value = "") + public Attachments getAttachments() { + return attachments; + } + + public void setAttachments(Attachments attachments) { + this.attachments = attachments; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AttachmentsResponse attachmentsResponse = (AttachmentsResponse) o; + return Objects.equals(this.attachments, attachmentsResponse.attachments) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(attachments, super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AttachmentsResponse {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" attachments: ").append(toIndentedString(attachments)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/aspose/asposecloudpdf/model/Color.java b/src/main/java/com/aspose/asposecloudpdf/model/Color.java new file mode 100644 index 0000000..c393954 --- /dev/null +++ b/src/main/java/com/aspose/asposecloudpdf/model/Color.java @@ -0,0 +1,172 @@ +/** + * + * Copyright (c) 2018 Aspose.Pdf for Cloud + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + */ + + +package com.aspose.asposecloudpdf.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +/** + * Represents color DTO. + */ +@ApiModel(description = "Represents color DTO.") + +public class Color { + @SerializedName("A") + private Integer A = null; + + @SerializedName("R") + private Integer R = null; + + @SerializedName("G") + private Integer G = null; + + @SerializedName("B") + private Integer B = null; + + public Color A(Integer A) { + this.A = A; + return this; + } + + /** + * Get A + * @return A + **/ + @ApiModelProperty(required = true, value = "") + public Integer getA() { + return A; + } + + public void setA(Integer A) { + this.A = A; + } + + public Color R(Integer R) { + this.R = R; + return this; + } + + /** + * Get R + * @return R + **/ + @ApiModelProperty(required = true, value = "") + public Integer getR() { + return R; + } + + public void setR(Integer R) { + this.R = R; + } + + public Color G(Integer G) { + this.G = G; + return this; + } + + /** + * Get G + * @return G + **/ + @ApiModelProperty(required = true, value = "") + public Integer getG() { + return G; + } + + public void setG(Integer G) { + this.G = G; + } + + public Color B(Integer B) { + this.B = B; + return this; + } + + /** + * Get B + * @return B + **/ + @ApiModelProperty(required = true, value = "") + public Integer getB() { + return B; + } + + public void setB(Integer B) { + this.B = B; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Color color = (Color) o; + return Objects.equals(this.A, color.A) && + Objects.equals(this.R, color.R) && + Objects.equals(this.G, color.G) && + Objects.equals(this.B, color.B); + } + + @Override + public int hashCode() { + return Objects.hash(A, R, G, B); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Color {\n"); + + sb.append(" A: ").append(toIndentedString(A)).append("\n"); + sb.append(" R: ").append(toIndentedString(R)).append("\n"); + sb.append(" G: ").append(toIndentedString(G)).append("\n"); + sb.append(" B: ").append(toIndentedString(B)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/aspose/asposecloudpdf/model/ColorDepth.java b/src/main/java/com/aspose/asposecloudpdf/model/ColorDepth.java new file mode 100644 index 0000000..cb541e3 --- /dev/null +++ b/src/main/java/com/aspose/asposecloudpdf/model/ColorDepth.java @@ -0,0 +1,86 @@ +/** + * + * Copyright (c) 2018 Aspose.Pdf for Cloud + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + */ + + +package com.aspose.asposecloudpdf.model; + +import java.util.Objects; +import io.swagger.annotations.ApiModel; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Used to specify the parameter value passed to a Tiff image device. + */ +@JsonAdapter(ColorDepth.Adapter.class) +public enum ColorDepth { + + DEFAULT("Default"), + + FORMAT8BPP("Format8bpp"), + + FORMAT4BPP("Format4bpp"), + + FORMAT1BPP("Format1bpp"); + + private String value; + + ColorDepth(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static ColorDepth fromValue(String text) { + for (ColorDepth b : ColorDepth.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final ColorDepth enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public ColorDepth read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return ColorDepth.fromValue(String.valueOf(value)); + } + } +} + diff --git a/src/main/java/com/aspose/asposecloudpdf/model/CompressionType.java b/src/main/java/com/aspose/asposecloudpdf/model/CompressionType.java new file mode 100644 index 0000000..ed27b63 --- /dev/null +++ b/src/main/java/com/aspose/asposecloudpdf/model/CompressionType.java @@ -0,0 +1,88 @@ +/** + * + * Copyright (c) 2018 Aspose.Pdf for Cloud + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + */ + + +package com.aspose.asposecloudpdf.model; + +import java.util.Objects; +import io.swagger.annotations.ApiModel; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Used to specify the parameter value passed to a Tiff image device. + */ +@JsonAdapter(CompressionType.Adapter.class) +public enum CompressionType { + + LZW("LZW"), + + CCITT4("CCITT4"), + + CCITT3("CCITT3"), + + RLE("RLE"), + + NONE("None"); + + private String value; + + CompressionType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static CompressionType fromValue(String text) { + for (CompressionType b : CompressionType.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final CompressionType enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public CompressionType read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return CompressionType.fromValue(String.valueOf(value)); + } + } +} + diff --git a/src/main/java/com/aspose/asposecloudpdf/model/DocFormat.java b/src/main/java/com/aspose/asposecloudpdf/model/DocFormat.java new file mode 100644 index 0000000..bf66510 --- /dev/null +++ b/src/main/java/com/aspose/asposecloudpdf/model/DocFormat.java @@ -0,0 +1,82 @@ +/** + * + * Copyright (c) 2018 Aspose.Pdf for Cloud + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + */ + + +package com.aspose.asposecloudpdf.model; + +import java.util.Objects; +import io.swagger.annotations.ApiModel; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Allows to specify .doc or .docx file format. + */ +@JsonAdapter(DocFormat.Adapter.class) +public enum DocFormat { + + DOC("Doc"), + + DOCX("DocX"); + + private String value; + + DocFormat(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static DocFormat fromValue(String text) { + for (DocFormat b : DocFormat.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final DocFormat enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public DocFormat read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return DocFormat.fromValue(String.valueOf(value)); + } + } +} + diff --git a/src/main/java/com/aspose/asposecloudpdf/model/DocRecognitionMode.java b/src/main/java/com/aspose/asposecloudpdf/model/DocRecognitionMode.java new file mode 100644 index 0000000..38ab351 --- /dev/null +++ b/src/main/java/com/aspose/asposecloudpdf/model/DocRecognitionMode.java @@ -0,0 +1,82 @@ +/** + * + * Copyright (c) 2018 Aspose.Pdf for Cloud + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + */ + + +package com.aspose.asposecloudpdf.model; + +import java.util.Objects; +import io.swagger.annotations.ApiModel; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Allows to control how a PDF document is converted into a word processing document. + */ +@JsonAdapter(DocRecognitionMode.Adapter.class) +public enum DocRecognitionMode { + + TEXTBOX("Textbox"), + + FLOW("Flow"); + + private String value; + + DocRecognitionMode(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static DocRecognitionMode fromValue(String text) { + for (DocRecognitionMode b : DocRecognitionMode.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final DocRecognitionMode enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public DocRecognitionMode read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return DocRecognitionMode.fromValue(String.valueOf(value)); + } + } +} + diff --git a/src/main/java/com/aspose/asposecloudpdf/model/Document.java b/src/main/java/com/aspose/asposecloudpdf/model/Document.java new file mode 100644 index 0000000..9a1e049 --- /dev/null +++ b/src/main/java/com/aspose/asposecloudpdf/model/Document.java @@ -0,0 +1,132 @@ +/** + * + * Copyright (c) 2018 Aspose.Pdf for Cloud + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + */ + + +package com.aspose.asposecloudpdf.model; + +import java.util.Objects; +import com.aspose.asposecloudpdf.model.DocumentProperties; +import com.aspose.asposecloudpdf.model.Link; +import com.aspose.asposecloudpdf.model.LinkElement; +import com.aspose.asposecloudpdf.model.Pages; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.List; + +/** + * Represents document DTO. + */ +@ApiModel(description = "Represents document DTO.") + +public class Document extends LinkElement { + @SerializedName("DocumentProperties") + private DocumentProperties documentProperties = null; + + @SerializedName("Pages") + private Pages pages = null; + + public Document documentProperties(DocumentProperties documentProperties) { + this.documentProperties = documentProperties; + return this; + } + + /** + * Document properties. + * @return documentProperties + **/ + @ApiModelProperty(value = "Document properties.") + public DocumentProperties getDocumentProperties() { + return documentProperties; + } + + public void setDocumentProperties(DocumentProperties documentProperties) { + this.documentProperties = documentProperties; + } + + public Document pages(Pages pages) { + this.pages = pages; + return this; + } + + /** + * Document pages. + * @return pages + **/ + @ApiModelProperty(value = "Document pages.") + public Pages getPages() { + return pages; + } + + public void setPages(Pages pages) { + this.pages = pages; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Document document = (Document) o; + return Objects.equals(this.documentProperties, document.documentProperties) && + Objects.equals(this.pages, document.pages) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(documentProperties, pages, super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Document {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" documentProperties: ").append(toIndentedString(documentProperties)).append("\n"); + sb.append(" pages: ").append(toIndentedString(pages)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/aspose/asposecloudpdf/model/DocumentPagesResponse.java b/src/main/java/com/aspose/asposecloudpdf/model/DocumentPagesResponse.java new file mode 100644 index 0000000..6c5b5a9 --- /dev/null +++ b/src/main/java/com/aspose/asposecloudpdf/model/DocumentPagesResponse.java @@ -0,0 +1,106 @@ +/** + * + * Copyright (c) 2018 Aspose.Pdf for Cloud + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + */ + + +package com.aspose.asposecloudpdf.model; + +import java.util.Objects; +import com.aspose.asposecloudpdf.model.HttpStatusCode; +import com.aspose.asposecloudpdf.model.Pages; +import com.aspose.asposecloudpdf.model.SaaSposeResponse; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +/** + * DocumentPagesResponse + */ + +public class DocumentPagesResponse extends SaaSposeResponse { + @SerializedName("Pages") + private Pages pages = null; + + public DocumentPagesResponse pages(Pages pages) { + this.pages = pages; + return this; + } + + /** + * Get pages + * @return pages + **/ + @ApiModelProperty(value = "") + public Pages getPages() { + return pages; + } + + public void setPages(Pages pages) { + this.pages = pages; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DocumentPagesResponse documentPagesResponse = (DocumentPagesResponse) o; + return Objects.equals(this.pages, documentPagesResponse.pages) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(pages, super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DocumentPagesResponse {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" pages: ").append(toIndentedString(pages)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/aspose/asposecloudpdf/model/DocumentPrivilege.java b/src/main/java/com/aspose/asposecloudpdf/model/DocumentPrivilege.java new file mode 100644 index 0000000..241a7b0 --- /dev/null +++ b/src/main/java/com/aspose/asposecloudpdf/model/DocumentPrivilege.java @@ -0,0 +1,333 @@ +/** + * + * Copyright (c) 2018 Aspose.Pdf for Cloud + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + */ + + +package com.aspose.asposecloudpdf.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +/** + * Represents the privileges for accessing Pdf file./>. + */ +@ApiModel(description = "Represents the privileges for accessing Pdf file./>.") + +public class DocumentPrivilege { + @SerializedName("AllowPrint") + private Boolean allowPrint = null; + + @SerializedName("AllowDegradedPrinting") + private Boolean allowDegradedPrinting = null; + + @SerializedName("AllowModifyContents") + private Boolean allowModifyContents = null; + + @SerializedName("AllowCopy") + private Boolean allowCopy = null; + + @SerializedName("AllowModifyAnnotations") + private Boolean allowModifyAnnotations = null; + + @SerializedName("AllowFillIn") + private Boolean allowFillIn = null; + + @SerializedName("AllowScreenReaders") + private Boolean allowScreenReaders = null; + + @SerializedName("AllowAssembly") + private Boolean allowAssembly = null; + + @SerializedName("PrintAllowLevel") + private Integer printAllowLevel = null; + + @SerializedName("ChangeAllowLevel") + private Integer changeAllowLevel = null; + + @SerializedName("CopyAllowLevel") + private Integer copyAllowLevel = null; + + public DocumentPrivilege allowPrint(Boolean allowPrint) { + this.allowPrint = allowPrint; + return this; + } + + /** + * Sets the permission which allow print or not. true is allow and false or not set is forbidden. + * @return allowPrint + **/ + @ApiModelProperty(value = "Sets the permission which allow print or not. true is allow and false or not set is forbidden.") + public Boolean isAllowPrint() { + return allowPrint; + } + + public void setAllowPrint(Boolean allowPrint) { + this.allowPrint = allowPrint; + } + + public DocumentPrivilege allowDegradedPrinting(Boolean allowDegradedPrinting) { + this.allowDegradedPrinting = allowDegradedPrinting; + return this; + } + + /** + * Sets the permission which allow degraded printing or not. true is allow and false or not set is forbidden. + * @return allowDegradedPrinting + **/ + @ApiModelProperty(value = "Sets the permission which allow degraded printing or not. true is allow and false or not set is forbidden.") + public Boolean isAllowDegradedPrinting() { + return allowDegradedPrinting; + } + + public void setAllowDegradedPrinting(Boolean allowDegradedPrinting) { + this.allowDegradedPrinting = allowDegradedPrinting; + } + + public DocumentPrivilege allowModifyContents(Boolean allowModifyContents) { + this.allowModifyContents = allowModifyContents; + return this; + } + + /** + * Sets the permission which allow modify contents or not. true is allow and false or not set is forbidden. + * @return allowModifyContents + **/ + @ApiModelProperty(value = "Sets the permission which allow modify contents or not. true is allow and false or not set is forbidden.") + public Boolean isAllowModifyContents() { + return allowModifyContents; + } + + public void setAllowModifyContents(Boolean allowModifyContents) { + this.allowModifyContents = allowModifyContents; + } + + public DocumentPrivilege allowCopy(Boolean allowCopy) { + this.allowCopy = allowCopy; + return this; + } + + /** + * Sets the permission which allow copy or not. true is allow and false or not set is forbidden. + * @return allowCopy + **/ + @ApiModelProperty(value = "Sets the permission which allow copy or not. true is allow and false or not set is forbidden.") + public Boolean isAllowCopy() { + return allowCopy; + } + + public void setAllowCopy(Boolean allowCopy) { + this.allowCopy = allowCopy; + } + + public DocumentPrivilege allowModifyAnnotations(Boolean allowModifyAnnotations) { + this.allowModifyAnnotations = allowModifyAnnotations; + return this; + } + + /** + * Sets the permission which allow modify annotations or not. true is allow and false or not set is forbidden. + * @return allowModifyAnnotations + **/ + @ApiModelProperty(value = "Sets the permission which allow modify annotations or not. true is allow and false or not set is forbidden.") + public Boolean isAllowModifyAnnotations() { + return allowModifyAnnotations; + } + + public void setAllowModifyAnnotations(Boolean allowModifyAnnotations) { + this.allowModifyAnnotations = allowModifyAnnotations; + } + + public DocumentPrivilege allowFillIn(Boolean allowFillIn) { + this.allowFillIn = allowFillIn; + return this; + } + + /** + * Sets the permission which allow fill in forms or not. true is allow and false or not set is forbidden. + * @return allowFillIn + **/ + @ApiModelProperty(value = "Sets the permission which allow fill in forms or not. true is allow and false or not set is forbidden.") + public Boolean isAllowFillIn() { + return allowFillIn; + } + + public void setAllowFillIn(Boolean allowFillIn) { + this.allowFillIn = allowFillIn; + } + + public DocumentPrivilege allowScreenReaders(Boolean allowScreenReaders) { + this.allowScreenReaders = allowScreenReaders; + return this; + } + + /** + * Sets the permission which allow screen readers or not. true is allow and false or not set is forbidden. + * @return allowScreenReaders + **/ + @ApiModelProperty(value = "Sets the permission which allow screen readers or not. true is allow and false or not set is forbidden.") + public Boolean isAllowScreenReaders() { + return allowScreenReaders; + } + + public void setAllowScreenReaders(Boolean allowScreenReaders) { + this.allowScreenReaders = allowScreenReaders; + } + + public DocumentPrivilege allowAssembly(Boolean allowAssembly) { + this.allowAssembly = allowAssembly; + return this; + } + + /** + * Sets the permission which allow assembly or not. true is allow and false or not set is forbidden. + * @return allowAssembly + **/ + @ApiModelProperty(value = "Sets the permission which allow assembly or not. true is allow and false or not set is forbidden.") + public Boolean isAllowAssembly() { + return allowAssembly; + } + + public void setAllowAssembly(Boolean allowAssembly) { + this.allowAssembly = allowAssembly; + } + + public DocumentPrivilege printAllowLevel(Integer printAllowLevel) { + this.printAllowLevel = printAllowLevel; + return this; + } + + /** + * Sets the print level of document's privilege. Just as the Adobe Professional's Printing Allowed settings. 0: None. 1: Low Resolution (150 dpi). 2: High Resolution. + * @return printAllowLevel + **/ + @ApiModelProperty(value = "Sets the print level of document's privilege. Just as the Adobe Professional's Printing Allowed settings. 0: None. 1: Low Resolution (150 dpi). 2: High Resolution.") + public Integer getPrintAllowLevel() { + return printAllowLevel; + } + + public void setPrintAllowLevel(Integer printAllowLevel) { + this.printAllowLevel = printAllowLevel; + } + + public DocumentPrivilege changeAllowLevel(Integer changeAllowLevel) { + this.changeAllowLevel = changeAllowLevel; + return this; + } + + /** + * Sets the change level of document's privilege. Just as the Adobe Professional's Changes Allowed settings. 0: None. 1: Inserting, Deleting and Rotating pages. 2: Filling in form fields and signing existing signature fields. 3: Commenting, filling in form fields, and signing existing signature fields. 4: Any except extracting pages. + * @return changeAllowLevel + **/ + @ApiModelProperty(value = "Sets the change level of document's privilege. Just as the Adobe Professional's Changes Allowed settings. 0: None. 1: Inserting, Deleting and Rotating pages. 2: Filling in form fields and signing existing signature fields. 3: Commenting, filling in form fields, and signing existing signature fields. 4: Any except extracting pages.") + public Integer getChangeAllowLevel() { + return changeAllowLevel; + } + + public void setChangeAllowLevel(Integer changeAllowLevel) { + this.changeAllowLevel = changeAllowLevel; + } + + public DocumentPrivilege copyAllowLevel(Integer copyAllowLevel) { + this.copyAllowLevel = copyAllowLevel; + return this; + } + + /** + * Sets the copy level of document's privilege. Just as the Adobe Professional's permission settings. 0: None. 1: Enable text access for screen reader devices for the visually impaired. 2: Enable copying of text, images and other content. + * @return copyAllowLevel + **/ + @ApiModelProperty(value = "Sets the copy level of document's privilege. Just as the Adobe Professional's permission settings. 0: None. 1: Enable text access for screen reader devices for the visually impaired. 2: Enable copying of text, images and other content.") + public Integer getCopyAllowLevel() { + return copyAllowLevel; + } + + public void setCopyAllowLevel(Integer copyAllowLevel) { + this.copyAllowLevel = copyAllowLevel; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DocumentPrivilege documentPrivilege = (DocumentPrivilege) o; + return Objects.equals(this.allowPrint, documentPrivilege.allowPrint) && + Objects.equals(this.allowDegradedPrinting, documentPrivilege.allowDegradedPrinting) && + Objects.equals(this.allowModifyContents, documentPrivilege.allowModifyContents) && + Objects.equals(this.allowCopy, documentPrivilege.allowCopy) && + Objects.equals(this.allowModifyAnnotations, documentPrivilege.allowModifyAnnotations) && + Objects.equals(this.allowFillIn, documentPrivilege.allowFillIn) && + Objects.equals(this.allowScreenReaders, documentPrivilege.allowScreenReaders) && + Objects.equals(this.allowAssembly, documentPrivilege.allowAssembly) && + Objects.equals(this.printAllowLevel, documentPrivilege.printAllowLevel) && + Objects.equals(this.changeAllowLevel, documentPrivilege.changeAllowLevel) && + Objects.equals(this.copyAllowLevel, documentPrivilege.copyAllowLevel); + } + + @Override + public int hashCode() { + return Objects.hash(allowPrint, allowDegradedPrinting, allowModifyContents, allowCopy, allowModifyAnnotations, allowFillIn, allowScreenReaders, allowAssembly, printAllowLevel, changeAllowLevel, copyAllowLevel); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DocumentPrivilege {\n"); + + sb.append(" allowPrint: ").append(toIndentedString(allowPrint)).append("\n"); + sb.append(" allowDegradedPrinting: ").append(toIndentedString(allowDegradedPrinting)).append("\n"); + sb.append(" allowModifyContents: ").append(toIndentedString(allowModifyContents)).append("\n"); + sb.append(" allowCopy: ").append(toIndentedString(allowCopy)).append("\n"); + sb.append(" allowModifyAnnotations: ").append(toIndentedString(allowModifyAnnotations)).append("\n"); + sb.append(" allowFillIn: ").append(toIndentedString(allowFillIn)).append("\n"); + sb.append(" allowScreenReaders: ").append(toIndentedString(allowScreenReaders)).append("\n"); + sb.append(" allowAssembly: ").append(toIndentedString(allowAssembly)).append("\n"); + sb.append(" printAllowLevel: ").append(toIndentedString(printAllowLevel)).append("\n"); + sb.append(" changeAllowLevel: ").append(toIndentedString(changeAllowLevel)).append("\n"); + sb.append(" copyAllowLevel: ").append(toIndentedString(copyAllowLevel)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/aspose/asposecloudpdf/model/DocumentProperties.java b/src/main/java/com/aspose/asposecloudpdf/model/DocumentProperties.java new file mode 100644 index 0000000..690e0c8 --- /dev/null +++ b/src/main/java/com/aspose/asposecloudpdf/model/DocumentProperties.java @@ -0,0 +1,117 @@ +/** + * + * Copyright (c) 2018 Aspose.Pdf for Cloud + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + */ + + +package com.aspose.asposecloudpdf.model; + +import java.util.Objects; +import com.aspose.asposecloudpdf.model.DocumentProperty; +import com.aspose.asposecloudpdf.model.Link; +import com.aspose.asposecloudpdf.model.LinkElement; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +/** + * Pdf document properties. + */ +@ApiModel(description = "Pdf document properties.") + +public class DocumentProperties extends LinkElement { + @SerializedName("List") + private List list = null; + + public DocumentProperties list(List list) { + this.list = list; + return this; + } + + public DocumentProperties addListItem(DocumentProperty listItem) { + if (this.list == null) { + this.list = new ArrayList(); + } + this.list.add(listItem); + return this; + } + + /** + * Get list + * @return list + **/ + @ApiModelProperty(value = "") + public List getList() { + return list; + } + + public void setList(List list) { + this.list = list; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DocumentProperties documentProperties = (DocumentProperties) o; + return Objects.equals(this.list, documentProperties.list) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(list, super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DocumentProperties {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" list: ").append(toIndentedString(list)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/aspose/asposecloudpdf/model/DocumentPropertiesResponse.java b/src/main/java/com/aspose/asposecloudpdf/model/DocumentPropertiesResponse.java new file mode 100644 index 0000000..65b879b --- /dev/null +++ b/src/main/java/com/aspose/asposecloudpdf/model/DocumentPropertiesResponse.java @@ -0,0 +1,106 @@ +/** + * + * Copyright (c) 2018 Aspose.Pdf for Cloud + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + */ + + +package com.aspose.asposecloudpdf.model; + +import java.util.Objects; +import com.aspose.asposecloudpdf.model.DocumentProperties; +import com.aspose.asposecloudpdf.model.HttpStatusCode; +import com.aspose.asposecloudpdf.model.SaaSposeResponse; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +/** + * DocumentPropertiesResponse + */ + +public class DocumentPropertiesResponse extends SaaSposeResponse { + @SerializedName("DocumentProperties") + private DocumentProperties documentProperties = null; + + public DocumentPropertiesResponse documentProperties(DocumentProperties documentProperties) { + this.documentProperties = documentProperties; + return this; + } + + /** + * Get documentProperties + * @return documentProperties + **/ + @ApiModelProperty(value = "") + public DocumentProperties getDocumentProperties() { + return documentProperties; + } + + public void setDocumentProperties(DocumentProperties documentProperties) { + this.documentProperties = documentProperties; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DocumentPropertiesResponse documentPropertiesResponse = (DocumentPropertiesResponse) o; + return Objects.equals(this.documentProperties, documentPropertiesResponse.documentProperties) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(documentProperties, super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DocumentPropertiesResponse {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" documentProperties: ").append(toIndentedString(documentProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/aspose/asposecloudpdf/model/DocumentProperty.java b/src/main/java/com/aspose/asposecloudpdf/model/DocumentProperty.java new file mode 100644 index 0000000..879e474 --- /dev/null +++ b/src/main/java/com/aspose/asposecloudpdf/model/DocumentProperty.java @@ -0,0 +1,153 @@ +/** + * + * Copyright (c) 2018 Aspose.Pdf for Cloud + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + */ + + +package com.aspose.asposecloudpdf.model; + +import java.util.Objects; +import com.aspose.asposecloudpdf.model.Link; +import com.aspose.asposecloudpdf.model.LinkElement; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.List; + +/** + * Pdf document property. + */ +@ApiModel(description = "Pdf document property.") + +public class DocumentProperty extends LinkElement { + @SerializedName("Name") + private String name = null; + + @SerializedName("Value") + private String value = null; + + @SerializedName("BuiltIn") + private Boolean builtIn = null; + + public DocumentProperty name(String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + @ApiModelProperty(value = "") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public DocumentProperty value(String value) { + this.value = value; + return this; + } + + /** + * Get value + * @return value + **/ + @ApiModelProperty(value = "") + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + + public DocumentProperty builtIn(Boolean builtIn) { + this.builtIn = builtIn; + return this; + } + + /** + * Get builtIn + * @return builtIn + **/ + @ApiModelProperty(value = "") + public Boolean isBuiltIn() { + return builtIn; + } + + public void setBuiltIn(Boolean builtIn) { + this.builtIn = builtIn; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DocumentProperty documentProperty = (DocumentProperty) o; + return Objects.equals(this.name, documentProperty.name) && + Objects.equals(this.value, documentProperty.value) && + Objects.equals(this.builtIn, documentProperty.builtIn) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(name, value, builtIn, super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DocumentProperty {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append(" builtIn: ").append(toIndentedString(builtIn)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/aspose/asposecloudpdf/model/DocumentPropertyResponse.java b/src/main/java/com/aspose/asposecloudpdf/model/DocumentPropertyResponse.java new file mode 100644 index 0000000..9e4ad11 --- /dev/null +++ b/src/main/java/com/aspose/asposecloudpdf/model/DocumentPropertyResponse.java @@ -0,0 +1,106 @@ +/** + * + * Copyright (c) 2018 Aspose.Pdf for Cloud + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + */ + + +package com.aspose.asposecloudpdf.model; + +import java.util.Objects; +import com.aspose.asposecloudpdf.model.DocumentProperty; +import com.aspose.asposecloudpdf.model.HttpStatusCode; +import com.aspose.asposecloudpdf.model.SaaSposeResponse; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +/** + * DocumentPropertyResponse + */ + +public class DocumentPropertyResponse extends SaaSposeResponse { + @SerializedName("DocumentProperty") + private DocumentProperty documentProperty = null; + + public DocumentPropertyResponse documentProperty(DocumentProperty documentProperty) { + this.documentProperty = documentProperty; + return this; + } + + /** + * Get documentProperty + * @return documentProperty + **/ + @ApiModelProperty(value = "") + public DocumentProperty getDocumentProperty() { + return documentProperty; + } + + public void setDocumentProperty(DocumentProperty documentProperty) { + this.documentProperty = documentProperty; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DocumentPropertyResponse documentPropertyResponse = (DocumentPropertyResponse) o; + return Objects.equals(this.documentProperty, documentPropertyResponse.documentProperty) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(documentProperty, super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DocumentPropertyResponse {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" documentProperty: ").append(toIndentedString(documentProperty)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/aspose/asposecloudpdf/model/DocumentResponse.java b/src/main/java/com/aspose/asposecloudpdf/model/DocumentResponse.java new file mode 100644 index 0000000..b6a6301 --- /dev/null +++ b/src/main/java/com/aspose/asposecloudpdf/model/DocumentResponse.java @@ -0,0 +1,139 @@ +/** + * + * Copyright (c) 2018 Aspose.Pdf for Cloud + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + */ + + +package com.aspose.asposecloudpdf.model; + +import java.util.Objects; +import com.aspose.asposecloudpdf.model.Document; +import com.aspose.asposecloudpdf.model.HttpStatusCode; +import com.aspose.asposecloudpdf.model.SaaSposeResponse; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +/** + * DocumentResponse + */ + +public class DocumentResponse extends SaaSposeResponse { + @SerializedName("Document") + private Document document = null; + + @SerializedName("Messages") + private List messages = null; + + public DocumentResponse document(Document document) { + this.document = document; + return this; + } + + /** + * Get document + * @return document + **/ + @ApiModelProperty(value = "") + public Document getDocument() { + return document; + } + + public void setDocument(Document document) { + this.document = document; + } + + public DocumentResponse messages(List messages) { + this.messages = messages; + return this; + } + + public DocumentResponse addMessagesItem(String messagesItem) { + if (this.messages == null) { + this.messages = new ArrayList(); + } + this.messages.add(messagesItem); + return this; + } + + /** + * Get messages + * @return messages + **/ + @ApiModelProperty(value = "") + public List getMessages() { + return messages; + } + + public void setMessages(List messages) { + this.messages = messages; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DocumentResponse documentResponse = (DocumentResponse) o; + return Objects.equals(this.document, documentResponse.document) && + Objects.equals(this.messages, documentResponse.messages) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(document, messages, super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DocumentResponse {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" document: ").append(toIndentedString(document)).append("\n"); + sb.append(" messages: ").append(toIndentedString(messages)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/aspose/asposecloudpdf/model/DocumentTextReplaceResponse.java b/src/main/java/com/aspose/asposecloudpdf/model/DocumentTextReplaceResponse.java new file mode 100644 index 0000000..ac31cf1 --- /dev/null +++ b/src/main/java/com/aspose/asposecloudpdf/model/DocumentTextReplaceResponse.java @@ -0,0 +1,106 @@ +/** + * + * Copyright (c) 2018 Aspose.Pdf for Cloud + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + */ + + +package com.aspose.asposecloudpdf.model; + +import java.util.Objects; +import com.aspose.asposecloudpdf.model.Document; +import com.aspose.asposecloudpdf.model.HttpStatusCode; +import com.aspose.asposecloudpdf.model.TextReplaceResponse; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +/** + * DocumentTextReplaceResponse + */ + +public class DocumentTextReplaceResponse extends TextReplaceResponse { + @SerializedName("Document") + private Document document = null; + + public DocumentTextReplaceResponse document(Document document) { + this.document = document; + return this; + } + + /** + * Get document + * @return document + **/ + @ApiModelProperty(value = "") + public Document getDocument() { + return document; + } + + public void setDocument(Document document) { + this.document = document; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DocumentTextReplaceResponse documentTextReplaceResponse = (DocumentTextReplaceResponse) o; + return Objects.equals(this.document, documentTextReplaceResponse.document) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(document, super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DocumentTextReplaceResponse {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" document: ").append(toIndentedString(document)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/aspose/asposecloudpdf/model/EpubRecognitionMode.java b/src/main/java/com/aspose/asposecloudpdf/model/EpubRecognitionMode.java new file mode 100644 index 0000000..b46a215 --- /dev/null +++ b/src/main/java/com/aspose/asposecloudpdf/model/EpubRecognitionMode.java @@ -0,0 +1,84 @@ +/** + * + * Copyright (c) 2018 Aspose.Pdf for Cloud + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + */ + + +package com.aspose.asposecloudpdf.model; + +import java.util.Objects; +import io.swagger.annotations.ApiModel; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * When PDF file (that usually has fixed layout) is being converted, the conversion engine tries to perform grouping and multi-level analysis to restore the original document author's intent and produce result in flow layout. This property tunes that conversion for this or that desirable method of recognition of content. + */ +@JsonAdapter(EpubRecognitionMode.Adapter.class) +public enum EpubRecognitionMode { + + FLOW("Flow"), + + PDFFLOW("PdfFlow"), + + FIXED("Fixed"); + + private String value; + + EpubRecognitionMode(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static EpubRecognitionMode fromValue(String text) { + for (EpubRecognitionMode b : EpubRecognitionMode.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final EpubRecognitionMode enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public EpubRecognitionMode read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return EpubRecognitionMode.fromValue(String.valueOf(value)); + } + } +} + diff --git a/src/main/java/com/aspose/asposecloudpdf/model/Field.java b/src/main/java/com/aspose/asposecloudpdf/model/Field.java new file mode 100644 index 0000000..e44c4d9 --- /dev/null +++ b/src/main/java/com/aspose/asposecloudpdf/model/Field.java @@ -0,0 +1,218 @@ +/** + * + * Copyright (c) 2018 Aspose.Pdf for Cloud + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + */ + + +package com.aspose.asposecloudpdf.model; + +import java.util.Objects; +import com.aspose.asposecloudpdf.model.FieldType; +import com.aspose.asposecloudpdf.model.Link; +import com.aspose.asposecloudpdf.model.LinkElement; +import com.aspose.asposecloudpdf.model.Rectangle; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +/** + * Represents form field. + */ +@ApiModel(description = "Represents form field.") + +public class Field extends LinkElement { + @SerializedName("Name") + private String name = null; + + @SerializedName("Type") + private FieldType type = null; + + @SerializedName("Values") + private List values = null; + + @SerializedName("SelectedItems") + private List selectedItems = null; + + @SerializedName("Rect") + private Rectangle rect = null; + + public Field name(String name) { + this.name = name; + return this; + } + + /** + * Field name. + * @return name + **/ + @ApiModelProperty(value = "Field name.") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Field type(FieldType type) { + this.type = type; + return this; + } + + /** + * Field type. + * @return type + **/ + @ApiModelProperty(value = "Field type.") + public FieldType getType() { + return type; + } + + public void setType(FieldType type) { + this.type = type; + } + + public Field values(List values) { + this.values = values; + return this; + } + + public Field addValuesItem(String valuesItem) { + if (this.values == null) { + this.values = new ArrayList(); + } + this.values.add(valuesItem); + return this; + } + + /** + * Field values. + * @return values + **/ + @ApiModelProperty(value = "Field values.") + public List getValues() { + return values; + } + + public void setValues(List values) { + this.values = values; + } + + public Field selectedItems(List selectedItems) { + this.selectedItems = selectedItems; + return this; + } + + public Field addSelectedItemsItem(Integer selectedItemsItem) { + if (this.selectedItems == null) { + this.selectedItems = new ArrayList(); + } + this.selectedItems.add(selectedItemsItem); + return this; + } + + /** + * Selected items. + * @return selectedItems + **/ + @ApiModelProperty(value = "Selected items.") + public List getSelectedItems() { + return selectedItems; + } + + public void setSelectedItems(List selectedItems) { + this.selectedItems = selectedItems; + } + + public Field rect(Rectangle rect) { + this.rect = rect; + return this; + } + + /** + * Field rectangle. + * @return rect + **/ + @ApiModelProperty(value = "Field rectangle.") + public Rectangle getRect() { + return rect; + } + + public void setRect(Rectangle rect) { + this.rect = rect; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Field field = (Field) o; + return Objects.equals(this.name, field.name) && + Objects.equals(this.type, field.type) && + Objects.equals(this.values, field.values) && + Objects.equals(this.selectedItems, field.selectedItems) && + Objects.equals(this.rect, field.rect) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(name, type, values, selectedItems, rect, super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Field {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" values: ").append(toIndentedString(values)).append("\n"); + sb.append(" selectedItems: ").append(toIndentedString(selectedItems)).append("\n"); + sb.append(" rect: ").append(toIndentedString(rect)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/aspose/asposecloudpdf/model/FieldResponse.java b/src/main/java/com/aspose/asposecloudpdf/model/FieldResponse.java new file mode 100644 index 0000000..2e9d6d5 --- /dev/null +++ b/src/main/java/com/aspose/asposecloudpdf/model/FieldResponse.java @@ -0,0 +1,106 @@ +/** + * + * Copyright (c) 2018 Aspose.Pdf for Cloud + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + */ + + +package com.aspose.asposecloudpdf.model; + +import java.util.Objects; +import com.aspose.asposecloudpdf.model.Field; +import com.aspose.asposecloudpdf.model.HttpStatusCode; +import com.aspose.asposecloudpdf.model.SaaSposeResponse; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +/** + * FieldResponse + */ + +public class FieldResponse extends SaaSposeResponse { + @SerializedName("Field") + private Field field = null; + + public FieldResponse field(Field field) { + this.field = field; + return this; + } + + /** + * Get field + * @return field + **/ + @ApiModelProperty(value = "") + public Field getField() { + return field; + } + + public void setField(Field field) { + this.field = field; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FieldResponse fieldResponse = (FieldResponse) o; + return Objects.equals(this.field, fieldResponse.field) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(field, super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FieldResponse {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" field: ").append(toIndentedString(field)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/aspose/asposecloudpdf/model/FieldType.java b/src/main/java/com/aspose/asposecloudpdf/model/FieldType.java new file mode 100644 index 0000000..78ad26e --- /dev/null +++ b/src/main/java/com/aspose/asposecloudpdf/model/FieldType.java @@ -0,0 +1,83 @@ +/** + * + * Copyright (c) 2018 Aspose.Pdf for Cloud + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + */ + + +package com.aspose.asposecloudpdf.model; + +import java.util.Objects; +import io.swagger.annotations.ApiModel; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Represents an enumeration of available field types. + */ +@JsonAdapter(FieldType.Adapter.class) +public enum FieldType { + + TEXT(0), + INTEGER(1), + BOOLEAN(2), + LIST(3); + + private Integer value; + + FieldType(Integer value) { + this.value = value; + } + + public Integer getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static FieldType fromValue(String text) { + for (FieldType b : FieldType.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final FieldType enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public FieldType read(final JsonReader jsonReader) throws IOException { + Integer value = jsonReader.nextInt(); + return FieldType.fromValue(String.valueOf(value)); + } + } +} + diff --git a/src/main/java/com/aspose/asposecloudpdf/model/Fields.java b/src/main/java/com/aspose/asposecloudpdf/model/Fields.java new file mode 100644 index 0000000..6c73d8b --- /dev/null +++ b/src/main/java/com/aspose/asposecloudpdf/model/Fields.java @@ -0,0 +1,117 @@ +/** + * + * Copyright (c) 2018 Aspose.Pdf for Cloud + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + */ + + +package com.aspose.asposecloudpdf.model; + +import java.util.Objects; +import com.aspose.asposecloudpdf.model.Field; +import com.aspose.asposecloudpdf.model.Link; +import com.aspose.asposecloudpdf.model.LinkElement; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +/** + * List of form fields. + */ +@ApiModel(description = "List of form fields.") + +public class Fields extends LinkElement { + @SerializedName("List") + private List list = null; + + public Fields list(List list) { + this.list = list; + return this; + } + + public Fields addListItem(Field listItem) { + if (this.list == null) { + this.list = new ArrayList(); + } + this.list.add(listItem); + return this; + } + + /** + * Get list + * @return list + **/ + @ApiModelProperty(value = "") + public List getList() { + return list; + } + + public void setList(List list) { + this.list = list; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Fields fields = (Fields) o; + return Objects.equals(this.list, fields.list) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(list, super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Fields {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" list: ").append(toIndentedString(list)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/aspose/asposecloudpdf/model/FieldsResponse.java b/src/main/java/com/aspose/asposecloudpdf/model/FieldsResponse.java new file mode 100644 index 0000000..b8b0b6c --- /dev/null +++ b/src/main/java/com/aspose/asposecloudpdf/model/FieldsResponse.java @@ -0,0 +1,106 @@ +/** + * + * Copyright (c) 2018 Aspose.Pdf for Cloud + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + */ + + +package com.aspose.asposecloudpdf.model; + +import java.util.Objects; +import com.aspose.asposecloudpdf.model.Fields; +import com.aspose.asposecloudpdf.model.HttpStatusCode; +import com.aspose.asposecloudpdf.model.SaaSposeResponse; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +/** + * FieldsResponse + */ + +public class FieldsResponse extends SaaSposeResponse { + @SerializedName("Fields") + private Fields fields = null; + + public FieldsResponse fields(Fields fields) { + this.fields = fields; + return this; + } + + /** + * Get fields + * @return fields + **/ + @ApiModelProperty(value = "") + public Fields getFields() { + return fields; + } + + public void setFields(Fields fields) { + this.fields = fields; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FieldsResponse fieldsResponse = (FieldsResponse) o; + return Objects.equals(this.fields, fieldsResponse.fields) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(fields, super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FieldsResponse {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" fields: ").append(toIndentedString(fields)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/aspose/asposecloudpdf/model/FontEncodingRules.java b/src/main/java/com/aspose/asposecloudpdf/model/FontEncodingRules.java new file mode 100644 index 0000000..8a02eeb --- /dev/null +++ b/src/main/java/com/aspose/asposecloudpdf/model/FontEncodingRules.java @@ -0,0 +1,82 @@ +/** + * + * Copyright (c) 2018 Aspose.Pdf for Cloud + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + */ + + +package com.aspose.asposecloudpdf.model; + +import java.util.Objects; +import io.swagger.annotations.ApiModel; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * This enumeration defines rules which tune encoding logic + */ +@JsonAdapter(FontEncodingRules.Adapter.class) +public enum FontEncodingRules { + + DEFAULT("Default"), + + DECREASETOUNICODEPRIORITYLEVEL("DecreaseToUnicodePriorityLevel"); + + private String value; + + FontEncodingRules(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static FontEncodingRules fromValue(String text) { + for (FontEncodingRules b : FontEncodingRules.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final FontEncodingRules enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public FontEncodingRules read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return FontEncodingRules.fromValue(String.valueOf(value)); + } + } +} + diff --git a/src/main/java/com/aspose/asposecloudpdf/model/FontSavingModes.java b/src/main/java/com/aspose/asposecloudpdf/model/FontSavingModes.java new file mode 100644 index 0000000..843f02e --- /dev/null +++ b/src/main/java/com/aspose/asposecloudpdf/model/FontSavingModes.java @@ -0,0 +1,86 @@ +/** + * + * Copyright (c) 2018 Aspose.Pdf for Cloud + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + */ + + +package com.aspose.asposecloudpdf.model; + +import java.util.Objects; +import io.swagger.annotations.ApiModel; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Enumerates modes that can be used for saving of fonts referenced in saved PDF + */ +@JsonAdapter(FontSavingModes.Adapter.class) +public enum FontSavingModes { + + ALWAYSSAVEASWOFF("AlwaysSaveAsWOFF"), + + ALWAYSSAVEASTTF("AlwaysSaveAsTTF"), + + ALWAYSSAVEASEOT("AlwaysSaveAsEOT"), + + SAVEINALLFORMATS("SaveInAllFormats"); + + private String value; + + FontSavingModes(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static FontSavingModes fromValue(String text) { + for (FontSavingModes b : FontSavingModes.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final FontSavingModes enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public FontSavingModes read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return FontSavingModes.fromValue(String.valueOf(value)); + } + } +} + diff --git a/src/main/java/com/aspose/asposecloudpdf/model/FontStyles.java b/src/main/java/com/aspose/asposecloudpdf/model/FontStyles.java new file mode 100644 index 0000000..2a5b8da --- /dev/null +++ b/src/main/java/com/aspose/asposecloudpdf/model/FontStyles.java @@ -0,0 +1,82 @@ +/** + * + * Copyright (c) 2018 Aspose.Pdf for Cloud + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + */ + + +package com.aspose.asposecloudpdf.model; + +import java.util.Objects; +import io.swagger.annotations.ApiModel; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Specifies style information applied to text. + */ +@JsonAdapter(FontStyles.Adapter.class) +public enum FontStyles { + + REGULAR(0), + BOLD(1), + ITALIC(2); + + private Integer value; + + FontStyles(Integer value) { + this.value = value; + } + + public Integer getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static FontStyles fromValue(String text) { + for (FontStyles b : FontStyles.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final FontStyles enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public FontStyles read(final JsonReader jsonReader) throws IOException { + Integer value = jsonReader.nextInt(); + return FontStyles.fromValue(String.valueOf(value)); + } + } +} + diff --git a/src/main/java/com/aspose/asposecloudpdf/model/HorizontalAlignment.java b/src/main/java/com/aspose/asposecloudpdf/model/HorizontalAlignment.java new file mode 100644 index 0000000..c24e5ef --- /dev/null +++ b/src/main/java/com/aspose/asposecloudpdf/model/HorizontalAlignment.java @@ -0,0 +1,83 @@ +/** + * + * Copyright (c) 2018 Aspose.Pdf for Cloud + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + */ + + +package com.aspose.asposecloudpdf.model; + +import java.util.Objects; +import io.swagger.annotations.ApiModel; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * + */ +@JsonAdapter(HorizontalAlignment.Adapter.class) +public enum HorizontalAlignment { + + NONE(0), + LEFT(1), + CENTER(2), + RIGHT(3); + + private Integer value; + + HorizontalAlignment(Integer value) { + this.value = value; + } + + public Integer getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static HorizontalAlignment fromValue(String text) { + for (HorizontalAlignment b : HorizontalAlignment.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final HorizontalAlignment enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public HorizontalAlignment read(final JsonReader jsonReader) throws IOException { + Integer value = jsonReader.nextInt(); + return HorizontalAlignment.fromValue(String.valueOf(value)); + } + } +} + diff --git a/src/main/java/com/aspose/asposecloudpdf/model/HtmlDocumentType.java b/src/main/java/com/aspose/asposecloudpdf/model/HtmlDocumentType.java new file mode 100644 index 0000000..1ce613b --- /dev/null +++ b/src/main/java/com/aspose/asposecloudpdf/model/HtmlDocumentType.java @@ -0,0 +1,82 @@ +/** + * + * Copyright (c) 2018 Aspose.Pdf for Cloud + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + */ + + +package com.aspose.asposecloudpdf.model; + +import java.util.Objects; +import io.swagger.annotations.ApiModel; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Represents enumeration of the Html document types. + */ +@JsonAdapter(HtmlDocumentType.Adapter.class) +public enum HtmlDocumentType { + + XHTML("Xhtml"), + + HTML5("Html5"); + + private String value; + + HtmlDocumentType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static HtmlDocumentType fromValue(String text) { + for (HtmlDocumentType b : HtmlDocumentType.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final HtmlDocumentType enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public HtmlDocumentType read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return HtmlDocumentType.fromValue(String.valueOf(value)); + } + } +} + diff --git a/src/main/java/com/aspose/asposecloudpdf/model/HtmlMarkupGenerationModes.java b/src/main/java/com/aspose/asposecloudpdf/model/HtmlMarkupGenerationModes.java new file mode 100644 index 0000000..b2a1681 --- /dev/null +++ b/src/main/java/com/aspose/asposecloudpdf/model/HtmlMarkupGenerationModes.java @@ -0,0 +1,82 @@ +/** + * + * Copyright (c) 2018 Aspose.Pdf for Cloud + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + */ + + +package com.aspose.asposecloudpdf.model; + +import java.util.Objects; +import io.swagger.annotations.ApiModel; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Sometimes specific reqirments to created HTML are present. This enum defines HTML preparing modes that can be used during conversion of PDF to HTML to match such specific requirments. + */ +@JsonAdapter(HtmlMarkupGenerationModes.Adapter.class) +public enum HtmlMarkupGenerationModes { + + WRITEALLHTML("WriteAllHtml"), + + WRITEONLYBODYCONTENT("WriteOnlyBodyContent"); + + private String value; + + HtmlMarkupGenerationModes(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static HtmlMarkupGenerationModes fromValue(String text) { + for (HtmlMarkupGenerationModes b : HtmlMarkupGenerationModes.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final HtmlMarkupGenerationModes enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public HtmlMarkupGenerationModes read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return HtmlMarkupGenerationModes.fromValue(String.valueOf(value)); + } + } +} + diff --git a/src/main/java/com/aspose/asposecloudpdf/model/HttpStatusCode.java b/src/main/java/com/aspose/asposecloudpdf/model/HttpStatusCode.java new file mode 100644 index 0000000..0860e4d --- /dev/null +++ b/src/main/java/com/aspose/asposecloudpdf/model/HttpStatusCode.java @@ -0,0 +1,126 @@ +/** + * + * Copyright (c) 2018 Aspose.Pdf for Cloud + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + */ + + +package com.aspose.asposecloudpdf.model; + +import java.util.Objects; +import io.swagger.annotations.ApiModel; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * + */ +@JsonAdapter(HttpStatusCode.Adapter.class) +public enum HttpStatusCode { + + CONTINUE(100), + SWITCHING_PROTOCOLS(101), + OK(200), + CREATED(201), + ACCEPTED(202), + NON_AUTHORITATIVE_INFORMATION(203), + NO_CONTENT(204), + RESET_CONTENT(205), + PARTIAL_CONTENT(206), + MULTIPLE_CHOICES(300), + AMBIGUOUS(300), + MOVED_PERMANENTLY(301), + MOVED(301), + FOUND(302), + REDIRECT(302), + SEE_OTHER(303), + REDIRECT_METHOD(303), + NOT_MODIFIED(304), + USE_PROXY(305), + UNUSED(306), + TEMPORARY_REDIRECT(307), + REDIRECT_KEEP_VERB(307), + BAD_REQUEST(400), + UNAUTHORIZED(401), + PAYMENT_REQUIRED(402), + FORBIDDEN(403), + NOT_FOUND(404), + METHOD_NOT_ALLOWED(405), + NOT_ACCEPTABLE(406), + PROXY_AUTHENTICATION_REQUIRED(407), + REQUEST_TIMEOUT(408), + CONFLICT(409), + GONE(410), + LENGTH_REQUIRED(411), + PRECONDITION_FAILED(412), + REQUEST_ENTITY_TOO_LARGE(413), + REQUEST_URI_TOO_LONG(414), + UNSUPPORTED_MEDIA_TYPE(415), + REQUESTED_RANGE_NOT_SATISFIABLE(416), + EXPECTATION_FAILED(417), + UPGRADE_REQUIRED(426), + INTERNAL_SERVER_ERROR(500), + NOT_IMPLEMENTED(501), + BAD_GATEWAY(502), + SERVICE_UNAVAILABLE(503), + GATEWAY_TIMEOUT(504), + HTTP_VERSION_NOT_SUPPORTED(505); + + private Integer value; + + HttpStatusCode(Integer value) { + this.value = value; + } + + public Integer getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static HttpStatusCode fromValue(String text) { + for (HttpStatusCode b : HttpStatusCode.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final HttpStatusCode enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public HttpStatusCode read(final JsonReader jsonReader) throws IOException { + Integer value = jsonReader.nextInt(); + return HttpStatusCode.fromValue(String.valueOf(value)); + } + } +} + diff --git a/src/main/java/com/aspose/asposecloudpdf/model/Image.java b/src/main/java/com/aspose/asposecloudpdf/model/Image.java new file mode 100644 index 0000000..f21beae --- /dev/null +++ b/src/main/java/com/aspose/asposecloudpdf/model/Image.java @@ -0,0 +1,130 @@ +/** + * + * Copyright (c) 2018 Aspose.Pdf for Cloud + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + */ + + +package com.aspose.asposecloudpdf.model; + +import java.util.Objects; +import com.aspose.asposecloudpdf.model.Link; +import com.aspose.asposecloudpdf.model.LinkElement; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.List; + +/** + * Represents image DTO. + */ +@ApiModel(description = "Represents image DTO.") + +public class Image extends LinkElement { + @SerializedName("Width") + private Integer width = null; + + @SerializedName("Height") + private Integer height = null; + + public Image width(Integer width) { + this.width = width; + return this; + } + + /** + * Gets width of the image. + * @return width + **/ + @ApiModelProperty(value = "Gets width of the image.") + public Integer getWidth() { + return width; + } + + public void setWidth(Integer width) { + this.width = width; + } + + public Image height(Integer height) { + this.height = height; + return this; + } + + /** + * Gets height of the image. + * @return height + **/ + @ApiModelProperty(value = "Gets height of the image.") + public Integer getHeight() { + return height; + } + + public void setHeight(Integer height) { + this.height = height; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Image image = (Image) o; + return Objects.equals(this.width, image.width) && + Objects.equals(this.height, image.height) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(width, height, super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Image {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" width: ").append(toIndentedString(width)).append("\n"); + sb.append(" height: ").append(toIndentedString(height)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/aspose/asposecloudpdf/model/ImageResponse.java b/src/main/java/com/aspose/asposecloudpdf/model/ImageResponse.java new file mode 100644 index 0000000..4fb3998 --- /dev/null +++ b/src/main/java/com/aspose/asposecloudpdf/model/ImageResponse.java @@ -0,0 +1,106 @@ +/** + * + * Copyright (c) 2018 Aspose.Pdf for Cloud + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + */ + + +package com.aspose.asposecloudpdf.model; + +import java.util.Objects; +import com.aspose.asposecloudpdf.model.HttpStatusCode; +import com.aspose.asposecloudpdf.model.Image; +import com.aspose.asposecloudpdf.model.SaaSposeResponse; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +/** + * ImageResponse + */ + +public class ImageResponse extends SaaSposeResponse { + @SerializedName("Image") + private Image image = null; + + public ImageResponse image(Image image) { + this.image = image; + return this; + } + + /** + * Get image + * @return image + **/ + @ApiModelProperty(value = "") + public Image getImage() { + return image; + } + + public void setImage(Image image) { + this.image = image; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ImageResponse imageResponse = (ImageResponse) o; + return Objects.equals(this.image, imageResponse.image) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(image, super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ImageResponse {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" image: ").append(toIndentedString(image)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/aspose/asposecloudpdf/model/Images.java b/src/main/java/com/aspose/asposecloudpdf/model/Images.java new file mode 100644 index 0000000..c00da88 --- /dev/null +++ b/src/main/java/com/aspose/asposecloudpdf/model/Images.java @@ -0,0 +1,117 @@ +/** + * + * Copyright (c) 2018 Aspose.Pdf for Cloud + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + */ + + +package com.aspose.asposecloudpdf.model; + +import java.util.Objects; +import com.aspose.asposecloudpdf.model.Image; +import com.aspose.asposecloudpdf.model.Link; +import com.aspose.asposecloudpdf.model.LinkElement; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +/** + * List of page images. + */ +@ApiModel(description = "List of page images.") + +public class Images extends LinkElement { + @SerializedName("List") + private List list = null; + + public Images list(List list) { + this.list = list; + return this; + } + + public Images addListItem(Image listItem) { + if (this.list == null) { + this.list = new ArrayList(); + } + this.list.add(listItem); + return this; + } + + /** + * Get list + * @return list + **/ + @ApiModelProperty(value = "") + public List getList() { + return list; + } + + public void setList(List list) { + this.list = list; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Images images = (Images) o; + return Objects.equals(this.list, images.list) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(list, super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Images {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" list: ").append(toIndentedString(list)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/aspose/asposecloudpdf/model/ImagesListRequest.java b/src/main/java/com/aspose/asposecloudpdf/model/ImagesListRequest.java new file mode 100644 index 0000000..c30b9b1 --- /dev/null +++ b/src/main/java/com/aspose/asposecloudpdf/model/ImagesListRequest.java @@ -0,0 +1,110 @@ +/** + * + * Copyright (c) 2018 Aspose.Pdf for Cloud + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + */ + + +package com.aspose.asposecloudpdf.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +/** + * Create document from images request. + */ +@ApiModel(description = "Create document from images request.") + +public class ImagesListRequest { + @SerializedName("ImagesList") + private List imagesList = new ArrayList(); + + public ImagesListRequest imagesList(List imagesList) { + this.imagesList = imagesList; + return this; + } + + public ImagesListRequest addImagesListItem(String imagesListItem) { + this.imagesList.add(imagesListItem); + return this; + } + + /** + * A list of paths for images. + * @return imagesList + **/ + @ApiModelProperty(required = true, value = "A list of paths for images.") + public List getImagesList() { + return imagesList; + } + + public void setImagesList(List imagesList) { + this.imagesList = imagesList; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ImagesListRequest imagesListRequest = (ImagesListRequest) o; + return Objects.equals(this.imagesList, imagesListRequest.imagesList); + } + + @Override + public int hashCode() { + return Objects.hash(imagesList); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ImagesListRequest {\n"); + + sb.append(" imagesList: ").append(toIndentedString(imagesList)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/aspose/asposecloudpdf/model/ImagesResponse.java b/src/main/java/com/aspose/asposecloudpdf/model/ImagesResponse.java new file mode 100644 index 0000000..c83c172 --- /dev/null +++ b/src/main/java/com/aspose/asposecloudpdf/model/ImagesResponse.java @@ -0,0 +1,106 @@ +/** + * + * Copyright (c) 2018 Aspose.Pdf for Cloud + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + */ + + +package com.aspose.asposecloudpdf.model; + +import java.util.Objects; +import com.aspose.asposecloudpdf.model.HttpStatusCode; +import com.aspose.asposecloudpdf.model.Images; +import com.aspose.asposecloudpdf.model.SaaSposeResponse; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +/** + * ImagesResponse + */ + +public class ImagesResponse extends SaaSposeResponse { + @SerializedName("Images") + private Images images = null; + + public ImagesResponse images(Images images) { + this.images = images; + return this; + } + + /** + * Get images + * @return images + **/ + @ApiModelProperty(value = "") + public Images getImages() { + return images; + } + + public void setImages(Images images) { + this.images = images; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ImagesResponse imagesResponse = (ImagesResponse) o; + return Objects.equals(this.images, imagesResponse.images) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(images, super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ImagesResponse {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" images: ").append(toIndentedString(images)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/aspose/asposecloudpdf/model/LettersPositioningMethods.java b/src/main/java/com/aspose/asposecloudpdf/model/LettersPositioningMethods.java new file mode 100644 index 0000000..ab0d80b --- /dev/null +++ b/src/main/java/com/aspose/asposecloudpdf/model/LettersPositioningMethods.java @@ -0,0 +1,82 @@ +/** + * + * Copyright (c) 2018 Aspose.Pdf for Cloud + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + */ + + +package com.aspose.asposecloudpdf.model; + +import java.util.Objects; +import io.swagger.annotations.ApiModel; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * It enumerates possible modes of positioning of letters in words in result HTML + */ +@JsonAdapter(LettersPositioningMethods.Adapter.class) +public enum LettersPositioningMethods { + + USEEMUNITSANDCOMPENSATIONOFROUNDINGERRORSINCSS("UseEmUnitsAndCompensationOfRoundingErrorsInCss"), + + USEPIXELUNITSINCSSLETTERSPACINGFORIE("UsePixelUnitsInCssLetterSpacingForIE"); + + private String value; + + LettersPositioningMethods(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static LettersPositioningMethods fromValue(String text) { + for (LettersPositioningMethods b : LettersPositioningMethods.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final LettersPositioningMethods enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public LettersPositioningMethods read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return LettersPositioningMethods.fromValue(String.valueOf(value)); + } + } +} + diff --git a/src/main/java/com/aspose/asposecloudpdf/model/LineSpacing.java b/src/main/java/com/aspose/asposecloudpdf/model/LineSpacing.java new file mode 100644 index 0000000..e6f8377 --- /dev/null +++ b/src/main/java/com/aspose/asposecloudpdf/model/LineSpacing.java @@ -0,0 +1,82 @@ +/** + * + * Copyright (c) 2018 Aspose.Pdf for Cloud + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + */ + + +package com.aspose.asposecloudpdf.model; + +import java.util.Objects; +import io.swagger.annotations.ApiModel; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * + */ +@JsonAdapter(LineSpacing.Adapter.class) +public enum LineSpacing { + + FONTSIZE("FontSize"), + + FULLSIZE("FullSize"); + + private String value; + + LineSpacing(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static LineSpacing fromValue(String text) { + for (LineSpacing b : LineSpacing.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final LineSpacing enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public LineSpacing read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return LineSpacing.fromValue(String.valueOf(value)); + } + } +} + diff --git a/src/main/java/com/aspose/asposecloudpdf/model/Link.java b/src/main/java/com/aspose/asposecloudpdf/model/Link.java new file mode 100644 index 0000000..df5379f --- /dev/null +++ b/src/main/java/com/aspose/asposecloudpdf/model/Link.java @@ -0,0 +1,173 @@ +/** + * + * Copyright (c) 2018 Aspose.Pdf for Cloud + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + */ + + +package com.aspose.asposecloudpdf.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +/** + * Provides information for the object link. This is supposed to be an atom:link, therefore it should have all attributes specified here http://tools.ietf.org/html/rfc4287#section-4.2.7 + */ +@ApiModel(description = "Provides information for the object link. This is supposed to be an atom:link, therefore it should have all attributes specified here http://tools.ietf.org/html/rfc4287#section-4.2.7") + + +public class Link { + @SerializedName("Href") + private String href = null; + + @SerializedName("Rel") + private String rel = null; + + @SerializedName("Type") + private String type = null; + + @SerializedName("Title") + private String title = null; + + public Link href(String href) { + this.href = href; + return this; + } + + /** + * The \"href\" attribute contains the link's IRI. atom:link elements MUST have an href attribute, whose value MUST be a IRI reference + * @return href + **/ + @ApiModelProperty(value = "The \"href\" attribute contains the link's IRI. atom:link elements MUST have an href attribute, whose value MUST be a IRI reference") + public String getHref() { + return href; + } + + public void setHref(String href) { + this.href = href; + } + + public Link rel(String rel) { + this.rel = rel; + return this; + } + + /** + * atom:link elements MAY have a \"rel\" attribute that indicates the link relation type. If the \"rel\" attribute is not present, the link element MUST be interpreted as if the link relation type is \"alternate\". + * @return rel + **/ + @ApiModelProperty(value = "atom:link elements MAY have a \"rel\" attribute that indicates the link relation type. If the \"rel\" attribute is not present, the link element MUST be interpreted as if the link relation type is \"alternate\".") + public String getRel() { + return rel; + } + + public void setRel(String rel) { + this.rel = rel; + } + + public Link type(String type) { + this.type = type; + return this; + } + + /** + * On the link element, the \"type\" attribute's value is an advisory media type: it is a hint about the type of the representation that is expected to be returned when the value of the href attribute is dereferenced. Note that the type attribute does not override the actual media type returned with the representation. + * @return type + **/ + @ApiModelProperty(value = "On the link element, the \"type\" attribute's value is an advisory media type: it is a hint about the type of the representation that is expected to be returned when the value of the href attribute is dereferenced. Note that the type attribute does not override the actual media type returned with the representation.") + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public Link title(String title) { + this.title = title; + return this; + } + + /** + * The \"title\" attribute conveys human-readable information about the link. The content of the \"title\" attribute is Language-Sensitive. + * @return title + **/ + @ApiModelProperty(value = "The \"title\" attribute conveys human-readable information about the link. The content of the \"title\" attribute is Language-Sensitive.") + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Link link = (Link) o; + return Objects.equals(this.href, link.href) && + Objects.equals(this.rel, link.rel) && + Objects.equals(this.type, link.type) && + Objects.equals(this.title, link.title); + } + + @Override + public int hashCode() { + return Objects.hash(href, rel, type, title); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Link {\n"); + + sb.append(" href: ").append(toIndentedString(href)).append("\n"); + sb.append(" rel: ").append(toIndentedString(rel)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" title: ").append(toIndentedString(title)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/aspose/asposecloudpdf/model/LinkActionType.java b/src/main/java/com/aspose/asposecloudpdf/model/LinkActionType.java new file mode 100644 index 0000000..9414640 --- /dev/null +++ b/src/main/java/com/aspose/asposecloudpdf/model/LinkActionType.java @@ -0,0 +1,85 @@ +/** + * + * Copyright (c) 2018 Aspose.Pdf for Cloud + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + */ + + +package com.aspose.asposecloudpdf.model; + +import java.util.Objects; +import io.swagger.annotations.ApiModel; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Represents list of link action types. + */ +@JsonAdapter(LinkActionType.Adapter.class) +public enum LinkActionType { + + GO_TO_ACTION(0), + GO_TO_URI_ACTION(1), + JAVASCRIPT_ACTION(2), + LAUNCH_ACTION(3), + NAMED_ACTION(4), + SUBMIT_FORM_ACTION(5); + + private Integer value; + + LinkActionType(Integer value) { + this.value = value; + } + + public Integer getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static LinkActionType fromValue(String text) { + for (LinkActionType b : LinkActionType.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final LinkActionType enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public LinkActionType read(final JsonReader jsonReader) throws IOException { + Integer value = jsonReader.nextInt(); + return LinkActionType.fromValue(String.valueOf(value)); + } + } +} + diff --git a/src/main/java/com/aspose/asposecloudpdf/model/LinkAnnotation.java b/src/main/java/com/aspose/asposecloudpdf/model/LinkAnnotation.java new file mode 100644 index 0000000..89270a3 --- /dev/null +++ b/src/main/java/com/aspose/asposecloudpdf/model/LinkAnnotation.java @@ -0,0 +1,179 @@ +/** + * + * Copyright (c) 2018 Aspose.Pdf for Cloud + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + */ + + +package com.aspose.asposecloudpdf.model; + +import java.util.Objects; +import com.aspose.asposecloudpdf.model.Color; +import com.aspose.asposecloudpdf.model.Link; +import com.aspose.asposecloudpdf.model.LinkActionType; +import com.aspose.asposecloudpdf.model.LinkElement; +import com.aspose.asposecloudpdf.model.LinkHighlightingMode; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.List; + +/** + * Provides link to linkAnnotation. + */ +@ApiModel(description = "Provides link to linkAnnotation.") + +public class LinkAnnotation extends LinkElement { + @SerializedName("ActionType") + private LinkActionType actionType = null; + + @SerializedName("Action") + private String action = null; + + @SerializedName("Highlighting") + private LinkHighlightingMode highlighting = null; + + @SerializedName("Color") + private Color color = null; + + public LinkAnnotation actionType(LinkActionType actionType) { + this.actionType = actionType; + return this; + } + + /** + * Get actionType + * @return actionType + **/ + @ApiModelProperty(value = "") + public LinkActionType getActionType() { + return actionType; + } + + public void setActionType(LinkActionType actionType) { + this.actionType = actionType; + } + + public LinkAnnotation action(String action) { + this.action = action; + return this; + } + + /** + * Get action + * @return action + **/ + @ApiModelProperty(value = "") + public String getAction() { + return action; + } + + public void setAction(String action) { + this.action = action; + } + + public LinkAnnotation highlighting(LinkHighlightingMode highlighting) { + this.highlighting = highlighting; + return this; + } + + /** + * Get highlighting + * @return highlighting + **/ + @ApiModelProperty(value = "") + public LinkHighlightingMode getHighlighting() { + return highlighting; + } + + public void setHighlighting(LinkHighlightingMode highlighting) { + this.highlighting = highlighting; + } + + public LinkAnnotation color(Color color) { + this.color = color; + return this; + } + + /** + * Get color + * @return color + **/ + @ApiModelProperty(value = "") + public Color getColor() { + return color; + } + + public void setColor(Color color) { + this.color = color; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LinkAnnotation linkAnnotation = (LinkAnnotation) o; + return Objects.equals(this.actionType, linkAnnotation.actionType) && + Objects.equals(this.action, linkAnnotation.action) && + Objects.equals(this.highlighting, linkAnnotation.highlighting) && + Objects.equals(this.color, linkAnnotation.color) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(actionType, action, highlighting, color, super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LinkAnnotation {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" actionType: ").append(toIndentedString(actionType)).append("\n"); + sb.append(" action: ").append(toIndentedString(action)).append("\n"); + sb.append(" highlighting: ").append(toIndentedString(highlighting)).append("\n"); + sb.append(" color: ").append(toIndentedString(color)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/aspose/asposecloudpdf/model/LinkAnnotationResponse.java b/src/main/java/com/aspose/asposecloudpdf/model/LinkAnnotationResponse.java new file mode 100644 index 0000000..3fc16e0 --- /dev/null +++ b/src/main/java/com/aspose/asposecloudpdf/model/LinkAnnotationResponse.java @@ -0,0 +1,106 @@ +/** + * + * Copyright (c) 2018 Aspose.Pdf for Cloud + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + */ + + +package com.aspose.asposecloudpdf.model; + +import java.util.Objects; +import com.aspose.asposecloudpdf.model.HttpStatusCode; +import com.aspose.asposecloudpdf.model.LinkAnnotation; +import com.aspose.asposecloudpdf.model.SaaSposeResponse; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +/** + * LinkAnnotationResponse + */ + +public class LinkAnnotationResponse extends SaaSposeResponse { + @SerializedName("Link") + private LinkAnnotation link = null; + + public LinkAnnotationResponse link(LinkAnnotation link) { + this.link = link; + return this; + } + + /** + * Get link + * @return link + **/ + @ApiModelProperty(value = "") + public LinkAnnotation getLink() { + return link; + } + + public void setLink(LinkAnnotation link) { + this.link = link; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LinkAnnotationResponse linkAnnotationResponse = (LinkAnnotationResponse) o; + return Objects.equals(this.link, linkAnnotationResponse.link) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(link, super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LinkAnnotationResponse {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" link: ").append(toIndentedString(link)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/aspose/asposecloudpdf/model/LinkAnnotations.java b/src/main/java/com/aspose/asposecloudpdf/model/LinkAnnotations.java new file mode 100644 index 0000000..576b7c8 --- /dev/null +++ b/src/main/java/com/aspose/asposecloudpdf/model/LinkAnnotations.java @@ -0,0 +1,116 @@ +/** + * + * Copyright (c) 2018 Aspose.Pdf for Cloud + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + */ + + +package com.aspose.asposecloudpdf.model; + +import java.util.Objects; +import com.aspose.asposecloudpdf.model.Link; +import com.aspose.asposecloudpdf.model.LinkElement; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +/** + * List of LinkAnnotations. + */ +@ApiModel(description = "List of LinkAnnotations.") + +public class LinkAnnotations extends LinkElement { + @SerializedName("List") + private List list = null; + + public LinkAnnotations list(List list) { + this.list = list; + return this; + } + + public LinkAnnotations addListItem(LinkElement listItem) { + if (this.list == null) { + this.list = new ArrayList(); + } + this.list.add(listItem); + return this; + } + + /** + * Get list + * @return list + **/ + @ApiModelProperty(value = "") + public List getList() { + return list; + } + + public void setList(List list) { + this.list = list; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LinkAnnotations linkAnnotations = (LinkAnnotations) o; + return Objects.equals(this.list, linkAnnotations.list) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(list, super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LinkAnnotations {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" list: ").append(toIndentedString(list)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/aspose/asposecloudpdf/model/LinkAnnotationsResponse.java b/src/main/java/com/aspose/asposecloudpdf/model/LinkAnnotationsResponse.java new file mode 100644 index 0000000..cbfc857 --- /dev/null +++ b/src/main/java/com/aspose/asposecloudpdf/model/LinkAnnotationsResponse.java @@ -0,0 +1,106 @@ +/** + * + * Copyright (c) 2018 Aspose.Pdf for Cloud + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + */ + + +package com.aspose.asposecloudpdf.model; + +import java.util.Objects; +import com.aspose.asposecloudpdf.model.HttpStatusCode; +import com.aspose.asposecloudpdf.model.LinkAnnotations; +import com.aspose.asposecloudpdf.model.SaaSposeResponse; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +/** + * LinkAnnotationsResponse + */ + +public class LinkAnnotationsResponse extends SaaSposeResponse { + @SerializedName("Links") + private LinkAnnotations links = null; + + public LinkAnnotationsResponse links(LinkAnnotations links) { + this.links = links; + return this; + } + + /** + * Get links + * @return links + **/ + @ApiModelProperty(value = "") + public LinkAnnotations getLinks() { + return links; + } + + public void setLinks(LinkAnnotations links) { + this.links = links; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LinkAnnotationsResponse linkAnnotationsResponse = (LinkAnnotationsResponse) o; + return Objects.equals(this.links, linkAnnotationsResponse.links) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(links, super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LinkAnnotationsResponse {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" links: ").append(toIndentedString(links)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/aspose/asposecloudpdf/model/LinkElement.java b/src/main/java/com/aspose/asposecloudpdf/model/LinkElement.java new file mode 100644 index 0000000..e348da5 --- /dev/null +++ b/src/main/java/com/aspose/asposecloudpdf/model/LinkElement.java @@ -0,0 +1,115 @@ +/** + * + * Copyright (c) 2018 Aspose.Pdf for Cloud + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + */ + + +package com.aspose.asposecloudpdf.model; + +import java.util.Objects; +import com.aspose.asposecloudpdf.model.Link; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +/** + * Represents base DTO object. + */ +@ApiModel(description = "Represents base DTO object.") + + +public class LinkElement { + @SerializedName("Links") + private List links = null; + + public LinkElement links(List links) { + this.links = links; + return this; + } + + public LinkElement addLinksItem(Link linksItem) { + if (this.links == null) { + this.links = new ArrayList(); + } + this.links.add(linksItem); + return this; + } + + /** + * Link to the document. + * @return links + **/ + @ApiModelProperty(value = "Link to the document.") + public List getLinks() { + return links; + } + + public void setLinks(List links) { + this.links = links; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LinkElement linkElement = (LinkElement) o; + return Objects.equals(this.links, linkElement.links); + } + + @Override + public int hashCode() { + return Objects.hash(links); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LinkElement {\n"); + + sb.append(" links: ").append(toIndentedString(links)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/aspose/asposecloudpdf/model/LinkHighlightingMode.java b/src/main/java/com/aspose/asposecloudpdf/model/LinkHighlightingMode.java new file mode 100644 index 0000000..edd9782 --- /dev/null +++ b/src/main/java/com/aspose/asposecloudpdf/model/LinkHighlightingMode.java @@ -0,0 +1,84 @@ +/** + * + * Copyright (c) 2018 Aspose.Pdf for Cloud + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + */ + + +package com.aspose.asposecloudpdf.model; + +import java.util.Objects; +import io.swagger.annotations.ApiModel; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Enumerates the annotation�s highlighting mode, the visual effect to be used when the mouse button is pressed or held down inside its active area. + */ +@JsonAdapter(LinkHighlightingMode.Adapter.class) +public enum LinkHighlightingMode { + + NONE(0), + INVERT(1), + OUTLINE(2), + PUSH(3), + TOGGLE(4); + + private Integer value; + + LinkHighlightingMode(Integer value) { + this.value = value; + } + + public Integer getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static LinkHighlightingMode fromValue(String text) { + for (LinkHighlightingMode b : LinkHighlightingMode.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final LinkHighlightingMode enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public LinkHighlightingMode read(final JsonReader jsonReader) throws IOException { + Integer value = jsonReader.nextInt(); + return LinkHighlightingMode.fromValue(String.valueOf(value)); + } + } +} + diff --git a/src/main/java/com/aspose/asposecloudpdf/model/MergeDocuments.java b/src/main/java/com/aspose/asposecloudpdf/model/MergeDocuments.java new file mode 100644 index 0000000..0559998 --- /dev/null +++ b/src/main/java/com/aspose/asposecloudpdf/model/MergeDocuments.java @@ -0,0 +1,113 @@ +/** + * + * Copyright (c) 2018 Aspose.Pdf for Cloud + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + */ + + +package com.aspose.asposecloudpdf.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +/** + * Documents for merging. + */ +@ApiModel(description = "Documents for merging.") + +public class MergeDocuments { + @SerializedName("List") + private List list = null; + + public MergeDocuments list(List list) { + this.list = list; + return this; + } + + public MergeDocuments addListItem(String listItem) { + if (this.list == null) { + this.list = new ArrayList(); + } + this.list.add(listItem); + return this; + } + + /** + * List of documents for merging. + * @return list + **/ + @ApiModelProperty(value = "List of documents for merging.") + public List getList() { + return list; + } + + public void setList(List list) { + this.list = list; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MergeDocuments mergeDocuments = (MergeDocuments) o; + return Objects.equals(this.list, mergeDocuments.list); + } + + @Override + public int hashCode() { + return Objects.hash(list); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MergeDocuments {\n"); + + sb.append(" list: ").append(toIndentedString(list)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/aspose/asposecloudpdf/model/OptimizeOptions.java b/src/main/java/com/aspose/asposecloudpdf/model/OptimizeOptions.java new file mode 100644 index 0000000..1487b0a --- /dev/null +++ b/src/main/java/com/aspose/asposecloudpdf/model/OptimizeOptions.java @@ -0,0 +1,241 @@ +/** + * + * Copyright (c) 2018 Aspose.Pdf for Cloud + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + */ + + +package com.aspose.asposecloudpdf.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +/** + * Represents Pdf optimize options. + */ +@ApiModel(description = "Represents Pdf optimize options.") + +public class OptimizeOptions { + @SerializedName("AllowReusePageContent") + private Boolean allowReusePageContent = null; + + @SerializedName("CompressImages") + private Boolean compressImages = null; + + @SerializedName("ImageQuality") + private Integer imageQuality = null; + + @SerializedName("LinkDuplcateStreams") + private Boolean linkDuplcateStreams = null; + + @SerializedName("RemoveUnusedObjects") + private Boolean removeUnusedObjects = null; + + @SerializedName("RemoveUnusedStreams") + private Boolean removeUnusedStreams = null; + + @SerializedName("UnembedFonts") + private Boolean unembedFonts = null; + + public OptimizeOptions allowReusePageContent(Boolean allowReusePageContent) { + this.allowReusePageContent = allowReusePageContent; + return this; + } + + /** + * If true page contents will be reused when document is optimized for equal pages. + * @return allowReusePageContent + **/ + @ApiModelProperty(required = true, value = "If true page contents will be reused when document is optimized for equal pages.") + public Boolean isAllowReusePageContent() { + return allowReusePageContent; + } + + public void setAllowReusePageContent(Boolean allowReusePageContent) { + this.allowReusePageContent = allowReusePageContent; + } + + public OptimizeOptions compressImages(Boolean compressImages) { + this.compressImages = compressImages; + return this; + } + + /** + * If this flag is set to true images will be compressed in the document. compression level is specfied with ImageQuality property. + * @return compressImages + **/ + @ApiModelProperty(required = true, value = "If this flag is set to true images will be compressed in the document. compression level is specfied with ImageQuality property.") + public Boolean isCompressImages() { + return compressImages; + } + + public void setCompressImages(Boolean compressImages) { + this.compressImages = compressImages; + } + + public OptimizeOptions imageQuality(Integer imageQuality) { + this.imageQuality = imageQuality; + return this; + } + + /** + * Specifie slevel of image compression when CompressIamges flag is used. + * @return imageQuality + **/ + @ApiModelProperty(required = true, value = "Specifie slevel of image compression when CompressIamges flag is used.") + public Integer getImageQuality() { + return imageQuality; + } + + public void setImageQuality(Integer imageQuality) { + this.imageQuality = imageQuality; + } + + public OptimizeOptions linkDuplcateStreams(Boolean linkDuplcateStreams) { + this.linkDuplcateStreams = linkDuplcateStreams; + return this; + } + + /** + * If this flag is set to true, Resource streams will be analyzed. If duplicate streams are found (i.e. if stream contents is equal), then thes streams will be stored as one object. This allows to decrease document size in some cases (for example, when same document was concatenedted multiple times). + * @return linkDuplcateStreams + **/ + @ApiModelProperty(required = true, value = "If this flag is set to true, Resource streams will be analyzed. If duplicate streams are found (i.e. if stream contents is equal), then thes streams will be stored as one object. This allows to decrease document size in some cases (for example, when same document was concatenedted multiple times).") + public Boolean isLinkDuplcateStreams() { + return linkDuplcateStreams; + } + + public void setLinkDuplcateStreams(Boolean linkDuplcateStreams) { + this.linkDuplcateStreams = linkDuplcateStreams; + } + + public OptimizeOptions removeUnusedObjects(Boolean removeUnusedObjects) { + this.removeUnusedObjects = removeUnusedObjects; + return this; + } + + /** + * If this flag is set to true, all document objects will be checked and unused objects (i.e. objects which does not have any reference) are removed from document. + * @return removeUnusedObjects + **/ + @ApiModelProperty(required = true, value = "If this flag is set to true, all document objects will be checked and unused objects (i.e. objects which does not have any reference) are removed from document.") + public Boolean isRemoveUnusedObjects() { + return removeUnusedObjects; + } + + public void setRemoveUnusedObjects(Boolean removeUnusedObjects) { + this.removeUnusedObjects = removeUnusedObjects; + } + + public OptimizeOptions removeUnusedStreams(Boolean removeUnusedStreams) { + this.removeUnusedStreams = removeUnusedStreams; + return this; + } + + /** + * If this flag set to true, every resource is checked on it's usage. If resource is never used, then resources is removed. This may decrease document size for example when pages were extracted from document. + * @return removeUnusedStreams + **/ + @ApiModelProperty(required = true, value = "If this flag set to true, every resource is checked on it's usage. If resource is never used, then resources is removed. This may decrease document size for example when pages were extracted from document. ") + public Boolean isRemoveUnusedStreams() { + return removeUnusedStreams; + } + + public void setRemoveUnusedStreams(Boolean removeUnusedStreams) { + this.removeUnusedStreams = removeUnusedStreams; + } + + public OptimizeOptions unembedFonts(Boolean unembedFonts) { + this.unembedFonts = unembedFonts; + return this; + } + + /** + * Make fonts not embedded if set to true. + * @return unembedFonts + **/ + @ApiModelProperty(required = true, value = "Make fonts not embedded if set to true. ") + public Boolean isUnembedFonts() { + return unembedFonts; + } + + public void setUnembedFonts(Boolean unembedFonts) { + this.unembedFonts = unembedFonts; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OptimizeOptions optimizeOptions = (OptimizeOptions) o; + return Objects.equals(this.allowReusePageContent, optimizeOptions.allowReusePageContent) && + Objects.equals(this.compressImages, optimizeOptions.compressImages) && + Objects.equals(this.imageQuality, optimizeOptions.imageQuality) && + Objects.equals(this.linkDuplcateStreams, optimizeOptions.linkDuplcateStreams) && + Objects.equals(this.removeUnusedObjects, optimizeOptions.removeUnusedObjects) && + Objects.equals(this.removeUnusedStreams, optimizeOptions.removeUnusedStreams) && + Objects.equals(this.unembedFonts, optimizeOptions.unembedFonts); + } + + @Override + public int hashCode() { + return Objects.hash(allowReusePageContent, compressImages, imageQuality, linkDuplcateStreams, removeUnusedObjects, removeUnusedStreams, unembedFonts); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OptimizeOptions {\n"); + + sb.append(" allowReusePageContent: ").append(toIndentedString(allowReusePageContent)).append("\n"); + sb.append(" compressImages: ").append(toIndentedString(compressImages)).append("\n"); + sb.append(" imageQuality: ").append(toIndentedString(imageQuality)).append("\n"); + sb.append(" linkDuplcateStreams: ").append(toIndentedString(linkDuplcateStreams)).append("\n"); + sb.append(" removeUnusedObjects: ").append(toIndentedString(removeUnusedObjects)).append("\n"); + sb.append(" removeUnusedStreams: ").append(toIndentedString(removeUnusedStreams)).append("\n"); + sb.append(" unembedFonts: ").append(toIndentedString(unembedFonts)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/aspose/asposecloudpdf/model/Page.java b/src/main/java/com/aspose/asposecloudpdf/model/Page.java new file mode 100644 index 0000000..ff39751 --- /dev/null +++ b/src/main/java/com/aspose/asposecloudpdf/model/Page.java @@ -0,0 +1,155 @@ +/** + * + * Copyright (c) 2018 Aspose.Pdf for Cloud + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + */ + + +package com.aspose.asposecloudpdf.model; + +import java.util.Objects; +import com.aspose.asposecloudpdf.model.Images; +import com.aspose.asposecloudpdf.model.Link; +import com.aspose.asposecloudpdf.model.LinkElement; +import com.aspose.asposecloudpdf.model.Rectangle; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.List; + +/** + * Provides link to page. + */ +@ApiModel(description = "Provides link to page.") + +public class Page extends LinkElement { + @SerializedName("Id") + private Integer id = null; + + @SerializedName("Images") + private Images images = null; + + @SerializedName("Rectangle") + private Rectangle rectangle = null; + + public Page id(Integer id) { + this.id = id; + return this; + } + + /** + * Page's id. + * @return id + **/ + @ApiModelProperty(value = "Page's id.") + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public Page images(Images images) { + this.images = images; + return this; + } + + /** + * Get images + * @return images + **/ + @ApiModelProperty(value = "") + public Images getImages() { + return images; + } + + public void setImages(Images images) { + this.images = images; + } + + public Page rectangle(Rectangle rectangle) { + this.rectangle = rectangle; + return this; + } + + /** + * Get rectangle + * @return rectangle + **/ + @ApiModelProperty(value = "") + public Rectangle getRectangle() { + return rectangle; + } + + public void setRectangle(Rectangle rectangle) { + this.rectangle = rectangle; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Page page = (Page) o; + return Objects.equals(this.id, page.id) && + Objects.equals(this.images, page.images) && + Objects.equals(this.rectangle, page.rectangle) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(id, images, rectangle, super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Page {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" images: ").append(toIndentedString(images)).append("\n"); + sb.append(" rectangle: ").append(toIndentedString(rectangle)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/aspose/asposecloudpdf/model/PageTextReplaceResponse.java b/src/main/java/com/aspose/asposecloudpdf/model/PageTextReplaceResponse.java new file mode 100644 index 0000000..21cfd29 --- /dev/null +++ b/src/main/java/com/aspose/asposecloudpdf/model/PageTextReplaceResponse.java @@ -0,0 +1,106 @@ +/** + * + * Copyright (c) 2018 Aspose.Pdf for Cloud + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + */ + + +package com.aspose.asposecloudpdf.model; + +import java.util.Objects; +import com.aspose.asposecloudpdf.model.HttpStatusCode; +import com.aspose.asposecloudpdf.model.Page; +import com.aspose.asposecloudpdf.model.TextReplaceResponse; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +/** + * PageTextReplaceResponse + */ + +public class PageTextReplaceResponse extends TextReplaceResponse { + @SerializedName("Page") + private Page page = null; + + public PageTextReplaceResponse page(Page page) { + this.page = page; + return this; + } + + /** + * Get page + * @return page + **/ + @ApiModelProperty(value = "") + public Page getPage() { + return page; + } + + public void setPage(Page page) { + this.page = page; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PageTextReplaceResponse pageTextReplaceResponse = (PageTextReplaceResponse) o; + return Objects.equals(this.page, pageTextReplaceResponse.page) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(page, super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PageTextReplaceResponse {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" page: ").append(toIndentedString(page)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/aspose/asposecloudpdf/model/PageWordCount.java b/src/main/java/com/aspose/asposecloudpdf/model/PageWordCount.java new file mode 100644 index 0000000..6e8a451 --- /dev/null +++ b/src/main/java/com/aspose/asposecloudpdf/model/PageWordCount.java @@ -0,0 +1,126 @@ +/** + * + * Copyright (c) 2018 Aspose.Pdf for Cloud + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + */ + + +package com.aspose.asposecloudpdf.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +/** + * Page words count. + */ +@ApiModel(description = "Page words count.") + +public class PageWordCount { + @SerializedName("PageNumber") + private Integer pageNumber = null; + + @SerializedName("Count") + private Integer count = null; + + public PageWordCount pageNumber(Integer pageNumber) { + this.pageNumber = pageNumber; + return this; + } + + /** + * Page number. + * @return pageNumber + **/ + @ApiModelProperty(required = true, value = "Page number.") + public Integer getPageNumber() { + return pageNumber; + } + + public void setPageNumber(Integer pageNumber) { + this.pageNumber = pageNumber; + } + + public PageWordCount count(Integer count) { + this.count = count; + return this; + } + + /** + * Number of words at the page. + * @return count + **/ + @ApiModelProperty(required = true, value = "Number of words at the page.") + public Integer getCount() { + return count; + } + + public void setCount(Integer count) { + this.count = count; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PageWordCount pageWordCount = (PageWordCount) o; + return Objects.equals(this.pageNumber, pageWordCount.pageNumber) && + Objects.equals(this.count, pageWordCount.count); + } + + @Override + public int hashCode() { + return Objects.hash(pageNumber, count); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PageWordCount {\n"); + + sb.append(" pageNumber: ").append(toIndentedString(pageNumber)).append("\n"); + sb.append(" count: ").append(toIndentedString(count)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/aspose/asposecloudpdf/model/Pages.java b/src/main/java/com/aspose/asposecloudpdf/model/Pages.java new file mode 100644 index 0000000..7518d58 --- /dev/null +++ b/src/main/java/com/aspose/asposecloudpdf/model/Pages.java @@ -0,0 +1,117 @@ +/** + * + * Copyright (c) 2018 Aspose.Pdf for Cloud + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + */ + + +package com.aspose.asposecloudpdf.model; + +import java.util.Objects; +import com.aspose.asposecloudpdf.model.Link; +import com.aspose.asposecloudpdf.model.LinkElement; +import com.aspose.asposecloudpdf.model.Page; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +/** + * List of pages. + */ +@ApiModel(description = "List of pages.") + +public class Pages extends LinkElement { + @SerializedName("List") + private List list = null; + + public Pages list(List list) { + this.list = list; + return this; + } + + public Pages addListItem(Page listItem) { + if (this.list == null) { + this.list = new ArrayList(); + } + this.list.add(listItem); + return this; + } + + /** + * Get list + * @return list + **/ + @ApiModelProperty(value = "") + public List getList() { + return list; + } + + public void setList(List list) { + this.list = list; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Pages pages = (Pages) o; + return Objects.equals(this.list, pages.list) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(list, super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Pages {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" list: ").append(toIndentedString(list)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/aspose/asposecloudpdf/model/Paragraph.java b/src/main/java/com/aspose/asposecloudpdf/model/Paragraph.java new file mode 100644 index 0000000..e2fd71c --- /dev/null +++ b/src/main/java/com/aspose/asposecloudpdf/model/Paragraph.java @@ -0,0 +1,369 @@ +/** + * + * Copyright (c) 2018 Aspose.Pdf for Cloud + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + */ + + +package com.aspose.asposecloudpdf.model; + +import java.util.Objects; +import com.aspose.asposecloudpdf.model.LineSpacing; +import com.aspose.asposecloudpdf.model.Rectangle; +import com.aspose.asposecloudpdf.model.TextHorizontalAlignment; +import com.aspose.asposecloudpdf.model.TextLine; +import com.aspose.asposecloudpdf.model.VerticalAlignment; +import com.aspose.asposecloudpdf.model.WrapMode; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +/** + * Paragraph DTO for add text functionality. + */ +@ApiModel(description = "Paragraph DTO for add text functionality.") + +public class Paragraph { + @SerializedName("LineSpacing") + private LineSpacing lineSpacing = null; + + @SerializedName("WrapMode") + private WrapMode wrapMode = null; + + @SerializedName("HorizontalAlignment") + private TextHorizontalAlignment horizontalAlignment = null; + + @SerializedName("LeftMargin") + private Double leftMargin = null; + + @SerializedName("RightMargin") + private Double rightMargin = null; + + @SerializedName("TopMargin") + private Double topMargin = null; + + @SerializedName("BottomMargin") + private Double bottomMargin = null; + + @SerializedName("Rectangle") + private Rectangle rectangle = null; + + @SerializedName("Rotation") + private Double rotation = null; + + @SerializedName("SubsequentLinesIndent") + private Double subsequentLinesIndent = null; + + @SerializedName("VerticalAlignment") + private VerticalAlignment verticalAlignment = null; + + @SerializedName("Lines") + private List lines = new ArrayList(); + + public Paragraph lineSpacing(LineSpacing lineSpacing) { + this.lineSpacing = lineSpacing; + return this; + } + + /** + * Get lineSpacing + * @return lineSpacing + **/ + @ApiModelProperty(value = "") + public LineSpacing getLineSpacing() { + return lineSpacing; + } + + public void setLineSpacing(LineSpacing lineSpacing) { + this.lineSpacing = lineSpacing; + } + + public Paragraph wrapMode(WrapMode wrapMode) { + this.wrapMode = wrapMode; + return this; + } + + /** + * Get wrapMode + * @return wrapMode + **/ + @ApiModelProperty(value = "") + public WrapMode getWrapMode() { + return wrapMode; + } + + public void setWrapMode(WrapMode wrapMode) { + this.wrapMode = wrapMode; + } + + public Paragraph horizontalAlignment(TextHorizontalAlignment horizontalAlignment) { + this.horizontalAlignment = horizontalAlignment; + return this; + } + + /** + * Get horizontalAlignment + * @return horizontalAlignment + **/ + @ApiModelProperty(value = "") + public TextHorizontalAlignment getHorizontalAlignment() { + return horizontalAlignment; + } + + public void setHorizontalAlignment(TextHorizontalAlignment horizontalAlignment) { + this.horizontalAlignment = horizontalAlignment; + } + + public Paragraph leftMargin(Double leftMargin) { + this.leftMargin = leftMargin; + return this; + } + + /** + * Get leftMargin + * @return leftMargin + **/ + @ApiModelProperty(value = "") + public Double getLeftMargin() { + return leftMargin; + } + + public void setLeftMargin(Double leftMargin) { + this.leftMargin = leftMargin; + } + + public Paragraph rightMargin(Double rightMargin) { + this.rightMargin = rightMargin; + return this; + } + + /** + * Get rightMargin + * @return rightMargin + **/ + @ApiModelProperty(value = "") + public Double getRightMargin() { + return rightMargin; + } + + public void setRightMargin(Double rightMargin) { + this.rightMargin = rightMargin; + } + + public Paragraph topMargin(Double topMargin) { + this.topMargin = topMargin; + return this; + } + + /** + * Get topMargin + * @return topMargin + **/ + @ApiModelProperty(value = "") + public Double getTopMargin() { + return topMargin; + } + + public void setTopMargin(Double topMargin) { + this.topMargin = topMargin; + } + + public Paragraph bottomMargin(Double bottomMargin) { + this.bottomMargin = bottomMargin; + return this; + } + + /** + * Get bottomMargin + * @return bottomMargin + **/ + @ApiModelProperty(value = "") + public Double getBottomMargin() { + return bottomMargin; + } + + public void setBottomMargin(Double bottomMargin) { + this.bottomMargin = bottomMargin; + } + + public Paragraph rectangle(Rectangle rectangle) { + this.rectangle = rectangle; + return this; + } + + /** + * Get rectangle + * @return rectangle + **/ + @ApiModelProperty(value = "") + public Rectangle getRectangle() { + return rectangle; + } + + public void setRectangle(Rectangle rectangle) { + this.rectangle = rectangle; + } + + public Paragraph rotation(Double rotation) { + this.rotation = rotation; + return this; + } + + /** + * Get rotation + * @return rotation + **/ + @ApiModelProperty(value = "") + public Double getRotation() { + return rotation; + } + + public void setRotation(Double rotation) { + this.rotation = rotation; + } + + public Paragraph subsequentLinesIndent(Double subsequentLinesIndent) { + this.subsequentLinesIndent = subsequentLinesIndent; + return this; + } + + /** + * Get subsequentLinesIndent + * @return subsequentLinesIndent + **/ + @ApiModelProperty(value = "") + public Double getSubsequentLinesIndent() { + return subsequentLinesIndent; + } + + public void setSubsequentLinesIndent(Double subsequentLinesIndent) { + this.subsequentLinesIndent = subsequentLinesIndent; + } + + public Paragraph verticalAlignment(VerticalAlignment verticalAlignment) { + this.verticalAlignment = verticalAlignment; + return this; + } + + /** + * Get verticalAlignment + * @return verticalAlignment + **/ + @ApiModelProperty(value = "") + public VerticalAlignment getVerticalAlignment() { + return verticalAlignment; + } + + public void setVerticalAlignment(VerticalAlignment verticalAlignment) { + this.verticalAlignment = verticalAlignment; + } + + public Paragraph lines(List lines) { + this.lines = lines; + return this; + } + + public Paragraph addLinesItem(TextLine linesItem) { + this.lines.add(linesItem); + return this; + } + + /** + * Get lines + * @return lines + **/ + @ApiModelProperty(required = true, value = "") + public List getLines() { + return lines; + } + + public void setLines(List lines) { + this.lines = lines; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Paragraph paragraph = (Paragraph) o; + return Objects.equals(this.lineSpacing, paragraph.lineSpacing) && + Objects.equals(this.wrapMode, paragraph.wrapMode) && + Objects.equals(this.horizontalAlignment, paragraph.horizontalAlignment) && + Objects.equals(this.leftMargin, paragraph.leftMargin) && + Objects.equals(this.rightMargin, paragraph.rightMargin) && + Objects.equals(this.topMargin, paragraph.topMargin) && + Objects.equals(this.bottomMargin, paragraph.bottomMargin) && + Objects.equals(this.rectangle, paragraph.rectangle) && + Objects.equals(this.rotation, paragraph.rotation) && + Objects.equals(this.subsequentLinesIndent, paragraph.subsequentLinesIndent) && + Objects.equals(this.verticalAlignment, paragraph.verticalAlignment) && + Objects.equals(this.lines, paragraph.lines); + } + + @Override + public int hashCode() { + return Objects.hash(lineSpacing, wrapMode, horizontalAlignment, leftMargin, rightMargin, topMargin, bottomMargin, rectangle, rotation, subsequentLinesIndent, verticalAlignment, lines); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Paragraph {\n"); + + sb.append(" lineSpacing: ").append(toIndentedString(lineSpacing)).append("\n"); + sb.append(" wrapMode: ").append(toIndentedString(wrapMode)).append("\n"); + sb.append(" horizontalAlignment: ").append(toIndentedString(horizontalAlignment)).append("\n"); + sb.append(" leftMargin: ").append(toIndentedString(leftMargin)).append("\n"); + sb.append(" rightMargin: ").append(toIndentedString(rightMargin)).append("\n"); + sb.append(" topMargin: ").append(toIndentedString(topMargin)).append("\n"); + sb.append(" bottomMargin: ").append(toIndentedString(bottomMargin)).append("\n"); + sb.append(" rectangle: ").append(toIndentedString(rectangle)).append("\n"); + sb.append(" rotation: ").append(toIndentedString(rotation)).append("\n"); + sb.append(" subsequentLinesIndent: ").append(toIndentedString(subsequentLinesIndent)).append("\n"); + sb.append(" verticalAlignment: ").append(toIndentedString(verticalAlignment)).append("\n"); + sb.append(" lines: ").append(toIndentedString(lines)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/aspose/asposecloudpdf/model/PartsEmbeddingModes.java b/src/main/java/com/aspose/asposecloudpdf/model/PartsEmbeddingModes.java new file mode 100644 index 0000000..38f262d --- /dev/null +++ b/src/main/java/com/aspose/asposecloudpdf/model/PartsEmbeddingModes.java @@ -0,0 +1,84 @@ +/** + * + * Copyright (c) 2018 Aspose.Pdf for Cloud + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + */ + + +package com.aspose.asposecloudpdf.model; + +import java.util.Objects; +import io.swagger.annotations.ApiModel; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * This enum enumerates possible modes of embedding of files referenced in HTML It allows to control whether referenced files (HTML, Fonts,Images, CSSes) will be embedded into main HTML file or will be generated as apart binary entities + */ +@JsonAdapter(PartsEmbeddingModes.Adapter.class) +public enum PartsEmbeddingModes { + + EMBEDALLINTOHTML("EmbedAllIntoHtml"), + + EMBEDCSSONLY("EmbedCssOnly"), + + NOEMBEDDING("NoEmbedding"); + + private String value; + + PartsEmbeddingModes(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static PartsEmbeddingModes fromValue(String text) { + for (PartsEmbeddingModes b : PartsEmbeddingModes.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final PartsEmbeddingModes enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public PartsEmbeddingModes read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return PartsEmbeddingModes.fromValue(String.valueOf(value)); + } + } +} + diff --git a/src/main/java/com/aspose/asposecloudpdf/model/PdfAType.java b/src/main/java/com/aspose/asposecloudpdf/model/PdfAType.java new file mode 100644 index 0000000..1514df6 --- /dev/null +++ b/src/main/java/com/aspose/asposecloudpdf/model/PdfAType.java @@ -0,0 +1,82 @@ +/** + * + * Copyright (c) 2018 Aspose.Pdf for Cloud + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + */ + + +package com.aspose.asposecloudpdf.model; + +import java.util.Objects; +import io.swagger.annotations.ApiModel; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Allows to specify PdfA file format. + */ +@JsonAdapter(PdfAType.Adapter.class) +public enum PdfAType { + + PDFA1A("PDFA1A"), + + PDFA1B("PDFA1B"); + + private String value; + + PdfAType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static PdfAType fromValue(String text) { + for (PdfAType b : PdfAType.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final PdfAType enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public PdfAType read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return PdfAType.fromValue(String.valueOf(value)); + } + } +} + diff --git a/src/main/java/com/aspose/asposecloudpdf/model/RasterImagesSavingModes.java b/src/main/java/com/aspose/asposecloudpdf/model/RasterImagesSavingModes.java new file mode 100644 index 0000000..078800d --- /dev/null +++ b/src/main/java/com/aspose/asposecloudpdf/model/RasterImagesSavingModes.java @@ -0,0 +1,84 @@ +/** + * + * Copyright (c) 2018 Aspose.Pdf for Cloud + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + */ + + +package com.aspose.asposecloudpdf.model; + +import java.util.Objects; +import io.swagger.annotations.ApiModel; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Converted PDF can contain raster images(.png, *.jpeg etc.) This enum defines methods of how raster images can be handled during conversion of PDF to HTML + */ +@JsonAdapter(RasterImagesSavingModes.Adapter.class) +public enum RasterImagesSavingModes { + + ASPNGIMAGESEMBEDDEDINTOSVG("AsPngImagesEmbeddedIntoSvg"), + + ASEXTERNALPNGFILESREFERENCEDVIASVG("AsExternalPngFilesReferencedViaSvg"), + + ASEMBEDDEDPARTSOFPNGPAGEBACKGROUND("AsEmbeddedPartsOfPngPageBackground"); + + private String value; + + RasterImagesSavingModes(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static RasterImagesSavingModes fromValue(String text) { + for (RasterImagesSavingModes b : RasterImagesSavingModes.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final RasterImagesSavingModes enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public RasterImagesSavingModes read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return RasterImagesSavingModes.fromValue(String.valueOf(value)); + } + } +} + diff --git a/src/main/java/com/aspose/asposecloudpdf/model/Rectangle.java b/src/main/java/com/aspose/asposecloudpdf/model/Rectangle.java new file mode 100644 index 0000000..7856f67 --- /dev/null +++ b/src/main/java/com/aspose/asposecloudpdf/model/Rectangle.java @@ -0,0 +1,172 @@ +/** + * + * Copyright (c) 2018 Aspose.Pdf for Cloud + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + */ + + +package com.aspose.asposecloudpdf.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +/** + * Represents rectangle DTO. + */ +@ApiModel(description = "Represents rectangle DTO.") + +public class Rectangle { + @SerializedName("X") + private Integer X = null; + + @SerializedName("Y") + private Integer Y = null; + + @SerializedName("Width") + private Integer width = null; + + @SerializedName("Height") + private Integer height = null; + + public Rectangle X(Integer X) { + this.X = X; + return this; + } + + /** + * Get X + * @return X + **/ + @ApiModelProperty(required = true, value = "") + public Integer getX() { + return X; + } + + public void setX(Integer X) { + this.X = X; + } + + public Rectangle Y(Integer Y) { + this.Y = Y; + return this; + } + + /** + * Get Y + * @return Y + **/ + @ApiModelProperty(required = true, value = "") + public Integer getY() { + return Y; + } + + public void setY(Integer Y) { + this.Y = Y; + } + + public Rectangle width(Integer width) { + this.width = width; + return this; + } + + /** + * Get width + * @return width + **/ + @ApiModelProperty(required = true, value = "") + public Integer getWidth() { + return width; + } + + public void setWidth(Integer width) { + this.width = width; + } + + public Rectangle height(Integer height) { + this.height = height; + return this; + } + + /** + * Get height + * @return height + **/ + @ApiModelProperty(required = true, value = "") + public Integer getHeight() { + return height; + } + + public void setHeight(Integer height) { + this.height = height; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Rectangle rectangle = (Rectangle) o; + return Objects.equals(this.X, rectangle.X) && + Objects.equals(this.Y, rectangle.Y) && + Objects.equals(this.width, rectangle.width) && + Objects.equals(this.height, rectangle.height); + } + + @Override + public int hashCode() { + return Objects.hash(X, Y, width, height); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Rectangle {\n"); + + sb.append(" X: ").append(toIndentedString(X)).append("\n"); + sb.append(" Y: ").append(toIndentedString(Y)).append("\n"); + sb.append(" width: ").append(toIndentedString(width)).append("\n"); + sb.append(" height: ").append(toIndentedString(height)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/aspose/asposecloudpdf/model/Rotation.java b/src/main/java/com/aspose/asposecloudpdf/model/Rotation.java new file mode 100644 index 0000000..3412258 --- /dev/null +++ b/src/main/java/com/aspose/asposecloudpdf/model/Rotation.java @@ -0,0 +1,83 @@ +/** + * + * Copyright (c) 2018 Aspose.Pdf for Cloud + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + */ + + +package com.aspose.asposecloudpdf.model; + +import java.util.Objects; +import io.swagger.annotations.ApiModel; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Enumeration of possible rotation values. + */ +@JsonAdapter(Rotation.Adapter.class) +public enum Rotation { + + NONE(0), + ON_90(1), + ON_180(2), + ON_270(3); + + private Integer value; + + Rotation(Integer value) { + this.value = value; + } + + public Integer getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static Rotation fromValue(String text) { + for (Rotation b : Rotation.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final Rotation enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public Rotation read(final JsonReader jsonReader) throws IOException { + Integer value = jsonReader.nextInt(); + return Rotation.fromValue(String.valueOf(value)); + } + } +} + diff --git a/src/main/java/com/aspose/asposecloudpdf/model/SaaSposeResponse.java b/src/main/java/com/aspose/asposecloudpdf/model/SaaSposeResponse.java new file mode 100644 index 0000000..de72fbb --- /dev/null +++ b/src/main/java/com/aspose/asposecloudpdf/model/SaaSposeResponse.java @@ -0,0 +1,128 @@ +/** + * + * Copyright (c) 2018 Aspose.Pdf for Cloud + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + */ + + +package com.aspose.asposecloudpdf.model; + +import java.util.Objects; +import com.aspose.asposecloudpdf.model.HttpStatusCode; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +/** + * Base class for all responses. + */ +@ApiModel(description = "Base class for all responses.") + + +public class SaaSposeResponse { + @SerializedName("Code") + private HttpStatusCode code = null; + + @SerializedName("Status") + private String status = null; + + public SaaSposeResponse code(HttpStatusCode code) { + this.code = code; + return this; + } + + /** + * Response status code. + * @return code + **/ + @ApiModelProperty(required = true, value = "Response status code.") + public HttpStatusCode getCode() { + return code; + } + + public void setCode(HttpStatusCode code) { + this.code = code; + } + + public SaaSposeResponse status(String status) { + this.status = status; + return this; + } + + /** + * Response status. + * @return status + **/ + @ApiModelProperty(value = "Response status.") + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SaaSposeResponse saaSposeResponse = (SaaSposeResponse) o; + return Objects.equals(this.code, saaSposeResponse.code) && + Objects.equals(this.status, saaSposeResponse.status); + } + + @Override + public int hashCode() { + return Objects.hash(code, status); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SaaSposeResponse {\n"); + + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/aspose/asposecloudpdf/model/Segment.java b/src/main/java/com/aspose/asposecloudpdf/model/Segment.java new file mode 100644 index 0000000..7258f00 --- /dev/null +++ b/src/main/java/com/aspose/asposecloudpdf/model/Segment.java @@ -0,0 +1,126 @@ +/** + * + * Copyright (c) 2018 Aspose.Pdf for Cloud + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + */ + + +package com.aspose.asposecloudpdf.model; + +import java.util.Objects; +import com.aspose.asposecloudpdf.model.TextState; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +/** + * Segment + */ + +public class Segment { + @SerializedName("Value") + private String value = null; + + @SerializedName("TextState") + private TextState textState = null; + + public Segment value(String value) { + this.value = value; + return this; + } + + /** + * Get value + * @return value + **/ + @ApiModelProperty(value = "") + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + + public Segment textState(TextState textState) { + this.textState = textState; + return this; + } + + /** + * Get textState + * @return textState + **/ + @ApiModelProperty(value = "") + public TextState getTextState() { + return textState; + } + + public void setTextState(TextState textState) { + this.textState = textState; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Segment segment = (Segment) o; + return Objects.equals(this.value, segment.value) && + Objects.equals(this.textState, segment.textState); + } + + @Override + public int hashCode() { + return Objects.hash(value, textState); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Segment {\n"); + + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append(" textState: ").append(toIndentedString(textState)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/aspose/asposecloudpdf/model/ShapeType.java b/src/main/java/com/aspose/asposecloudpdf/model/ShapeType.java new file mode 100644 index 0000000..89c18aa --- /dev/null +++ b/src/main/java/com/aspose/asposecloudpdf/model/ShapeType.java @@ -0,0 +1,84 @@ +/** + * + * Copyright (c) 2018 Aspose.Pdf for Cloud + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + */ + + +package com.aspose.asposecloudpdf.model; + +import java.util.Objects; +import io.swagger.annotations.ApiModel; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * This enum represents shape type for the extracted images. + */ +@JsonAdapter(ShapeType.Adapter.class) +public enum ShapeType { + + NONE("None"), + + LANDSCAPE("Landscape"), + + PORTRAIT("Portrait"); + + private String value; + + ShapeType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static ShapeType fromValue(String text) { + for (ShapeType b : ShapeType.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final ShapeType enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public ShapeType read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return ShapeType.fromValue(String.valueOf(value)); + } + } +} + diff --git a/src/main/java/com/aspose/asposecloudpdf/model/Signature.java b/src/main/java/com/aspose/asposecloudpdf/model/Signature.java new file mode 100644 index 0000000..c655cfb --- /dev/null +++ b/src/main/java/com/aspose/asposecloudpdf/model/Signature.java @@ -0,0 +1,380 @@ +/** + * + * Copyright (c) 2018 Aspose.Pdf for Cloud + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + */ + + +package com.aspose.asposecloudpdf.model; + +import java.util.Objects; +import com.aspose.asposecloudpdf.model.Rectangle; +import com.aspose.asposecloudpdf.model.SignatureType; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +/** + * Signature + */ + +public class Signature { + @SerializedName("SignaturePath") + private String signaturePath = null; + + @SerializedName("SignatureType") + private SignatureType signatureType = null; + + @SerializedName("Password") + private String password = null; + + @SerializedName("Appearance") + private String appearance = null; + + @SerializedName("Reason") + private String reason = null; + + @SerializedName("Contact") + private String contact = null; + + @SerializedName("Location") + private String location = null; + + @SerializedName("Visible") + private Boolean visible = null; + + @SerializedName("Rectangle") + private Rectangle rectangle = null; + + @SerializedName("FormFieldName") + private String formFieldName = null; + + @SerializedName("Authority") + private String authority = null; + + @SerializedName("Date") + private String date = null; + + @SerializedName("ShowProperties") + private Boolean showProperties = null; + + public Signature signaturePath(String signaturePath) { + this.signaturePath = signaturePath; + return this; + } + + /** + * Gets or sets the signature path. + * @return signaturePath + **/ + @ApiModelProperty(value = "Gets or sets the signature path.") + public String getSignaturePath() { + return signaturePath; + } + + public void setSignaturePath(String signaturePath) { + this.signaturePath = signaturePath; + } + + public Signature signatureType(SignatureType signatureType) { + this.signatureType = signatureType; + return this; + } + + /** + * Gets or sets the type of the signature. + * @return signatureType + **/ + @ApiModelProperty(required = true, value = "Gets or sets the type of the signature.") + public SignatureType getSignatureType() { + return signatureType; + } + + public void setSignatureType(SignatureType signatureType) { + this.signatureType = signatureType; + } + + public Signature password(String password) { + this.password = password; + return this; + } + + /** + * Gets or sets the signature password. + * @return password + **/ + @ApiModelProperty(value = "Gets or sets the signature password.") + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + public Signature appearance(String appearance) { + this.appearance = appearance; + return this; + } + + /** + * Sets or gets a graphic appearance for the signature. Property value represents an image file name. + * @return appearance + **/ + @ApiModelProperty(value = "Sets or gets a graphic appearance for the signature. Property value represents an image file name.") + public String getAppearance() { + return appearance; + } + + public void setAppearance(String appearance) { + this.appearance = appearance; + } + + public Signature reason(String reason) { + this.reason = reason; + return this; + } + + /** + * Gets or sets the reason of the signature. + * @return reason + **/ + @ApiModelProperty(value = "Gets or sets the reason of the signature.") + public String getReason() { + return reason; + } + + public void setReason(String reason) { + this.reason = reason; + } + + public Signature contact(String contact) { + this.contact = contact; + return this; + } + + /** + * Gets or sets the contact of the signature. + * @return contact + **/ + @ApiModelProperty(value = "Gets or sets the contact of the signature.") + public String getContact() { + return contact; + } + + public void setContact(String contact) { + this.contact = contact; + } + + public Signature location(String location) { + this.location = location; + return this; + } + + /** + * Gets or sets the location of the signature. + * @return location + **/ + @ApiModelProperty(value = "Gets or sets the location of the signature.") + public String getLocation() { + return location; + } + + public void setLocation(String location) { + this.location = location; + } + + public Signature visible(Boolean visible) { + this.visible = visible; + return this; + } + + /** + * Gets or sets a value indicating whether this is visible. Supports only when signing particular page. + * @return visible + **/ + @ApiModelProperty(required = true, value = "Gets or sets a value indicating whether this is visible. Supports only when signing particular page.") + public Boolean isVisible() { + return visible; + } + + public void setVisible(Boolean visible) { + this.visible = visible; + } + + public Signature rectangle(Rectangle rectangle) { + this.rectangle = rectangle; + return this; + } + + /** + * Gets or sets the visible rectangle of the signature. Supports only when signing particular page. + * @return rectangle + **/ + @ApiModelProperty(value = "Gets or sets the visible rectangle of the signature. Supports only when signing particular page.") + public Rectangle getRectangle() { + return rectangle; + } + + public void setRectangle(Rectangle rectangle) { + this.rectangle = rectangle; + } + + public Signature formFieldName(String formFieldName) { + this.formFieldName = formFieldName; + return this; + } + + /** + * Gets or sets the name of the signature field. Supports only when signing document with particular form field. + * @return formFieldName + **/ + @ApiModelProperty(value = "Gets or sets the name of the signature field. Supports only when signing document with particular form field.") + public String getFormFieldName() { + return formFieldName; + } + + public void setFormFieldName(String formFieldName) { + this.formFieldName = formFieldName; + } + + public Signature authority(String authority) { + this.authority = authority; + return this; + } + + /** + * Gets or sets the name of the person or authority signing the document.. + * @return authority + **/ + @ApiModelProperty(value = "Gets or sets the name of the person or authority signing the document..") + public String getAuthority() { + return authority; + } + + public void setAuthority(String authority) { + this.authority = authority; + } + + public Signature date(String date) { + this.date = date; + return this; + } + + /** + * Gets or sets the time of signing. + * @return date + **/ + @ApiModelProperty(value = "Gets or sets the time of signing.") + public String getDate() { + return date; + } + + public void setDate(String date) { + this.date = date; + } + + public Signature showProperties(Boolean showProperties) { + this.showProperties = showProperties; + return this; + } + + /** + * Gets or sets the showproperties in signature field + * @return showProperties + **/ + @ApiModelProperty(required = true, value = "Gets or sets the showproperties in signature field") + public Boolean isShowProperties() { + return showProperties; + } + + public void setShowProperties(Boolean showProperties) { + this.showProperties = showProperties; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Signature signature = (Signature) o; + return Objects.equals(this.signaturePath, signature.signaturePath) && + Objects.equals(this.signatureType, signature.signatureType) && + Objects.equals(this.password, signature.password) && + Objects.equals(this.appearance, signature.appearance) && + Objects.equals(this.reason, signature.reason) && + Objects.equals(this.contact, signature.contact) && + Objects.equals(this.location, signature.location) && + Objects.equals(this.visible, signature.visible) && + Objects.equals(this.rectangle, signature.rectangle) && + Objects.equals(this.formFieldName, signature.formFieldName) && + Objects.equals(this.authority, signature.authority) && + Objects.equals(this.date, signature.date) && + Objects.equals(this.showProperties, signature.showProperties); + } + + @Override + public int hashCode() { + return Objects.hash(signaturePath, signatureType, password, appearance, reason, contact, location, visible, rectangle, formFieldName, authority, date, showProperties); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Signature {\n"); + + sb.append(" signaturePath: ").append(toIndentedString(signaturePath)).append("\n"); + sb.append(" signatureType: ").append(toIndentedString(signatureType)).append("\n"); + sb.append(" password: ").append(toIndentedString(password)).append("\n"); + sb.append(" appearance: ").append(toIndentedString(appearance)).append("\n"); + sb.append(" reason: ").append(toIndentedString(reason)).append("\n"); + sb.append(" contact: ").append(toIndentedString(contact)).append("\n"); + sb.append(" location: ").append(toIndentedString(location)).append("\n"); + sb.append(" visible: ").append(toIndentedString(visible)).append("\n"); + sb.append(" rectangle: ").append(toIndentedString(rectangle)).append("\n"); + sb.append(" formFieldName: ").append(toIndentedString(formFieldName)).append("\n"); + sb.append(" authority: ").append(toIndentedString(authority)).append("\n"); + sb.append(" date: ").append(toIndentedString(date)).append("\n"); + sb.append(" showProperties: ").append(toIndentedString(showProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/aspose/asposecloudpdf/model/SignatureType.java b/src/main/java/com/aspose/asposecloudpdf/model/SignatureType.java new file mode 100644 index 0000000..0e2059b --- /dev/null +++ b/src/main/java/com/aspose/asposecloudpdf/model/SignatureType.java @@ -0,0 +1,82 @@ +/** + * + * Copyright (c) 2018 Aspose.Pdf for Cloud + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + */ + + +package com.aspose.asposecloudpdf.model; + +import java.util.Objects; +import io.swagger.annotations.ApiModel; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * + */ +@JsonAdapter(SignatureType.Adapter.class) +public enum SignatureType { + + PKCS_1(0), + PKCS_7(1), + PKCS_7_DETACHED(2); + + private Integer value; + + SignatureType(Integer value) { + this.value = value; + } + + public Integer getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static SignatureType fromValue(String text) { + for (SignatureType b : SignatureType.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final SignatureType enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public SignatureType read(final JsonReader jsonReader) throws IOException { + Integer value = jsonReader.nextInt(); + return SignatureType.fromValue(String.valueOf(value)); + } + } +} + diff --git a/src/main/java/com/aspose/asposecloudpdf/model/SignatureVerifyResponse.java b/src/main/java/com/aspose/asposecloudpdf/model/SignatureVerifyResponse.java new file mode 100644 index 0000000..030ae6e --- /dev/null +++ b/src/main/java/com/aspose/asposecloudpdf/model/SignatureVerifyResponse.java @@ -0,0 +1,106 @@ +/** + * + * Copyright (c) 2018 Aspose.Pdf for Cloud + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + */ + + +package com.aspose.asposecloudpdf.model; + +import java.util.Objects; +import com.aspose.asposecloudpdf.model.HttpStatusCode; +import com.aspose.asposecloudpdf.model.SaaSposeResponse; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +/** + * Returns also a message. + */ +@ApiModel(description = "Returns also a message.") + +public class SignatureVerifyResponse extends SaaSposeResponse { + @SerializedName("Valid") + private Boolean valid = null; + + public SignatureVerifyResponse valid(Boolean valid) { + this.valid = valid; + return this; + } + + /** + * Valid sign. + * @return valid + **/ + @ApiModelProperty(value = "Valid sign.") + public Boolean isValid() { + return valid; + } + + public void setValid(Boolean valid) { + this.valid = valid; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SignatureVerifyResponse signatureVerifyResponse = (SignatureVerifyResponse) o; + return Objects.equals(this.valid, signatureVerifyResponse.valid) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(valid, super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SignatureVerifyResponse {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" valid: ").append(toIndentedString(valid)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/aspose/asposecloudpdf/model/SplitResult.java b/src/main/java/com/aspose/asposecloudpdf/model/SplitResult.java new file mode 100644 index 0000000..d573d2f --- /dev/null +++ b/src/main/java/com/aspose/asposecloudpdf/model/SplitResult.java @@ -0,0 +1,114 @@ +/** + * + * Copyright (c) 2018 Aspose.Pdf for Cloud + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + */ + + +package com.aspose.asposecloudpdf.model; + +import java.util.Objects; +import com.aspose.asposecloudpdf.model.SplitResultDocument; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +/** + * Represents split result object. + */ +@ApiModel(description = "Represents split result object.") + +public class SplitResult { + @SerializedName("Documents") + private List documents = null; + + public SplitResult documents(List documents) { + this.documents = documents; + return this; + } + + public SplitResult addDocumentsItem(SplitResultDocument documentsItem) { + if (this.documents == null) { + this.documents = new ArrayList(); + } + this.documents.add(documentsItem); + return this; + } + + /** + * Gets or sets the list of documents. + * @return documents + **/ + @ApiModelProperty(value = "Gets or sets the list of documents.") + public List getDocuments() { + return documents; + } + + public void setDocuments(List documents) { + this.documents = documents; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SplitResult splitResult = (SplitResult) o; + return Objects.equals(this.documents, splitResult.documents); + } + + @Override + public int hashCode() { + return Objects.hash(documents); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SplitResult {\n"); + + sb.append(" documents: ").append(toIndentedString(documents)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/aspose/asposecloudpdf/model/SplitResultDocument.java b/src/main/java/com/aspose/asposecloudpdf/model/SplitResultDocument.java new file mode 100644 index 0000000..f2028bd --- /dev/null +++ b/src/main/java/com/aspose/asposecloudpdf/model/SplitResultDocument.java @@ -0,0 +1,105 @@ +/** + * + * Copyright (c) 2018 Aspose.Pdf for Cloud + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + */ + + +package com.aspose.asposecloudpdf.model; + +import java.util.Objects; +import com.aspose.asposecloudpdf.model.Link; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +/** + * Represents split result document, + */ +@ApiModel(description = "Represents split result document,") + +public class SplitResultDocument extends Link { + @SerializedName("Id") + private Integer id = null; + + public SplitResultDocument id(Integer id) { + this.id = id; + return this; + } + + /** + * Gets or sets the page number. + * @return id + **/ + @ApiModelProperty(value = "Gets or sets the page number.") + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SplitResultDocument splitResultDocument = (SplitResultDocument) o; + return Objects.equals(this.id, splitResultDocument.id) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(id, super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SplitResultDocument {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/aspose/asposecloudpdf/model/SplitResultResponse.java b/src/main/java/com/aspose/asposecloudpdf/model/SplitResultResponse.java new file mode 100644 index 0000000..44a8893 --- /dev/null +++ b/src/main/java/com/aspose/asposecloudpdf/model/SplitResultResponse.java @@ -0,0 +1,107 @@ +/** + * + * Copyright (c) 2018 Aspose.Pdf for Cloud + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + */ + + +package com.aspose.asposecloudpdf.model; + +import java.util.Objects; +import com.aspose.asposecloudpdf.model.HttpStatusCode; +import com.aspose.asposecloudpdf.model.SaaSposeResponse; +import com.aspose.asposecloudpdf.model.SplitResult; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +/** + * Represents split result object. + */ +@ApiModel(description = "Represents split result object.") + +public class SplitResultResponse extends SaaSposeResponse { + @SerializedName("Result") + private SplitResult result = null; + + public SplitResultResponse result(SplitResult result) { + this.result = result; + return this; + } + + /** + * Gets or sets the splitting result. + * @return result + **/ + @ApiModelProperty(value = "Gets or sets the splitting result.") + public SplitResult getResult() { + return result; + } + + public void setResult(SplitResult result) { + this.result = result; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SplitResultResponse splitResultResponse = (SplitResultResponse) o; + return Objects.equals(this.result, splitResultResponse.result) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(result, super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SplitResultResponse {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" result: ").append(toIndentedString(result)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/aspose/asposecloudpdf/model/Stamp.java b/src/main/java/com/aspose/asposecloudpdf/model/Stamp.java new file mode 100644 index 0000000..afe95e6 --- /dev/null +++ b/src/main/java/com/aspose/asposecloudpdf/model/Stamp.java @@ -0,0 +1,591 @@ +/** + * + * Copyright (c) 2018 Aspose.Pdf for Cloud + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + */ + + +package com.aspose.asposecloudpdf.model; + +import java.util.Objects; +import com.aspose.asposecloudpdf.model.HorizontalAlignment; +import com.aspose.asposecloudpdf.model.Rotation; +import com.aspose.asposecloudpdf.model.StampType; +import com.aspose.asposecloudpdf.model.TextState; +import com.aspose.asposecloudpdf.model.VerticalAlignment; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +/** + * Represents Pdf stamps. + */ +@ApiModel(description = "Represents Pdf stamps.") + +public class Stamp { + @SerializedName("Type") + private StampType type = null; + + @SerializedName("Background") + private Boolean background = null; + + @SerializedName("BottomMargin") + private Double bottomMargin = null; + + @SerializedName("HorizontalAlignment") + private HorizontalAlignment horizontalAlignment = null; + + @SerializedName("LeftMargin") + private Double leftMargin = null; + + @SerializedName("Opacity") + private Double opacity = null; + + @SerializedName("RightMargin") + private Double rightMargin = null; + + @SerializedName("Rotate") + private Rotation rotate = null; + + @SerializedName("RotateAngle") + private Double rotateAngle = null; + + @SerializedName("TopMargin") + private Double topMargin = null; + + @SerializedName("VerticalAlignment") + private VerticalAlignment verticalAlignment = null; + + @SerializedName("XIndent") + private Double xindent = null; + + @SerializedName("YIndent") + private Double yindent = null; + + @SerializedName("Zoom") + private Double zoom = null; + + @SerializedName("TextAlignment") + private HorizontalAlignment textAlignment = null; + + @SerializedName("Value") + private String value = null; + + @SerializedName("TextState") + private TextState textState = null; + + @SerializedName("FileName") + private String fileName = null; + + @SerializedName("Width") + private Double width = null; + + @SerializedName("Height") + private Double height = null; + + @SerializedName("PageIndex") + private Integer pageIndex = null; + + @SerializedName("StartingNumber") + private Integer startingNumber = null; + + public Stamp type(StampType type) { + this.type = type; + return this; + } + + /** + * Gets the stamp type. + * @return type + **/ + @ApiModelProperty(required = true, value = "Gets the stamp type.") + public StampType getType() { + return type; + } + + public void setType(StampType type) { + this.type = type; + } + + public Stamp background(Boolean background) { + this.background = background; + return this; + } + + /** + * Sets or gets a bool value that indicates the content is stamped as background. If the value is true, the stamp content is layed at the bottom. By defalt, the value is false, the stamp content is layed at the top. + * @return background + **/ + @ApiModelProperty(value = "Sets or gets a bool value that indicates the content is stamped as background. If the value is true, the stamp content is layed at the bottom. By defalt, the value is false, the stamp content is layed at the top.") + public Boolean isBackground() { + return background; + } + + public void setBackground(Boolean background) { + this.background = background; + } + + public Stamp bottomMargin(Double bottomMargin) { + this.bottomMargin = bottomMargin; + return this; + } + + /** + * Gets or sets bottom margin of stamp. + * @return bottomMargin + **/ + @ApiModelProperty(value = "Gets or sets bottom margin of stamp.") + public Double getBottomMargin() { + return bottomMargin; + } + + public void setBottomMargin(Double bottomMargin) { + this.bottomMargin = bottomMargin; + } + + public Stamp horizontalAlignment(HorizontalAlignment horizontalAlignment) { + this.horizontalAlignment = horizontalAlignment; + return this; + } + + /** + * Gets or sets Horizontal alignment of stamp on the page. + * @return horizontalAlignment + **/ + @ApiModelProperty(value = "Gets or sets Horizontal alignment of stamp on the page. ") + public HorizontalAlignment getHorizontalAlignment() { + return horizontalAlignment; + } + + public void setHorizontalAlignment(HorizontalAlignment horizontalAlignment) { + this.horizontalAlignment = horizontalAlignment; + } + + public Stamp leftMargin(Double leftMargin) { + this.leftMargin = leftMargin; + return this; + } + + /** + * Gets or sets left margin of stamp. + * @return leftMargin + **/ + @ApiModelProperty(value = "Gets or sets left margin of stamp.") + public Double getLeftMargin() { + return leftMargin; + } + + public void setLeftMargin(Double leftMargin) { + this.leftMargin = leftMargin; + } + + public Stamp opacity(Double opacity) { + this.opacity = opacity; + return this; + } + + /** + * Gets or sets a value to indicate the stamp opacity. The value is from 0.0 to 1.0. By default the value is 1.0. + * @return opacity + **/ + @ApiModelProperty(value = "Gets or sets a value to indicate the stamp opacity. The value is from 0.0 to 1.0. By default the value is 1.0.") + public Double getOpacity() { + return opacity; + } + + public void setOpacity(Double opacity) { + this.opacity = opacity; + } + + public Stamp rightMargin(Double rightMargin) { + this.rightMargin = rightMargin; + return this; + } + + /** + * Gets or sets right margin of stamp. + * @return rightMargin + **/ + @ApiModelProperty(value = "Gets or sets right margin of stamp.") + public Double getRightMargin() { + return rightMargin; + } + + public void setRightMargin(Double rightMargin) { + this.rightMargin = rightMargin; + } + + public Stamp rotate(Rotation rotate) { + this.rotate = rotate; + return this; + } + + /** + * Sets or gets the rotation of stamp content according values. Note. This property is for set angles which are multiples of 90 degrees (0, 90, 180, 270 degrees). To set arbitrary angle use RotateAngle property. If angle set by ArbitraryAngle is not multiple of 90 then Rotate property returns Rotation.None. + * @return rotate + **/ + @ApiModelProperty(value = "Sets or gets the rotation of stamp content according values. Note. This property is for set angles which are multiples of 90 degrees (0, 90, 180, 270 degrees). To set arbitrary angle use RotateAngle property. If angle set by ArbitraryAngle is not multiple of 90 then Rotate property returns Rotation.None.") + public Rotation getRotate() { + return rotate; + } + + public void setRotate(Rotation rotate) { + this.rotate = rotate; + } + + public Stamp rotateAngle(Double rotateAngle) { + this.rotateAngle = rotateAngle; + return this; + } + + /** + * Gets or sets rotate angle of stamp in degrees. This property allows to set arbitrary rotate angle. + * @return rotateAngle + **/ + @ApiModelProperty(value = "Gets or sets rotate angle of stamp in degrees. This property allows to set arbitrary rotate angle. ") + public Double getRotateAngle() { + return rotateAngle; + } + + public void setRotateAngle(Double rotateAngle) { + this.rotateAngle = rotateAngle; + } + + public Stamp topMargin(Double topMargin) { + this.topMargin = topMargin; + return this; + } + + /** + * Gets or sets top margin of stamp. + * @return topMargin + **/ + @ApiModelProperty(value = "Gets or sets top margin of stamp.") + public Double getTopMargin() { + return topMargin; + } + + public void setTopMargin(Double topMargin) { + this.topMargin = topMargin; + } + + public Stamp verticalAlignment(VerticalAlignment verticalAlignment) { + this.verticalAlignment = verticalAlignment; + return this; + } + + /** + * Gets or sets vertical alignment of stamp on page. + * @return verticalAlignment + **/ + @ApiModelProperty(value = "Gets or sets vertical alignment of stamp on page.") + public VerticalAlignment getVerticalAlignment() { + return verticalAlignment; + } + + public void setVerticalAlignment(VerticalAlignment verticalAlignment) { + this.verticalAlignment = verticalAlignment; + } + + public Stamp xindent(Double xindent) { + this.xindent = xindent; + return this; + } + + /** + * Horizontal stamp coordinate, starting from the left. + * @return xindent + **/ + @ApiModelProperty(value = "Horizontal stamp coordinate, starting from the left.") + public Double getXindent() { + return xindent; + } + + public void setXindent(Double xindent) { + this.xindent = xindent; + } + + public Stamp yindent(Double yindent) { + this.yindent = yindent; + return this; + } + + /** + * Vertical stamp coordinate, starting from the bottom. + * @return yindent + **/ + @ApiModelProperty(value = "Vertical stamp coordinate, starting from the bottom.") + public Double getYindent() { + return yindent; + } + + public void setYindent(Double yindent) { + this.yindent = yindent; + } + + public Stamp zoom(Double zoom) { + this.zoom = zoom; + return this; + } + + /** + * Zooming factor of the stamp. Allows to scale stamp. + * @return zoom + **/ + @ApiModelProperty(value = "Zooming factor of the stamp. Allows to scale stamp.") + public Double getZoom() { + return zoom; + } + + public void setZoom(Double zoom) { + this.zoom = zoom; + } + + public Stamp textAlignment(HorizontalAlignment textAlignment) { + this.textAlignment = textAlignment; + return this; + } + + /** + * Alignment of the text inside the stamp. + * @return textAlignment + **/ + @ApiModelProperty(value = "Alignment of the text inside the stamp.") + public HorizontalAlignment getTextAlignment() { + return textAlignment; + } + + public void setTextAlignment(HorizontalAlignment textAlignment) { + this.textAlignment = textAlignment; + } + + public Stamp value(String value) { + this.value = value; + return this; + } + + /** + * Gets or sets string value which is used as stamp on the page. + * @return value + **/ + @ApiModelProperty(value = "Gets or sets string value which is used as stamp on the page.") + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + + public Stamp textState(TextState textState) { + this.textState = textState; + return this; + } + + /** + * Gets text properties of the stamp. See for details. + * @return textState + **/ + @ApiModelProperty(value = "Gets text properties of the stamp. See for details.") + public TextState getTextState() { + return textState; + } + + public void setTextState(TextState textState) { + this.textState = textState; + } + + public Stamp fileName(String fileName) { + this.fileName = fileName; + return this; + } + + /** + * Gets or sets the file name. + * @return fileName + **/ + @ApiModelProperty(value = "Gets or sets the file name.") + public String getFileName() { + return fileName; + } + + public void setFileName(String fileName) { + this.fileName = fileName; + } + + public Stamp width(Double width) { + this.width = width; + return this; + } + + /** + * Gets or sets image width. Setting this property allos to scal image horizontally. + * @return width + **/ + @ApiModelProperty(value = "Gets or sets image width. Setting this property allos to scal image horizontally.") + public Double getWidth() { + return width; + } + + public void setWidth(Double width) { + this.width = width; + } + + public Stamp height(Double height) { + this.height = height; + return this; + } + + /** + * Gets or sets image height. Setting this image allows to scale image vertically. + * @return height + **/ + @ApiModelProperty(value = "Gets or sets image height. Setting this image allows to scale image vertically.") + public Double getHeight() { + return height; + } + + public void setHeight(Double height) { + this.height = height; + } + + public Stamp pageIndex(Integer pageIndex) { + this.pageIndex = pageIndex; + return this; + } + + /** + * Gets or sets the index of the page. + * @return pageIndex + **/ + @ApiModelProperty(value = "Gets or sets the index of the page.") + public Integer getPageIndex() { + return pageIndex; + } + + public void setPageIndex(Integer pageIndex) { + this.pageIndex = pageIndex; + } + + public Stamp startingNumber(Integer startingNumber) { + this.startingNumber = startingNumber; + return this; + } + + /** + * Gets or sets value of the number of starting page. Other pages will be numbered starting from this value. + * @return startingNumber + **/ + @ApiModelProperty(value = "Gets or sets value of the number of starting page. Other pages will be numbered starting from this value.") + public Integer getStartingNumber() { + return startingNumber; + } + + public void setStartingNumber(Integer startingNumber) { + this.startingNumber = startingNumber; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Stamp stamp = (Stamp) o; + return Objects.equals(this.type, stamp.type) && + Objects.equals(this.background, stamp.background) && + Objects.equals(this.bottomMargin, stamp.bottomMargin) && + Objects.equals(this.horizontalAlignment, stamp.horizontalAlignment) && + Objects.equals(this.leftMargin, stamp.leftMargin) && + Objects.equals(this.opacity, stamp.opacity) && + Objects.equals(this.rightMargin, stamp.rightMargin) && + Objects.equals(this.rotate, stamp.rotate) && + Objects.equals(this.rotateAngle, stamp.rotateAngle) && + Objects.equals(this.topMargin, stamp.topMargin) && + Objects.equals(this.verticalAlignment, stamp.verticalAlignment) && + Objects.equals(this.xindent, stamp.xindent) && + Objects.equals(this.yindent, stamp.yindent) && + Objects.equals(this.zoom, stamp.zoom) && + Objects.equals(this.textAlignment, stamp.textAlignment) && + Objects.equals(this.value, stamp.value) && + Objects.equals(this.textState, stamp.textState) && + Objects.equals(this.fileName, stamp.fileName) && + Objects.equals(this.width, stamp.width) && + Objects.equals(this.height, stamp.height) && + Objects.equals(this.pageIndex, stamp.pageIndex) && + Objects.equals(this.startingNumber, stamp.startingNumber); + } + + @Override + public int hashCode() { + return Objects.hash(type, background, bottomMargin, horizontalAlignment, leftMargin, opacity, rightMargin, rotate, rotateAngle, topMargin, verticalAlignment, xindent, yindent, zoom, textAlignment, value, textState, fileName, width, height, pageIndex, startingNumber); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Stamp {\n"); + + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" background: ").append(toIndentedString(background)).append("\n"); + sb.append(" bottomMargin: ").append(toIndentedString(bottomMargin)).append("\n"); + sb.append(" horizontalAlignment: ").append(toIndentedString(horizontalAlignment)).append("\n"); + sb.append(" leftMargin: ").append(toIndentedString(leftMargin)).append("\n"); + sb.append(" opacity: ").append(toIndentedString(opacity)).append("\n"); + sb.append(" rightMargin: ").append(toIndentedString(rightMargin)).append("\n"); + sb.append(" rotate: ").append(toIndentedString(rotate)).append("\n"); + sb.append(" rotateAngle: ").append(toIndentedString(rotateAngle)).append("\n"); + sb.append(" topMargin: ").append(toIndentedString(topMargin)).append("\n"); + sb.append(" verticalAlignment: ").append(toIndentedString(verticalAlignment)).append("\n"); + sb.append(" xindent: ").append(toIndentedString(xindent)).append("\n"); + sb.append(" yindent: ").append(toIndentedString(yindent)).append("\n"); + sb.append(" zoom: ").append(toIndentedString(zoom)).append("\n"); + sb.append(" textAlignment: ").append(toIndentedString(textAlignment)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append(" textState: ").append(toIndentedString(textState)).append("\n"); + sb.append(" fileName: ").append(toIndentedString(fileName)).append("\n"); + sb.append(" width: ").append(toIndentedString(width)).append("\n"); + sb.append(" height: ").append(toIndentedString(height)).append("\n"); + sb.append(" pageIndex: ").append(toIndentedString(pageIndex)).append("\n"); + sb.append(" startingNumber: ").append(toIndentedString(startingNumber)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/aspose/asposecloudpdf/model/StampType.java b/src/main/java/com/aspose/asposecloudpdf/model/StampType.java new file mode 100644 index 0000000..c2ced24 --- /dev/null +++ b/src/main/java/com/aspose/asposecloudpdf/model/StampType.java @@ -0,0 +1,83 @@ +/** + * + * Copyright (c) 2018 Aspose.Pdf for Cloud + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + */ + + +package com.aspose.asposecloudpdf.model; + +import java.util.Objects; +import io.swagger.annotations.ApiModel; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Represents enumeration of the stamp types. + */ +@JsonAdapter(StampType.Adapter.class) +public enum StampType { + + TEXT(0), + IMAGE(1), + PAGE(2), + PAGE_NUMBER(3); + + private Integer value; + + StampType(Integer value) { + this.value = value; + } + + public Integer getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static StampType fromValue(String text) { + for (StampType b : StampType.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final StampType enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public StampType read(final JsonReader jsonReader) throws IOException { + Integer value = jsonReader.nextInt(); + return StampType.fromValue(String.valueOf(value)); + } + } +} + diff --git a/src/main/java/com/aspose/asposecloudpdf/model/TextFormat.java b/src/main/java/com/aspose/asposecloudpdf/model/TextFormat.java new file mode 100644 index 0000000..01629cf --- /dev/null +++ b/src/main/java/com/aspose/asposecloudpdf/model/TextFormat.java @@ -0,0 +1,154 @@ +/** + * + * Copyright (c) 2018 Aspose.Pdf for Cloud + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + */ + + +package com.aspose.asposecloudpdf.model; + +import java.util.Objects; +import com.aspose.asposecloudpdf.model.Color; +import com.aspose.asposecloudpdf.model.Link; +import com.aspose.asposecloudpdf.model.LinkElement; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.List; + +/** + * Represents text format DTO. + */ +@ApiModel(description = "Represents text format DTO.") + +public class TextFormat extends LinkElement { + @SerializedName("Color") + private Color color = null; + + @SerializedName("FontSize") + private Double fontSize = null; + + @SerializedName("FontName") + private String fontName = null; + + public TextFormat color(Color color) { + this.color = color; + return this; + } + + /** + * Get color + * @return color + **/ + @ApiModelProperty(value = "") + public Color getColor() { + return color; + } + + public void setColor(Color color) { + this.color = color; + } + + public TextFormat fontSize(Double fontSize) { + this.fontSize = fontSize; + return this; + } + + /** + * Get fontSize + * @return fontSize + **/ + @ApiModelProperty(value = "") + public Double getFontSize() { + return fontSize; + } + + public void setFontSize(Double fontSize) { + this.fontSize = fontSize; + } + + public TextFormat fontName(String fontName) { + this.fontName = fontName; + return this; + } + + /** + * Get fontName + * @return fontName + **/ + @ApiModelProperty(value = "") + public String getFontName() { + return fontName; + } + + public void setFontName(String fontName) { + this.fontName = fontName; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TextFormat textFormat = (TextFormat) o; + return Objects.equals(this.color, textFormat.color) && + Objects.equals(this.fontSize, textFormat.fontSize) && + Objects.equals(this.fontName, textFormat.fontName) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(color, fontSize, fontName, super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TextFormat {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" color: ").append(toIndentedString(color)).append("\n"); + sb.append(" fontSize: ").append(toIndentedString(fontSize)).append("\n"); + sb.append(" fontName: ").append(toIndentedString(fontName)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/aspose/asposecloudpdf/model/TextFormatResponse.java b/src/main/java/com/aspose/asposecloudpdf/model/TextFormatResponse.java new file mode 100644 index 0000000..eccc643 --- /dev/null +++ b/src/main/java/com/aspose/asposecloudpdf/model/TextFormatResponse.java @@ -0,0 +1,106 @@ +/** + * + * Copyright (c) 2018 Aspose.Pdf for Cloud + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + */ + + +package com.aspose.asposecloudpdf.model; + +import java.util.Objects; +import com.aspose.asposecloudpdf.model.HttpStatusCode; +import com.aspose.asposecloudpdf.model.SaaSposeResponse; +import com.aspose.asposecloudpdf.model.TextFormat; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +/** + * TextFormatResponse + */ + +public class TextFormatResponse extends SaaSposeResponse { + @SerializedName("TextFormat") + private TextFormat textFormat = null; + + public TextFormatResponse textFormat(TextFormat textFormat) { + this.textFormat = textFormat; + return this; + } + + /** + * Get textFormat + * @return textFormat + **/ + @ApiModelProperty(value = "") + public TextFormat getTextFormat() { + return textFormat; + } + + public void setTextFormat(TextFormat textFormat) { + this.textFormat = textFormat; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TextFormatResponse textFormatResponse = (TextFormatResponse) o; + return Objects.equals(this.textFormat, textFormatResponse.textFormat) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(textFormat, super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TextFormatResponse {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" textFormat: ").append(toIndentedString(textFormat)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/aspose/asposecloudpdf/model/TextHorizontalAlignment.java b/src/main/java/com/aspose/asposecloudpdf/model/TextHorizontalAlignment.java new file mode 100644 index 0000000..c248081 --- /dev/null +++ b/src/main/java/com/aspose/asposecloudpdf/model/TextHorizontalAlignment.java @@ -0,0 +1,90 @@ +/** + * + * Copyright (c) 2018 Aspose.Pdf for Cloud + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + */ + + +package com.aspose.asposecloudpdf.model; + +import java.util.Objects; +import io.swagger.annotations.ApiModel; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * + */ +@JsonAdapter(TextHorizontalAlignment.Adapter.class) +public enum TextHorizontalAlignment { + + LEFT("Left"), + + RIGHT("Right"), + + CENTER("Center"), + + JUSTIFY("Justify"), + + FULLJUSTIFY("FullJustify"), + + NONE("None"); + + private String value; + + TextHorizontalAlignment(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TextHorizontalAlignment fromValue(String text) { + for (TextHorizontalAlignment b : TextHorizontalAlignment.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TextHorizontalAlignment enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TextHorizontalAlignment read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TextHorizontalAlignment.fromValue(String.valueOf(value)); + } + } +} + diff --git a/src/main/java/com/aspose/asposecloudpdf/model/TextItem.java b/src/main/java/com/aspose/asposecloudpdf/model/TextItem.java new file mode 100644 index 0000000..0bca2b1 --- /dev/null +++ b/src/main/java/com/aspose/asposecloudpdf/model/TextItem.java @@ -0,0 +1,131 @@ +/** + * + * Copyright (c) 2018 Aspose.Pdf for Cloud + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + */ + + +package com.aspose.asposecloudpdf.model; + +import java.util.Objects; +import com.aspose.asposecloudpdf.model.Link; +import com.aspose.asposecloudpdf.model.LinkElement; +import com.aspose.asposecloudpdf.model.TextFormat; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.List; + +/** + * Represents text DTO. + */ +@ApiModel(description = "Represents text DTO.") + +public class TextItem extends LinkElement { + @SerializedName("Text") + private String text = null; + + @SerializedName("Format") + private TextFormat format = null; + + public TextItem text(String text) { + this.text = text; + return this; + } + + /** + * Get text + * @return text + **/ + @ApiModelProperty(value = "") + public String getText() { + return text; + } + + public void setText(String text) { + this.text = text; + } + + public TextItem format(TextFormat format) { + this.format = format; + return this; + } + + /** + * Get format + * @return format + **/ + @ApiModelProperty(value = "") + public TextFormat getFormat() { + return format; + } + + public void setFormat(TextFormat format) { + this.format = format; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TextItem textItem = (TextItem) o; + return Objects.equals(this.text, textItem.text) && + Objects.equals(this.format, textItem.format) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(text, format, super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TextItem {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" text: ").append(toIndentedString(text)).append("\n"); + sb.append(" format: ").append(toIndentedString(format)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/aspose/asposecloudpdf/model/TextItemResponse.java b/src/main/java/com/aspose/asposecloudpdf/model/TextItemResponse.java new file mode 100644 index 0000000..84d44aa --- /dev/null +++ b/src/main/java/com/aspose/asposecloudpdf/model/TextItemResponse.java @@ -0,0 +1,106 @@ +/** + * + * Copyright (c) 2018 Aspose.Pdf for Cloud + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + */ + + +package com.aspose.asposecloudpdf.model; + +import java.util.Objects; +import com.aspose.asposecloudpdf.model.HttpStatusCode; +import com.aspose.asposecloudpdf.model.SaaSposeResponse; +import com.aspose.asposecloudpdf.model.TextItem; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +/** + * TextItemResponse + */ + +public class TextItemResponse extends SaaSposeResponse { + @SerializedName("TextItem") + private TextItem textItem = null; + + public TextItemResponse textItem(TextItem textItem) { + this.textItem = textItem; + return this; + } + + /** + * Get textItem + * @return textItem + **/ + @ApiModelProperty(value = "") + public TextItem getTextItem() { + return textItem; + } + + public void setTextItem(TextItem textItem) { + this.textItem = textItem; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TextItemResponse textItemResponse = (TextItemResponse) o; + return Objects.equals(this.textItem, textItemResponse.textItem) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(textItem, super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TextItemResponse {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" textItem: ").append(toIndentedString(textItem)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/aspose/asposecloudpdf/model/TextItems.java b/src/main/java/com/aspose/asposecloudpdf/model/TextItems.java new file mode 100644 index 0000000..ee0d452 --- /dev/null +++ b/src/main/java/com/aspose/asposecloudpdf/model/TextItems.java @@ -0,0 +1,117 @@ +/** + * + * Copyright (c) 2018 Aspose.Pdf for Cloud + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + */ + + +package com.aspose.asposecloudpdf.model; + +import java.util.Objects; +import com.aspose.asposecloudpdf.model.Link; +import com.aspose.asposecloudpdf.model.LinkElement; +import com.aspose.asposecloudpdf.model.TextItem; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +/** + * Represents text items DTO. + */ +@ApiModel(description = "Represents text items DTO.") + +public class TextItems extends LinkElement { + @SerializedName("List") + private List list = null; + + public TextItems list(List list) { + this.list = list; + return this; + } + + public TextItems addListItem(TextItem listItem) { + if (this.list == null) { + this.list = new ArrayList(); + } + this.list.add(listItem); + return this; + } + + /** + * Get list + * @return list + **/ + @ApiModelProperty(value = "") + public List getList() { + return list; + } + + public void setList(List list) { + this.list = list; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TextItems textItems = (TextItems) o; + return Objects.equals(this.list, textItems.list) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(list, super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TextItems {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" list: ").append(toIndentedString(list)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/aspose/asposecloudpdf/model/TextItemsResponse.java b/src/main/java/com/aspose/asposecloudpdf/model/TextItemsResponse.java new file mode 100644 index 0000000..16baa22 --- /dev/null +++ b/src/main/java/com/aspose/asposecloudpdf/model/TextItemsResponse.java @@ -0,0 +1,106 @@ +/** + * + * Copyright (c) 2018 Aspose.Pdf for Cloud + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + */ + + +package com.aspose.asposecloudpdf.model; + +import java.util.Objects; +import com.aspose.asposecloudpdf.model.HttpStatusCode; +import com.aspose.asposecloudpdf.model.SaaSposeResponse; +import com.aspose.asposecloudpdf.model.TextItems; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +/** + * TextItemsResponse + */ + +public class TextItemsResponse extends SaaSposeResponse { + @SerializedName("TextItems") + private TextItems textItems = null; + + public TextItemsResponse textItems(TextItems textItems) { + this.textItems = textItems; + return this; + } + + /** + * Get textItems + * @return textItems + **/ + @ApiModelProperty(value = "") + public TextItems getTextItems() { + return textItems; + } + + public void setTextItems(TextItems textItems) { + this.textItems = textItems; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TextItemsResponse textItemsResponse = (TextItemsResponse) o; + return Objects.equals(this.textItems, textItemsResponse.textItems) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(textItems, super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TextItemsResponse {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" textItems: ").append(toIndentedString(textItems)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/aspose/asposecloudpdf/model/TextLine.java b/src/main/java/com/aspose/asposecloudpdf/model/TextLine.java new file mode 100644 index 0000000..82d78f6 --- /dev/null +++ b/src/main/java/com/aspose/asposecloudpdf/model/TextLine.java @@ -0,0 +1,138 @@ +/** + * + * Copyright (c) 2018 Aspose.Pdf for Cloud + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + */ + + +package com.aspose.asposecloudpdf.model; + +import java.util.Objects; +import com.aspose.asposecloudpdf.model.Segment; +import com.aspose.asposecloudpdf.model.TextHorizontalAlignment; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +/** + * A line of text to be inserted into . + */ +@ApiModel(description = "A line of text to be inserted into .") + +public class TextLine { + @SerializedName("HorizontalAlignment") + private TextHorizontalAlignment horizontalAlignment = null; + + @SerializedName("Segments") + private List segments = null; + + public TextLine horizontalAlignment(TextHorizontalAlignment horizontalAlignment) { + this.horizontalAlignment = horizontalAlignment; + return this; + } + + /** + * Line's horizontal alignment + * @return horizontalAlignment + **/ + @ApiModelProperty(value = "Line's horizontal alignment") + public TextHorizontalAlignment getHorizontalAlignment() { + return horizontalAlignment; + } + + public void setHorizontalAlignment(TextHorizontalAlignment horizontalAlignment) { + this.horizontalAlignment = horizontalAlignment; + } + + public TextLine segments(List segments) { + this.segments = segments; + return this; + } + + public TextLine addSegmentsItem(Segment segmentsItem) { + if (this.segments == null) { + this.segments = new ArrayList(); + } + this.segments.add(segmentsItem); + return this; + } + + /** + * Segments that form the line. Every segment has its own formatting. + * @return segments + **/ + @ApiModelProperty(value = "Segments that form the line. Every segment has its own formatting.") + public List getSegments() { + return segments; + } + + public void setSegments(List segments) { + this.segments = segments; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TextLine textLine = (TextLine) o; + return Objects.equals(this.horizontalAlignment, textLine.horizontalAlignment) && + Objects.equals(this.segments, textLine.segments); + } + + @Override + public int hashCode() { + return Objects.hash(horizontalAlignment, segments); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TextLine {\n"); + + sb.append(" horizontalAlignment: ").append(toIndentedString(horizontalAlignment)).append("\n"); + sb.append(" segments: ").append(toIndentedString(segments)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/aspose/asposecloudpdf/model/TextRect.java b/src/main/java/com/aspose/asposecloudpdf/model/TextRect.java new file mode 100644 index 0000000..e493cc4 --- /dev/null +++ b/src/main/java/com/aspose/asposecloudpdf/model/TextRect.java @@ -0,0 +1,150 @@ +/** + * + * Copyright (c) 2018 Aspose.Pdf for Cloud + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + */ + + +package com.aspose.asposecloudpdf.model; + +import java.util.Objects; +import com.aspose.asposecloudpdf.model.Rectangle; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +/** + * Represents text DTO. + */ +@ApiModel(description = "Represents text DTO.") + +public class TextRect { + @SerializedName("Text") + private String text = null; + + @SerializedName("Page") + private Integer page = null; + + @SerializedName("Rect") + private Rectangle rect = null; + + public TextRect text(String text) { + this.text = text; + return this; + } + + /** + * Get text + * @return text + **/ + @ApiModelProperty(value = "") + public String getText() { + return text; + } + + public void setText(String text) { + this.text = text; + } + + public TextRect page(Integer page) { + this.page = page; + return this; + } + + /** + * Get page + * @return page + **/ + @ApiModelProperty(required = true, value = "") + public Integer getPage() { + return page; + } + + public void setPage(Integer page) { + this.page = page; + } + + public TextRect rect(Rectangle rect) { + this.rect = rect; + return this; + } + + /** + * Get rect + * @return rect + **/ + @ApiModelProperty(value = "") + public Rectangle getRect() { + return rect; + } + + public void setRect(Rectangle rect) { + this.rect = rect; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TextRect textRect = (TextRect) o; + return Objects.equals(this.text, textRect.text) && + Objects.equals(this.page, textRect.page) && + Objects.equals(this.rect, textRect.rect); + } + + @Override + public int hashCode() { + return Objects.hash(text, page, rect); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TextRect {\n"); + + sb.append(" text: ").append(toIndentedString(text)).append("\n"); + sb.append(" page: ").append(toIndentedString(page)).append("\n"); + sb.append(" rect: ").append(toIndentedString(rect)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/aspose/asposecloudpdf/model/TextRects.java b/src/main/java/com/aspose/asposecloudpdf/model/TextRects.java new file mode 100644 index 0000000..b66454f --- /dev/null +++ b/src/main/java/com/aspose/asposecloudpdf/model/TextRects.java @@ -0,0 +1,114 @@ +/** + * + * Copyright (c) 2018 Aspose.Pdf for Cloud + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + */ + + +package com.aspose.asposecloudpdf.model; + +import java.util.Objects; +import com.aspose.asposecloudpdf.model.TextRect; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +/** + * Represents text items DTO. + */ +@ApiModel(description = "Represents text items DTO.") + +public class TextRects { + @SerializedName("List") + private List list = null; + + public TextRects list(List list) { + this.list = list; + return this; + } + + public TextRects addListItem(TextRect listItem) { + if (this.list == null) { + this.list = new ArrayList(); + } + this.list.add(listItem); + return this; + } + + /** + * Get list + * @return list + **/ + @ApiModelProperty(value = "") + public List getList() { + return list; + } + + public void setList(List list) { + this.list = list; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TextRects textRects = (TextRects) o; + return Objects.equals(this.list, textRects.list); + } + + @Override + public int hashCode() { + return Objects.hash(list); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TextRects {\n"); + + sb.append(" list: ").append(toIndentedString(list)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/aspose/asposecloudpdf/model/TextRectsResponse.java b/src/main/java/com/aspose/asposecloudpdf/model/TextRectsResponse.java new file mode 100644 index 0000000..35c3cbe --- /dev/null +++ b/src/main/java/com/aspose/asposecloudpdf/model/TextRectsResponse.java @@ -0,0 +1,106 @@ +/** + * + * Copyright (c) 2018 Aspose.Pdf for Cloud + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + */ + + +package com.aspose.asposecloudpdf.model; + +import java.util.Objects; +import com.aspose.asposecloudpdf.model.HttpStatusCode; +import com.aspose.asposecloudpdf.model.SaaSposeResponse; +import com.aspose.asposecloudpdf.model.TextRects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +/** + * TextRectsResponse + */ + +public class TextRectsResponse extends SaaSposeResponse { + @SerializedName("TextOccurences") + private TextRects textOccurences = null; + + public TextRectsResponse textOccurences(TextRects textOccurences) { + this.textOccurences = textOccurences; + return this; + } + + /** + * Get textOccurences + * @return textOccurences + **/ + @ApiModelProperty(value = "") + public TextRects getTextOccurences() { + return textOccurences; + } + + public void setTextOccurences(TextRects textOccurences) { + this.textOccurences = textOccurences; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TextRectsResponse textRectsResponse = (TextRectsResponse) o; + return Objects.equals(this.textOccurences, textRectsResponse.textOccurences) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(textOccurences, super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TextRectsResponse {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" textOccurences: ").append(toIndentedString(textOccurences)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/aspose/asposecloudpdf/model/TextReplace.java b/src/main/java/com/aspose/asposecloudpdf/model/TextReplace.java new file mode 100644 index 0000000..6c248c5 --- /dev/null +++ b/src/main/java/com/aspose/asposecloudpdf/model/TextReplace.java @@ -0,0 +1,198 @@ +/** + * + * Copyright (c) 2018 Aspose.Pdf for Cloud + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + */ + + +package com.aspose.asposecloudpdf.model; + +import java.util.Objects; +import com.aspose.asposecloudpdf.model.Rectangle; +import com.aspose.asposecloudpdf.model.TextState; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +/** + * Single text replacement setting. + */ +@ApiModel(description = "Single text replacement setting.") + + +public class TextReplace { + @SerializedName("OldValue") + private String oldValue = null; + + @SerializedName("NewValue") + private String newValue = null; + + @SerializedName("Regex") + private Boolean regex = null; + + @SerializedName("TextState") + private TextState textState = null; + + @SerializedName("Rect") + private Rectangle rect = null; + + public TextReplace oldValue(String oldValue) { + this.oldValue = oldValue; + return this; + } + + /** + * Original text. + * @return oldValue + **/ + @ApiModelProperty(required = true, value = "Original text.") + public String getOldValue() { + return oldValue; + } + + public void setOldValue(String oldValue) { + this.oldValue = oldValue; + } + + public TextReplace newValue(String newValue) { + this.newValue = newValue; + return this; + } + + /** + * New text. + * @return newValue + **/ + @ApiModelProperty(required = true, value = "New text.") + public String getNewValue() { + return newValue; + } + + public void setNewValue(String newValue) { + this.newValue = newValue; + } + + public TextReplace regex(Boolean regex) { + this.regex = regex; + return this; + } + + /** + * Gets or sets a value indicating whether search text is regular expression. + * @return regex + **/ + @ApiModelProperty(required = true, value = "Gets or sets a value indicating whether search text is regular expression.") + public Boolean isRegex() { + return regex; + } + + public void setRegex(Boolean regex) { + this.regex = regex; + } + + public TextReplace textState(TextState textState) { + this.textState = textState; + return this; + } + + /** + * Text properties of a new text. + * @return textState + **/ + @ApiModelProperty(value = "Text properties of a new text.") + public TextState getTextState() { + return textState; + } + + public void setTextState(TextState textState) { + this.textState = textState; + } + + public TextReplace rect(Rectangle rect) { + this.rect = rect; + return this; + } + + /** + * Rectangle area where searched original text. + * @return rect + **/ + @ApiModelProperty(value = "Rectangle area where searched original text.") + public Rectangle getRect() { + return rect; + } + + public void setRect(Rectangle rect) { + this.rect = rect; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TextReplace textReplace = (TextReplace) o; + return Objects.equals(this.oldValue, textReplace.oldValue) && + Objects.equals(this.newValue, textReplace.newValue) && + Objects.equals(this.regex, textReplace.regex) && + Objects.equals(this.textState, textReplace.textState) && + Objects.equals(this.rect, textReplace.rect); + } + + @Override + public int hashCode() { + return Objects.hash(oldValue, newValue, regex, textState, rect); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TextReplace {\n"); + + sb.append(" oldValue: ").append(toIndentedString(oldValue)).append("\n"); + sb.append(" newValue: ").append(toIndentedString(newValue)).append("\n"); + sb.append(" regex: ").append(toIndentedString(regex)).append("\n"); + sb.append(" textState: ").append(toIndentedString(textState)).append("\n"); + sb.append(" rect: ").append(toIndentedString(rect)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/aspose/asposecloudpdf/model/TextReplaceListRequest.java b/src/main/java/com/aspose/asposecloudpdf/model/TextReplaceListRequest.java new file mode 100644 index 0000000..c6ff04d --- /dev/null +++ b/src/main/java/com/aspose/asposecloudpdf/model/TextReplaceListRequest.java @@ -0,0 +1,180 @@ +/** + * + * Copyright (c) 2018 Aspose.Pdf for Cloud + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + */ + + +package com.aspose.asposecloudpdf.model; + +import java.util.Objects; +import com.aspose.asposecloudpdf.model.TextReplace; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +/** + * Multiple text replacements request. + */ +@ApiModel(description = "Multiple text replacements request.") + +public class TextReplaceListRequest { + @SerializedName("TextReplaces") + private List textReplaces = new ArrayList(); + + @SerializedName("DefaultFont") + private String defaultFont = null; + + @SerializedName("StartIndex") + private Integer startIndex = null; + + @SerializedName("CountReplace") + private Integer countReplace = null; + + public TextReplaceListRequest textReplaces(List textReplaces) { + this.textReplaces = textReplaces; + return this; + } + + public TextReplaceListRequest addTextReplacesItem(TextReplace textReplacesItem) { + this.textReplaces.add(textReplacesItem); + return this; + } + + /** + * A list of text replacement settings. + * @return textReplaces + **/ + @ApiModelProperty(required = true, value = "A list of text replacement settings.") + public List getTextReplaces() { + return textReplaces; + } + + public void setTextReplaces(List textReplaces) { + this.textReplaces = textReplaces; + } + + public TextReplaceListRequest defaultFont(String defaultFont) { + this.defaultFont = defaultFont; + return this; + } + + /** + * Get defaultFont + * @return defaultFont + **/ + @ApiModelProperty(value = "") + public String getDefaultFont() { + return defaultFont; + } + + public void setDefaultFont(String defaultFont) { + this.defaultFont = defaultFont; + } + + public TextReplaceListRequest startIndex(Integer startIndex) { + this.startIndex = startIndex; + return this; + } + + /** + * Get startIndex + * @return startIndex + **/ + @ApiModelProperty(value = "") + public Integer getStartIndex() { + return startIndex; + } + + public void setStartIndex(Integer startIndex) { + this.startIndex = startIndex; + } + + public TextReplaceListRequest countReplace(Integer countReplace) { + this.countReplace = countReplace; + return this; + } + + /** + * Get countReplace + * @return countReplace + **/ + @ApiModelProperty(value = "") + public Integer getCountReplace() { + return countReplace; + } + + public void setCountReplace(Integer countReplace) { + this.countReplace = countReplace; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TextReplaceListRequest textReplaceListRequest = (TextReplaceListRequest) o; + return Objects.equals(this.textReplaces, textReplaceListRequest.textReplaces) && + Objects.equals(this.defaultFont, textReplaceListRequest.defaultFont) && + Objects.equals(this.startIndex, textReplaceListRequest.startIndex) && + Objects.equals(this.countReplace, textReplaceListRequest.countReplace); + } + + @Override + public int hashCode() { + return Objects.hash(textReplaces, defaultFont, startIndex, countReplace); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TextReplaceListRequest {\n"); + + sb.append(" textReplaces: ").append(toIndentedString(textReplaces)).append("\n"); + sb.append(" defaultFont: ").append(toIndentedString(defaultFont)).append("\n"); + sb.append(" startIndex: ").append(toIndentedString(startIndex)).append("\n"); + sb.append(" countReplace: ").append(toIndentedString(countReplace)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/aspose/asposecloudpdf/model/TextReplaceRequest.java b/src/main/java/com/aspose/asposecloudpdf/model/TextReplaceRequest.java new file mode 100644 index 0000000..5553dd6 --- /dev/null +++ b/src/main/java/com/aspose/asposecloudpdf/model/TextReplaceRequest.java @@ -0,0 +1,107 @@ +/** + * + * Copyright (c) 2018 Aspose.Pdf for Cloud + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + */ + + +package com.aspose.asposecloudpdf.model; + +import java.util.Objects; +import com.aspose.asposecloudpdf.model.Rectangle; +import com.aspose.asposecloudpdf.model.TextReplace; +import com.aspose.asposecloudpdf.model.TextState; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +/** + * Single text replacement request. + */ +@ApiModel(description = "Single text replacement request.") + +public class TextReplaceRequest extends TextReplace { + @SerializedName("DefaultFont") + private String defaultFont = null; + + public TextReplaceRequest defaultFont(String defaultFont) { + this.defaultFont = defaultFont; + return this; + } + + /** + * Get defaultFont + * @return defaultFont + **/ + @ApiModelProperty(value = "") + public String getDefaultFont() { + return defaultFont; + } + + public void setDefaultFont(String defaultFont) { + this.defaultFont = defaultFont; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TextReplaceRequest textReplaceRequest = (TextReplaceRequest) o; + return Objects.equals(this.defaultFont, textReplaceRequest.defaultFont) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(defaultFont, super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TextReplaceRequest {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" defaultFont: ").append(toIndentedString(defaultFont)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/aspose/asposecloudpdf/model/TextReplaceResponse.java b/src/main/java/com/aspose/asposecloudpdf/model/TextReplaceResponse.java new file mode 100644 index 0000000..1716f9c --- /dev/null +++ b/src/main/java/com/aspose/asposecloudpdf/model/TextReplaceResponse.java @@ -0,0 +1,105 @@ +/** + * + * Copyright (c) 2018 Aspose.Pdf for Cloud + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + */ + + +package com.aspose.asposecloudpdf.model; + +import java.util.Objects; +import com.aspose.asposecloudpdf.model.HttpStatusCode; +import com.aspose.asposecloudpdf.model.SaaSposeResponse; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +/** + * TextReplaceResponse + */ + +public class TextReplaceResponse extends SaaSposeResponse { + @SerializedName("Matches") + private Integer matches = null; + + public TextReplaceResponse matches(Integer matches) { + this.matches = matches; + return this; + } + + /** + * Get matches + * @return matches + **/ + @ApiModelProperty(value = "") + public Integer getMatches() { + return matches; + } + + public void setMatches(Integer matches) { + this.matches = matches; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TextReplaceResponse textReplaceResponse = (TextReplaceResponse) o; + return Objects.equals(this.matches, textReplaceResponse.matches) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(matches, super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TextReplaceResponse {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" matches: ").append(toIndentedString(matches)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/aspose/asposecloudpdf/model/TextState.java b/src/main/java/com/aspose/asposecloudpdf/model/TextState.java new file mode 100644 index 0000000..469cdf9 --- /dev/null +++ b/src/main/java/com/aspose/asposecloudpdf/model/TextState.java @@ -0,0 +1,197 @@ +/** + * + * Copyright (c) 2018 Aspose.Pdf for Cloud + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + */ + + +package com.aspose.asposecloudpdf.model; + +import java.util.Objects; +import com.aspose.asposecloudpdf.model.Color; +import com.aspose.asposecloudpdf.model.FontStyles; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +/** + * Represents a text state of a text + */ +@ApiModel(description = "Represents a text state of a text") + +public class TextState { + @SerializedName("FontSize") + private Double fontSize = null; + + @SerializedName("Font") + private String font = null; + + @SerializedName("ForegroundColor") + private Color foregroundColor = null; + + @SerializedName("BackgroundColor") + private Color backgroundColor = null; + + @SerializedName("FontStyle") + private FontStyles fontStyle = null; + + public TextState fontSize(Double fontSize) { + this.fontSize = fontSize; + return this; + } + + /** + * Gets or sets font size of the text. + * @return fontSize + **/ + @ApiModelProperty(required = true, value = "Gets or sets font size of the text.") + public Double getFontSize() { + return fontSize; + } + + public void setFontSize(Double fontSize) { + this.fontSize = fontSize; + } + + public TextState font(String font) { + this.font = font; + return this; + } + + /** + * Gets or sets font of the text. + * @return font + **/ + @ApiModelProperty(value = "Gets or sets font of the text.") + public String getFont() { + return font; + } + + public void setFont(String font) { + this.font = font; + } + + public TextState foregroundColor(Color foregroundColor) { + this.foregroundColor = foregroundColor; + return this; + } + + /** + * Gets or sets foreground color of the text. + * @return foregroundColor + **/ + @ApiModelProperty(value = "Gets or sets foreground color of the text.") + public Color getForegroundColor() { + return foregroundColor; + } + + public void setForegroundColor(Color foregroundColor) { + this.foregroundColor = foregroundColor; + } + + public TextState backgroundColor(Color backgroundColor) { + this.backgroundColor = backgroundColor; + return this; + } + + /** + * Sets background color of the text. + * @return backgroundColor + **/ + @ApiModelProperty(value = "Sets background color of the text.") + public Color getBackgroundColor() { + return backgroundColor; + } + + public void setBackgroundColor(Color backgroundColor) { + this.backgroundColor = backgroundColor; + } + + public TextState fontStyle(FontStyles fontStyle) { + this.fontStyle = fontStyle; + return this; + } + + /** + * Sets font style of the text. + * @return fontStyle + **/ + @ApiModelProperty(required = true, value = "Sets font style of the text.") + public FontStyles getFontStyle() { + return fontStyle; + } + + public void setFontStyle(FontStyles fontStyle) { + this.fontStyle = fontStyle; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TextState textState = (TextState) o; + return Objects.equals(this.fontSize, textState.fontSize) && + Objects.equals(this.font, textState.font) && + Objects.equals(this.foregroundColor, textState.foregroundColor) && + Objects.equals(this.backgroundColor, textState.backgroundColor) && + Objects.equals(this.fontStyle, textState.fontStyle); + } + + @Override + public int hashCode() { + return Objects.hash(fontSize, font, foregroundColor, backgroundColor, fontStyle); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TextState {\n"); + + sb.append(" fontSize: ").append(toIndentedString(fontSize)).append("\n"); + sb.append(" font: ").append(toIndentedString(font)).append("\n"); + sb.append(" foregroundColor: ").append(toIndentedString(foregroundColor)).append("\n"); + sb.append(" backgroundColor: ").append(toIndentedString(backgroundColor)).append("\n"); + sb.append(" fontStyle: ").append(toIndentedString(fontStyle)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/aspose/asposecloudpdf/model/TiffExportOptions.java b/src/main/java/com/aspose/asposecloudpdf/model/TiffExportOptions.java new file mode 100644 index 0000000..8ad0a92 --- /dev/null +++ b/src/main/java/com/aspose/asposecloudpdf/model/TiffExportOptions.java @@ -0,0 +1,451 @@ +/** + * + * Copyright (c) 2018 Aspose.Pdf for Cloud + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + */ + + +package com.aspose.asposecloudpdf.model; + +import java.util.Objects; +import com.aspose.asposecloudpdf.model.ColorDepth; +import com.aspose.asposecloudpdf.model.CompressionType; +import com.aspose.asposecloudpdf.model.ShapeType; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +/** + * Used for tiff export options setting. + */ +@ApiModel(description = "Used for tiff export options setting.") + +public class TiffExportOptions { + @SerializedName("Brightness") + private Double brightness = null; + + @SerializedName("Compression") + private CompressionType compression = null; + + @SerializedName("ColorDepth") + private ColorDepth colorDepth = null; + + @SerializedName("LeftMargin") + private Integer leftMargin = null; + + @SerializedName("RightMargin") + private Integer rightMargin = null; + + @SerializedName("TopMargin") + private Integer topMargin = null; + + @SerializedName("BottomMargin") + private Integer bottomMargin = null; + + @SerializedName("Orientation") + private ShapeType orientation = null; + + @SerializedName("SkipBlankPages") + private Boolean skipBlankPages = null; + + @SerializedName("Width") + private Integer width = null; + + @SerializedName("Height") + private Integer height = null; + + @SerializedName("XResolution") + private Integer xresolution = null; + + @SerializedName("YResolution") + private Integer yresolution = null; + + @SerializedName("PageIndex") + private Integer pageIndex = null; + + @SerializedName("PageCount") + private Integer pageCount = null; + + @SerializedName("ResultFile") + private String resultFile = null; + + public TiffExportOptions brightness(Double brightness) { + this.brightness = brightness; + return this; + } + + /** + * Image brightness. + * @return brightness + **/ + @ApiModelProperty(value = "Image brightness.") + public Double getBrightness() { + return brightness; + } + + public void setBrightness(Double brightness) { + this.brightness = brightness; + } + + public TiffExportOptions compression(CompressionType compression) { + this.compression = compression; + return this; + } + + /** + * Tiff compression. Possible values are: LZW, CCITT4, CCITT3, RLE, None. + * @return compression + **/ + @ApiModelProperty(value = "Tiff compression. Possible values are: LZW, CCITT4, CCITT3, RLE, None.") + public CompressionType getCompression() { + return compression; + } + + public void setCompression(CompressionType compression) { + this.compression = compression; + } + + public TiffExportOptions colorDepth(ColorDepth colorDepth) { + this.colorDepth = colorDepth; + return this; + } + + /** + * Image color depth. Possible valuse are: Default, Format8bpp, Format4bpp, Format1bpp. + * @return colorDepth + **/ + @ApiModelProperty(value = "Image color depth. Possible valuse are: Default, Format8bpp, Format4bpp, Format1bpp.") + public ColorDepth getColorDepth() { + return colorDepth; + } + + public void setColorDepth(ColorDepth colorDepth) { + this.colorDepth = colorDepth; + } + + public TiffExportOptions leftMargin(Integer leftMargin) { + this.leftMargin = leftMargin; + return this; + } + + /** + * Left image margin. + * @return leftMargin + **/ + @ApiModelProperty(value = "Left image margin.") + public Integer getLeftMargin() { + return leftMargin; + } + + public void setLeftMargin(Integer leftMargin) { + this.leftMargin = leftMargin; + } + + public TiffExportOptions rightMargin(Integer rightMargin) { + this.rightMargin = rightMargin; + return this; + } + + /** + * Right image margin. + * @return rightMargin + **/ + @ApiModelProperty(value = "Right image margin.") + public Integer getRightMargin() { + return rightMargin; + } + + public void setRightMargin(Integer rightMargin) { + this.rightMargin = rightMargin; + } + + public TiffExportOptions topMargin(Integer topMargin) { + this.topMargin = topMargin; + return this; + } + + /** + * Top image margin. + * @return topMargin + **/ + @ApiModelProperty(value = "Top image margin.") + public Integer getTopMargin() { + return topMargin; + } + + public void setTopMargin(Integer topMargin) { + this.topMargin = topMargin; + } + + public TiffExportOptions bottomMargin(Integer bottomMargin) { + this.bottomMargin = bottomMargin; + return this; + } + + /** + * Bottom image margin. + * @return bottomMargin + **/ + @ApiModelProperty(value = "Bottom image margin.") + public Integer getBottomMargin() { + return bottomMargin; + } + + public void setBottomMargin(Integer bottomMargin) { + this.bottomMargin = bottomMargin; + } + + public TiffExportOptions orientation(ShapeType orientation) { + this.orientation = orientation; + return this; + } + + /** + * Image orientation. Possible values are: None, Landscape, Portait. + * @return orientation + **/ + @ApiModelProperty(value = "Image orientation. Possible values are: None, Landscape, Portait.") + public ShapeType getOrientation() { + return orientation; + } + + public void setOrientation(ShapeType orientation) { + this.orientation = orientation; + } + + public TiffExportOptions skipBlankPages(Boolean skipBlankPages) { + this.skipBlankPages = skipBlankPages; + return this; + } + + /** + * Skip blank pages flag. + * @return skipBlankPages + **/ + @ApiModelProperty(value = "Skip blank pages flag.") + public Boolean isSkipBlankPages() { + return skipBlankPages; + } + + public void setSkipBlankPages(Boolean skipBlankPages) { + this.skipBlankPages = skipBlankPages; + } + + public TiffExportOptions width(Integer width) { + this.width = width; + return this; + } + + /** + * Image width. + * @return width + **/ + @ApiModelProperty(value = "Image width.") + public Integer getWidth() { + return width; + } + + public void setWidth(Integer width) { + this.width = width; + } + + public TiffExportOptions height(Integer height) { + this.height = height; + return this; + } + + /** + * Image height. + * @return height + **/ + @ApiModelProperty(value = "Image height.") + public Integer getHeight() { + return height; + } + + public void setHeight(Integer height) { + this.height = height; + } + + public TiffExportOptions xresolution(Integer xresolution) { + this.xresolution = xresolution; + return this; + } + + /** + * Horizontal resolution. + * @return xresolution + **/ + @ApiModelProperty(value = "Horizontal resolution.") + public Integer getXresolution() { + return xresolution; + } + + public void setXresolution(Integer xresolution) { + this.xresolution = xresolution; + } + + public TiffExportOptions yresolution(Integer yresolution) { + this.yresolution = yresolution; + return this; + } + + /** + * Vertical resolution. + * @return yresolution + **/ + @ApiModelProperty(value = "Vertical resolution.") + public Integer getYresolution() { + return yresolution; + } + + public void setYresolution(Integer yresolution) { + this.yresolution = yresolution; + } + + public TiffExportOptions pageIndex(Integer pageIndex) { + this.pageIndex = pageIndex; + return this; + } + + /** + * Start page to export. + * @return pageIndex + **/ + @ApiModelProperty(value = "Start page to export.") + public Integer getPageIndex() { + return pageIndex; + } + + public void setPageIndex(Integer pageIndex) { + this.pageIndex = pageIndex; + } + + public TiffExportOptions pageCount(Integer pageCount) { + this.pageCount = pageCount; + return this; + } + + /** + * Number of pages to export. + * @return pageCount + **/ + @ApiModelProperty(value = "Number of pages to export.") + public Integer getPageCount() { + return pageCount; + } + + public void setPageCount(Integer pageCount) { + this.pageCount = pageCount; + } + + public TiffExportOptions resultFile(String resultFile) { + this.resultFile = resultFile; + return this; + } + + /** + * Resulting image file. + * @return resultFile + **/ + @ApiModelProperty(value = "Resulting image file.") + public String getResultFile() { + return resultFile; + } + + public void setResultFile(String resultFile) { + this.resultFile = resultFile; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TiffExportOptions tiffExportOptions = (TiffExportOptions) o; + return Objects.equals(this.brightness, tiffExportOptions.brightness) && + Objects.equals(this.compression, tiffExportOptions.compression) && + Objects.equals(this.colorDepth, tiffExportOptions.colorDepth) && + Objects.equals(this.leftMargin, tiffExportOptions.leftMargin) && + Objects.equals(this.rightMargin, tiffExportOptions.rightMargin) && + Objects.equals(this.topMargin, tiffExportOptions.topMargin) && + Objects.equals(this.bottomMargin, tiffExportOptions.bottomMargin) && + Objects.equals(this.orientation, tiffExportOptions.orientation) && + Objects.equals(this.skipBlankPages, tiffExportOptions.skipBlankPages) && + Objects.equals(this.width, tiffExportOptions.width) && + Objects.equals(this.height, tiffExportOptions.height) && + Objects.equals(this.xresolution, tiffExportOptions.xresolution) && + Objects.equals(this.yresolution, tiffExportOptions.yresolution) && + Objects.equals(this.pageIndex, tiffExportOptions.pageIndex) && + Objects.equals(this.pageCount, tiffExportOptions.pageCount) && + Objects.equals(this.resultFile, tiffExportOptions.resultFile); + } + + @Override + public int hashCode() { + return Objects.hash(brightness, compression, colorDepth, leftMargin, rightMargin, topMargin, bottomMargin, orientation, skipBlankPages, width, height, xresolution, yresolution, pageIndex, pageCount, resultFile); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TiffExportOptions {\n"); + + sb.append(" brightness: ").append(toIndentedString(brightness)).append("\n"); + sb.append(" compression: ").append(toIndentedString(compression)).append("\n"); + sb.append(" colorDepth: ").append(toIndentedString(colorDepth)).append("\n"); + sb.append(" leftMargin: ").append(toIndentedString(leftMargin)).append("\n"); + sb.append(" rightMargin: ").append(toIndentedString(rightMargin)).append("\n"); + sb.append(" topMargin: ").append(toIndentedString(topMargin)).append("\n"); + sb.append(" bottomMargin: ").append(toIndentedString(bottomMargin)).append("\n"); + sb.append(" orientation: ").append(toIndentedString(orientation)).append("\n"); + sb.append(" skipBlankPages: ").append(toIndentedString(skipBlankPages)).append("\n"); + sb.append(" width: ").append(toIndentedString(width)).append("\n"); + sb.append(" height: ").append(toIndentedString(height)).append("\n"); + sb.append(" xresolution: ").append(toIndentedString(xresolution)).append("\n"); + sb.append(" yresolution: ").append(toIndentedString(yresolution)).append("\n"); + sb.append(" pageIndex: ").append(toIndentedString(pageIndex)).append("\n"); + sb.append(" pageCount: ").append(toIndentedString(pageCount)).append("\n"); + sb.append(" resultFile: ").append(toIndentedString(resultFile)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/aspose/asposecloudpdf/model/VerticalAlignment.java b/src/main/java/com/aspose/asposecloudpdf/model/VerticalAlignment.java new file mode 100644 index 0000000..7200c89 --- /dev/null +++ b/src/main/java/com/aspose/asposecloudpdf/model/VerticalAlignment.java @@ -0,0 +1,86 @@ +/** + * + * Copyright (c) 2018 Aspose.Pdf for Cloud + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + */ + + +package com.aspose.asposecloudpdf.model; + +import java.util.Objects; +import io.swagger.annotations.ApiModel; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Enumeration of possible vertical alignment values. + */ +@JsonAdapter(VerticalAlignment.Adapter.class) +public enum VerticalAlignment { + + NONE("None"), + + TOP("Top"), + + CENTER("Center"), + + BOTTOM("Bottom"); + + private String value; + + VerticalAlignment(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static VerticalAlignment fromValue(String text) { + for (VerticalAlignment b : VerticalAlignment.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final VerticalAlignment enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public VerticalAlignment read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return VerticalAlignment.fromValue(String.valueOf(value)); + } + } +} + diff --git a/src/main/java/com/aspose/asposecloudpdf/model/WordCount.java b/src/main/java/com/aspose/asposecloudpdf/model/WordCount.java new file mode 100644 index 0000000..41f7035 --- /dev/null +++ b/src/main/java/com/aspose/asposecloudpdf/model/WordCount.java @@ -0,0 +1,114 @@ +/** + * + * Copyright (c) 2018 Aspose.Pdf for Cloud + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + */ + + +package com.aspose.asposecloudpdf.model; + +import java.util.Objects; +import com.aspose.asposecloudpdf.model.PageWordCount; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +/** + * Number of words per document pages. + */ +@ApiModel(description = "Number of words per document pages.") + +public class WordCount { + @SerializedName("List") + private List list = null; + + public WordCount list(List list) { + this.list = list; + return this; + } + + public WordCount addListItem(PageWordCount listItem) { + if (this.list == null) { + this.list = new ArrayList(); + } + this.list.add(listItem); + return this; + } + + /** + * Get list + * @return list + **/ + @ApiModelProperty(value = "") + public List getList() { + return list; + } + + public void setList(List list) { + this.list = list; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WordCount wordCount = (WordCount) o; + return Objects.equals(this.list, wordCount.list); + } + + @Override + public int hashCode() { + return Objects.hash(list); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WordCount {\n"); + + sb.append(" list: ").append(toIndentedString(list)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/aspose/asposecloudpdf/model/WordCountResponse.java b/src/main/java/com/aspose/asposecloudpdf/model/WordCountResponse.java new file mode 100644 index 0000000..866ba67 --- /dev/null +++ b/src/main/java/com/aspose/asposecloudpdf/model/WordCountResponse.java @@ -0,0 +1,107 @@ +/** + * + * Copyright (c) 2018 Aspose.Pdf for Cloud + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + */ + + +package com.aspose.asposecloudpdf.model; + +import java.util.Objects; +import com.aspose.asposecloudpdf.model.HttpStatusCode; +import com.aspose.asposecloudpdf.model.SaaSposeResponse; +import com.aspose.asposecloudpdf.model.WordCount; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +/** + * Number of words per document pages. + */ +@ApiModel(description = "Number of words per document pages.") + +public class WordCountResponse extends SaaSposeResponse { + @SerializedName("WordsPerPage") + private WordCount wordsPerPage = null; + + public WordCountResponse wordsPerPage(WordCount wordsPerPage) { + this.wordsPerPage = wordsPerPage; + return this; + } + + /** + * with words per page info. + * @return wordsPerPage + **/ + @ApiModelProperty(value = "with words per page info. ") + public WordCount getWordsPerPage() { + return wordsPerPage; + } + + public void setWordsPerPage(WordCount wordsPerPage) { + this.wordsPerPage = wordsPerPage; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WordCountResponse wordCountResponse = (WordCountResponse) o; + return Objects.equals(this.wordsPerPage, wordCountResponse.wordsPerPage) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(wordsPerPage, super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WordCountResponse {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" wordsPerPage: ").append(toIndentedString(wordsPerPage)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/aspose/asposecloudpdf/model/WrapMode.java b/src/main/java/com/aspose/asposecloudpdf/model/WrapMode.java new file mode 100644 index 0000000..ca84d37 --- /dev/null +++ b/src/main/java/com/aspose/asposecloudpdf/model/WrapMode.java @@ -0,0 +1,84 @@ +/** + * + * Copyright (c) 2018 Aspose.Pdf for Cloud + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + */ + + +package com.aspose.asposecloudpdf.model; + +import java.util.Objects; +import io.swagger.annotations.ApiModel; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * + */ +@JsonAdapter(WrapMode.Adapter.class) +public enum WrapMode { + + NOWRAP("NoWrap"), + + BYWORDS("ByWords"), + + DISCRETIONARYHYPHENATION("DiscretionaryHyphenation"); + + private String value; + + WrapMode(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static WrapMode fromValue(String text) { + for (WrapMode b : WrapMode.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final WrapMode enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public WrapMode read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return WrapMode.fromValue(String.valueOf(value)); + } + } +} + diff --git a/src/test/java/com/aspose/asposecloudpdf/api/PdfApiTest.java b/src/test/java/com/aspose/asposecloudpdf/api/PdfApiTest.java new file mode 100644 index 0000000..706b0de --- /dev/null +++ b/src/test/java/com/aspose/asposecloudpdf/api/PdfApiTest.java @@ -0,0 +1,3067 @@ +/** + * + * Copyright (c) 2018 Aspose.Pdf for Cloud + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + */ + + +package com.aspose.asposecloudpdf.api; + +import com.aspose.asposecloudpdf.ApiException; +import com.aspose.asposecloudpdf.model.AnnotationsResponse; +import com.aspose.asposecloudpdf.model.AppendDocument; +import com.aspose.asposecloudpdf.model.AttachmentResponse; +import com.aspose.asposecloudpdf.model.AttachmentsResponse; +import com.aspose.asposecloudpdf.model.Color; +import com.aspose.asposecloudpdf.model.ColorDepth; +import com.aspose.asposecloudpdf.model.CompressionType; +import com.aspose.asposecloudpdf.model.DocumentPagesResponse; +import com.aspose.asposecloudpdf.model.DocumentPrivilege; +import com.aspose.asposecloudpdf.model.DocumentPropertiesResponse; +import com.aspose.asposecloudpdf.model.DocumentProperty; +import com.aspose.asposecloudpdf.model.DocumentPropertyResponse; +import com.aspose.asposecloudpdf.model.DocumentResponse; +import com.aspose.asposecloudpdf.model.DocumentTextReplaceResponse; +import com.aspose.asposecloudpdf.model.FieldType; +import com.aspose.asposecloudpdf.model.FontStyles; +import com.aspose.asposecloudpdf.model.PdfAType; +import com.aspose.asposecloudpdf.model.Rectangle; +import com.aspose.asposecloudpdf.model.Field; +import com.aspose.asposecloudpdf.model.FieldResponse; +import com.aspose.asposecloudpdf.model.FieldsResponse; +import com.aspose.asposecloudpdf.model.Segment; +import com.aspose.asposecloudpdf.model.TextLine; +import com.aspose.asposecloudpdf.model.ShapeType; +import com.aspose.asposecloudpdf.model.StampType; +import com.aspose.asposecloudpdf.model.TextReplace; +import com.aspose.asposecloudpdf.model.TextState; +import com.aspose.asposecloudpdf.model.TextHorizontalAlignment; +import com.aspose.asposecloudpdf.model.VerticalAlignment; + +import java.io.File; + +import com.aspose.asposecloudpdf.model.HttpStatusCode; +import com.aspose.asposecloudpdf.model.ImageResponse; +import com.aspose.asposecloudpdf.model.ImagesListRequest; +import com.aspose.asposecloudpdf.model.ImagesResponse; +import com.aspose.asposecloudpdf.model.LineSpacing; +import com.aspose.asposecloudpdf.model.LinkAnnotationResponse; +import com.aspose.asposecloudpdf.model.LinkAnnotationsResponse; +import com.aspose.asposecloudpdf.model.MergeDocuments; +import com.aspose.asposecloudpdf.model.OptimizeOptions; +import com.aspose.asposecloudpdf.model.PageTextReplaceResponse; +import com.aspose.asposecloudpdf.model.Paragraph; +import com.aspose.asposecloudpdf.model.SaaSposeResponse; +import com.aspose.asposecloudpdf.model.Signature; +import com.aspose.asposecloudpdf.model.SignatureType; +import com.aspose.asposecloudpdf.model.SignatureVerifyResponse; +import com.aspose.asposecloudpdf.model.SplitResultResponse; +import com.aspose.asposecloudpdf.model.Stamp; +import com.aspose.asposecloudpdf.model.TextFormatResponse; +import com.aspose.asposecloudpdf.model.TextItemResponse; +import com.aspose.asposecloudpdf.model.TextItemsResponse; +import com.aspose.asposecloudpdf.model.TextRectsResponse; +import com.aspose.asposecloudpdf.model.TextReplaceListRequest; +import com.aspose.asposecloudpdf.model.TextReplaceRequest; +import com.aspose.asposecloudpdf.model.TextReplaceResponse; +import com.aspose.asposecloudpdf.model.TiffExportOptions; +import com.aspose.asposecloudpdf.model.WordCountResponse; +import com.aspose.asposecloudpdf.model.WrapMode; +import com.google.gson.Gson; +import com.google.gson.stream.JsonReader; + +import org.junit.Assert; +import org.junit.Test; + +import java.io.FileNotFoundException; +import java.io.FileReader; +import java.util.ArrayList; +import java.util.List; + +import javax.xml.parsers.SAXParser; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; + +/** + * API tests for PdfApi + */ +public class PdfApiTest +{ + private final PdfApi pdfApi; + private String tempFolder = "TempPdfCloud"; + private String testDataFolder = "testData"; + private String setupFile = "setup.json"; + + class ApiCreds{ + public String app_key; + public String app_sid; + public String product_uri; + } + + public PdfApiTest() throws FileNotFoundException + { + ApiCreds apiCreds = getApiCreds(); + pdfApi = new PdfApi(apiCreds.app_key, apiCreds.app_sid); + pdfApi.getApiClient().setBasePath(apiCreds.product_uri); + } + + private ApiCreds getApiCreds() throws FileNotFoundException + { + Gson gson = new Gson(); + JsonReader reader = new JsonReader(new FileReader(setupFile)); + return gson.fromJson(reader, ApiCreds.class); + } + + + private void uploadFile(String name) throws ApiException + { + File file = new File(testDataFolder + "/" + name); + SaaSposeResponse response = pdfApi.putCreate(tempFolder + '/' + name, file, null, null); + assertEquals(response.getCode(), HttpStatusCode.OK); + } + + + /** + * GetPageAnnotationsTest + * @throws ApiException + * if the Api call fails + */ + @Test + public void getPageAnnotationsTest()throws ApiException + { + String name = "PdfWithAnnotations.pdf"; + int pageNumber = 2; + + uploadFile(name); + AnnotationsResponse response = pdfApi.getPageAnnotations(name, pageNumber, null, tempFolder); + assertEquals(response.getCode(), HttpStatusCode.OK); + } + + + /** + * PostAppendDocumentUsingQueryParams Test + * @throws ApiException + * if the Api call fails + */ + + @Test + public void postAppendDocumentUsingQueryParamsTest() throws ApiException + { + String name = "PdfWithImages2.pdf"; + String appendFileName = "4pages.pdf"; + + this.uploadFile(name); + this.uploadFile(appendFileName); + + int startPage = 2; + int endPage = 4; + + DocumentResponse response = this.pdfApi.postAppendDocument(name, null, this.tempFolder + '/' + appendFileName, startPage, endPage, null, this.tempFolder); + assertEquals(response.getCode(), HttpStatusCode.OK); + } + + /** + * PostAppendDocumentUsingBodyParams Test + * @throws ApiException + * if the Api call fails + */ + + @Test + public void postAppendDocumentUsingBodyParamsTest() throws ApiException + { + String name = "PdfWithImages2.pdf"; + String appendFileName = "4pages.pdf"; + + this.uploadFile(name); + this.uploadFile(appendFileName); + + AppendDocument appendDocument = new AppendDocument(); + appendDocument.setDocument(this.tempFolder + '/' + appendFileName); + appendDocument.setStartPage(2); + appendDocument.setEndPage(4); + + DocumentResponse response = this.pdfApi.postAppendDocument(name, appendDocument, null, null, null, null, this.tempFolder); + assertEquals(response.getCode(), HttpStatusCode.OK); + } + + + //Attachments Tests + + /** + * GetDocumentAttachmentByIndex Test + * @throws ApiException + * if the Api call fails + */ + + @Test + public void getDocumentAttachmentByIndexTest() throws ApiException + { + String name = "PdfWithEmbeddedFiles.pdf"; + this.uploadFile(name); + + int attachmentIndex = 1; + + AttachmentResponse response = this.pdfApi.getDocumentAttachmentByIndex(name, attachmentIndex, null, this.tempFolder); + assertEquals(response.getCode(), HttpStatusCode.OK); + } + + /** + * GetDocumentAttachments Test + * @throws ApiException + * if the Api call fails + */ + + @Test + public void getDocumentAttachmentsTest() throws ApiException + { + String name = "PdfWithEmbeddedFiles.pdf"; + this.uploadFile(name); + + AttachmentsResponse response = this.pdfApi.getDocumentAttachments(name, null, this.tempFolder); + assertEquals(response.getCode(), HttpStatusCode.OK); + } + + /** + * GetDownloadDocumentAttachmentByIndex Test + * @throws ApiException + * if the Api call fails + */ + + @Test + public void getDownloadDocumentAttachmentByIndexTest() throws ApiException + { + String name = "PdfWithEmbeddedFiles.pdf"; + this.uploadFile(name); + + int attachmentIndex = 1; + + File response = this.pdfApi.getDownloadDocumentAttachmentByIndex(name, attachmentIndex, null, this.tempFolder); + assertNotNull(response); + } + + + // Bookmarks Tests + + /** + * GetDocumentBookmarks Test + * @throws ApiException + * if the Api call fails + */ + + @Test + public void getDocumentBookmarksTest() throws ApiException + { + String name = "PdfWithBookmarks.pdf"; + this.uploadFile(name); + + File response = this.pdfApi.getDocumentBookmarks(name, null, null, this.tempFolder); + assertNotNull(response); + } + + + // Document Save As Tiff Tests + + /** + * PutDocumentSaveAsTiffUsingQueryParams Test + * @throws ApiException + * if the Api call fails + */ + + @Test + public void putDocumentSaveAsTiffUsingQueryParamsTest() throws ApiException + { + String name = "4pages.pdf"; + this.uploadFile(name); + + String resultFile = "4pages.tiff"; + double brightness = 0.6; + String compression = CompressionType.CCITT4.toString(); + String colorDepth = ColorDepth.FORMAT1BPP.toString(); + int leftMargin = 0; + int rightMargin = 0; + int topMargin = 0; + int bottomMargin = 0; + String orientation = ShapeType.PORTRAIT.toString(); + boolean skipBlankPages = true; + int width = 1200; + int height = 1600; + int xResolution = 200; + int yResolution = 200; + int pageIndex = 2; + int pageCount = 2; + String folder = this.tempFolder; + + SaaSposeResponse response = this.pdfApi.putDocumentSaveAsTiff(name, null, resultFile, brightness, compression, + colorDepth, leftMargin, rightMargin, topMargin, bottomMargin, orientation, skipBlankPages, + width, height, xResolution, yResolution, pageIndex, pageCount, null, folder); + assertEquals(response.getCode(), HttpStatusCode.OK); + } + + /** + * PutDocumentSaveAsTiffUsingBodyParams Test + * @throws ApiException + * if the Api call fails + */ + + @Test + public void putDocumentSaveAsTiffUsingBodyParamsTest() throws ApiException + { + String name = "4pages.pdf"; + this.uploadFile(name); + + TiffExportOptions exportOptions = new TiffExportOptions(); + exportOptions.setResultFile("4pages.tiff"); + exportOptions.setBrightness(0.6); + exportOptions.setCompression(CompressionType.CCITT4); + exportOptions.setColorDepth(ColorDepth.FORMAT1BPP); + exportOptions.setLeftMargin(0); + exportOptions.setRightMargin(0); + exportOptions.setTopMargin(0); + exportOptions.setBottomMargin(0); + exportOptions.setOrientation(ShapeType.PORTRAIT); + exportOptions.setSkipBlankPages(true); + exportOptions.setWidth(1200); + exportOptions.setHeight(1600); + exportOptions.setXresolution(200); + exportOptions.setYresolution(200); + exportOptions.setPageIndex(2); + exportOptions.setPageCount(2); + + String folder = this.tempFolder; + + SaaSposeResponse response = this.pdfApi.putDocumentSaveAsTiff(name, exportOptions, null, + null, null, null, null, null, + null, null, null, null, null, + null, null, null, null, null, + null, folder); + assertEquals(response.getCode(), HttpStatusCode.OK); + } + + + // Document Tests + + /** + * GetDocument Test + * @throws ApiException + * if the Api call fails + */ + + @Test + public void getDocumentTest() throws ApiException + { + String name = "4pages.pdf"; + this.uploadFile(name); + + String folder = this.tempFolder; + + File response = this.pdfApi.getDocument(name, null, null, folder, null); + assertNotNull(response); + } + + + /** + * PostOptimizeDocument Test + * @throws ApiException + * if the Api call fails + */ + + @Test + public void postOptimizeDocumentTest() throws ApiException + { + String name = "4pages.pdf"; + this.uploadFile(name); + + OptimizeOptions optimizeOptions = new OptimizeOptions(); + optimizeOptions.setAllowReusePageContent(false); + optimizeOptions.setCompressImages(true); + optimizeOptions.setImageQuality(100); + optimizeOptions.setLinkDuplcateStreams(true); + optimizeOptions.setRemoveUnusedObjects(true); + optimizeOptions.setRemoveUnusedStreams(true); + optimizeOptions.setUnembedFonts(true); + + String folder = this.tempFolder; + + SaaSposeResponse response = this.pdfApi.postOptimizeDocument(name, optimizeOptions, null, folder); + assertEquals(response.getCode(), HttpStatusCode.OK); + } + + /** + * PostSplitDocument Test + * @throws ApiException + * if the Api call fails + */ + + @Test + public void postSplitDocumentTest() throws ApiException + { + String name = "4pages.pdf"; + this.uploadFile(name); + + String folder = this.tempFolder; + + SplitResultResponse response = this.pdfApi.postSplitDocument(name, null, null, null, null, folder); + assertEquals(response.getCode(), HttpStatusCode.OK); + } + + + /** + * PutConvertDocument Test + * @throws ApiException + * if the Api call fails + */ + + @Test + public void putConvertDocumentTest() throws ApiException + { + String url = "http://pdf995.com/samples/pdf.pdf"; + String format = "tiff"; + + File response = this.pdfApi.putConvertDocument(format, url, null, null); + assertNotNull(response); + } + + + /** + * PutCreateEmptyDocument Test + * @throws ApiException + * if the Api call fails + */ + + @Test + public void putCreateEmptyDocumentTest() throws ApiException + { + String name = "empty.pdf"; + + String folder = this.tempFolder; + + DocumentResponse response = this.pdfApi.putCreateDocument(name, null, null, null, null, folder, null, null); + assertEquals(response.getCode(), HttpStatusCode.OK); + } + + + /** + * PutCreateDocument Test + * @throws ApiException + * if the Api call fails + */ + + @Test + public void putCreateDocumentTest() throws ApiException + { + String name = "HtmlExample1.pdf"; + String templateName = "HtmlExample1.html"; + String folder = this.tempFolder; + String templateFile = folder + '/' + templateName; + + this.uploadFile(templateName); + + String templateType = "html"; + + DocumentResponse response = this.pdfApi.putCreateDocument(name, templateFile, null, templateType, + null, folder, null, null); + assertEquals(response.getCode(), HttpStatusCode.OK); + } + + + /** + * PutCreateDocumentFromImages Test + * @throws ApiException + * if the Api call fails + */ + + @Test + public void putCreateDocumentFromImagesTest() throws ApiException + { + final String image1 = "33539.jpg"; + this.uploadFile(image1); + + final String image2 = "44781.jpg"; + this.uploadFile(image2); + + String resultDocName = "pdffromimagesinquery.pdf"; + String folder = this.tempFolder; + + ImagesListRequest images = new ImagesListRequest(); + List imagesList = new ArrayList(){{ + add(tempFolder + '/' + image1); + add(tempFolder + '/' + image2); + }}; + images.setImagesList(imagesList); + + boolean ocr = false; + String ocrLang = "eng"; + DocumentResponse response = this.pdfApi.putCreateDocumentFromImages(resultDocName, images , ocr, ocrLang, null, folder); + assertEquals(response.getCode(), HttpStatusCode.OK); + } + + + // Fields Tests + + /** + * GetField Test + * @throws ApiException + * if the Api call fails + */ + + @Test + public void getFieldTest() throws ApiException + { + String name = "PdfWithAcroForm.pdf"; + this.uploadFile(name); + + String folder = this.tempFolder; + String fieldName = "textField"; + + FieldResponse response = this.pdfApi.getField(name, fieldName, null, folder); + assertEquals(response.getCode(), HttpStatusCode.OK); + } + + + /** + * GetFields Test + * @throws ApiException + * if the Api call fails + */ + + @Test + public void getFieldsTest() throws ApiException + { + String name = "PdfWithAcroForm.pdf"; + this.uploadFile(name); + + String folder = this.tempFolder; + + FieldsResponse response = this.pdfApi.getFields(name, null, folder); + assertEquals(response.getCode(), HttpStatusCode.OK); + } + + + /** + * PostCreateField Test + * @throws ApiException + * if the Api call fails + */ + + @Test + public void postCreateFieldTest() throws ApiException + { + String name = "Hello world.pdf"; + this.uploadFile(name); + + Rectangle rect = new Rectangle(); + rect.setX(50); + rect.setY(200); + rect.setWidth(150); + rect.setHeight(200); + + + Field field = new Field(); + field.setName("checkboxfield"); + field.setValues(new ArrayList(){{ add("1");}}); + field.setType(FieldType.BOOLEAN); + field.setRect(rect); + + int pageNumber = 1; + String folder = this.tempFolder; + + SaaSposeResponse response = this.pdfApi.postCreateField(name, pageNumber, field, null, folder); + assertEquals(response.getCode(), HttpStatusCode.OK); + } + + + /** + * DeleteField Test + * @throws ApiException + * if the Api call fails + */ + + @Test + public void deleteFieldTest() throws ApiException + { + String name = "PdfWithAcroForm.pdf"; + this.uploadFile(name); + + String fieldName = "textField"; + + String folder = this.tempFolder; + + SaaSposeResponse response = this.pdfApi.deleteField(name, fieldName, null, folder); + assertEquals(response.getCode(), HttpStatusCode.OK); + } + + + /** + * PutUpdateField Test + * @throws ApiException + * if the Api call fails + */ + + @Test + public void putUpdateFieldTest() throws ApiException + { + String name = "PdfWithAcroForm.pdf"; + this.uploadFile(name); + + String fieldName = "textField"; + + Field field = new Field(); + field.setName(fieldName); + field.setValues(new ArrayList(){{ add("Text field updated value.");}}); + field.setType(FieldType.TEXT); + + String folder = this.tempFolder; + + FieldResponse response = this.pdfApi.putUpdateField(name, fieldName, field, null, folder); + assertEquals(response.getCode(), HttpStatusCode.OK); + } + + + /** + * PutFieldsFlatten Test + * @throws ApiException + * if the Api call fails + */ + + @Test + public void putFieldsFlattenTest() throws ApiException + { + String name = "PdfWithAcroForm.pdf"; + this.uploadFile(name); + + String folder = this.tempFolder; + + SaaSposeResponse response = this.pdfApi.putFieldsFlatten(name, null, folder); + assertEquals(response.getCode(), HttpStatusCode.OK); + } + + + // Fragments And Segments Tests + + /** + * GetFragment Test + * @throws ApiException + * if the Api call fails + */ + + @Test + public void getFragmentTest() throws ApiException + { + String name = "4pages.pdf"; + this.uploadFile(name); + + int pageNumber = 1; + int fragmentNumber = 1; + String folder = this.tempFolder; + + TextItemsResponse response = this.pdfApi.getFragment(name, pageNumber, fragmentNumber, null, null, folder); + assertEquals(response.getCode(), HttpStatusCode.OK); + } + + + /** + * GetFragmentTextFormat Test + * @throws ApiException + * if the Api call fails + */ + + @Test + public void getFragmentTextFormatTest() throws ApiException + { + String name = "4pages.pdf"; + this.uploadFile(name); + + int pageNumber = 1; + int fragmentNumber = 1; + String folder = this.tempFolder; + + TextFormatResponse response = this.pdfApi.getFragmentTextFormat(name, pageNumber, fragmentNumber, null, folder); + assertEquals(response.getCode(), HttpStatusCode.OK); + } + + + /** + * GetFragments Test + * @throws ApiException + * if the Api call fails + */ + + @Test + public void getFragmentsTest() throws ApiException + { + String name = "4pages.pdf"; + this.uploadFile(name); + + int pageNumber = 1; + String folder = this.tempFolder; + + TextItemsResponse response = this.pdfApi.getFragments(name, pageNumber, null, null, folder); + assertEquals(response.getCode(), HttpStatusCode.OK); + } + + + /** + * GetSegment Test + * @throws ApiException + * if the Api call fails + */ + + @Test + public void getSegmentTest() throws ApiException + { + String name = "4pages.pdf"; + this.uploadFile(name); + + int pageNumber = 1; + int fragmentNumber = 1; + int segmentNumber = 1; + String folder = this.tempFolder; + + TextItemResponse response = this.pdfApi.getSegment(name, pageNumber, fragmentNumber, segmentNumber, null, folder); + assertEquals(response.getCode(), HttpStatusCode.OK); + } + + + /** + * GetSegmentTextFormat Test + * @throws ApiException + * if the Api call fails + */ + + @Test + public void getSegmentTextFormatTest() throws ApiException + { + String name = "4pages.pdf"; + this.uploadFile(name); + + int pageNumber = 1; + int fragmentNumber = 1; + int segmentNumber = 1; + String folder = this.tempFolder; + + TextFormatResponse response = this.pdfApi.getSegmentTextFormat(name, pageNumber, fragmentNumber, segmentNumber, null, folder); + assertEquals(response.getCode(), HttpStatusCode.OK); + } + + + /** + * GetSegments Test + * @throws ApiException + * if the Api call fails + */ + + @Test + public void getSegmentsTest() throws ApiException + { + String name = "4pages.pdf"; + this.uploadFile(name); + + int pageNumber = 1; + int fragmentNumber = 1; + String folder = this.tempFolder; + + TextItemsResponse response = this.pdfApi.getSegments(name, pageNumber, fragmentNumber, null, null, folder); + assertEquals(response.getCode(), HttpStatusCode.OK); + } + + + // Images Tests + + /** + * GetImage Test + * @throws ApiException + * if the Api call fails + */ + + @Test + public void getImageTest() throws ApiException + { + String name = "PdfWithImages2.pdf"; + this.uploadFile(name); + + int pageNumber = 1; + int imageNumber = 1; + String folder = this.tempFolder; + + File response = this.pdfApi.getImage(name, pageNumber, imageNumber, null, 0, 0, null, folder); + assertNotNull(response); + } + + + /** + * GetImages Test + * @throws ApiException + * if the Api call fails + */ + + @Test + public void getImagesTest() throws ApiException + { + String name = "PdfWithImages2.pdf"; + this.uploadFile(name); + + int pageNumber = 1; + String folder = this.tempFolder; + + ImagesResponse response = this.pdfApi.getImages(name, pageNumber, null, folder); + assertEquals(response.getCode(), HttpStatusCode.OK); + } + + + /** + * PostReplaceImage Test + * @throws ApiException + * if the Api call fails + */ + + @Test + public void postReplaceImageTest() throws ApiException + { + String name = "PdfWithImages2.pdf"; + this.uploadFile(name); + + String imageFileName = "Koala.jpg"; + this.uploadFile(imageFileName); + + int pageNumber = 1; + int imageNumber = 1; + String folder = this.tempFolder; + String imageFile = folder + '/' + imageFileName; + + ImageResponse response = this.pdfApi.postReplaceImage(name, pageNumber, imageNumber, imageFile, null, folder, null); + assertEquals(response.getCode(), HttpStatusCode.OK); + } + + /** + * GetImageWithFormat Test + * @throws ApiException + * if the Api call fails + */ + + @Test + public void getImageWithFormatTest() throws ApiException + { + String name = "PdfWithImages2.pdf"; + this.uploadFile(name); + + int pageNumber = 1; + int imageNumber = 1; + String folder = this.tempFolder; + + File response = this.pdfApi.getImage(name, pageNumber, imageNumber, "jpeg", 100, 100, null, folder); + assertNotNull(response); + } + + /** + * PostReplaceImageFromRequest Test + * @throws ApiException + * if the Api call fails + */ + + @Test + public void postReplaceImageFromRequestTest() throws ApiException + { + String name = "PdfWithImages2.pdf"; + this.uploadFile(name); + + String imageFileName = "Koala.jpg"; + File file = new File(testDataFolder + "/" + imageFileName); + + int pageNumber = 1; + int imageNumber = 1; + String folder = this.tempFolder; + String imageFile = folder + '/' + imageFileName; + + ImageResponse response = this.pdfApi.postReplaceImage(name, pageNumber, imageNumber, null, null, folder, file); + assertEquals(response.getCode(), HttpStatusCode.OK); + } + + // Links Tests + + /** + * GetPageLinkAnnotationByIndex Test + * @throws ApiException + * if the Api call fails + */ + + @Test + public void getPageLinkAnnotationByIndexTest() throws ApiException + { + String name = "PdfWithLinks.pdf"; + this.uploadFile(name); + + int pageNumber = 1; + int linkIndex = 1; + String folder = this.tempFolder; + + LinkAnnotationResponse response = this.pdfApi.getPageLinkAnnotationByIndex(name, pageNumber, linkIndex, null, folder); + assertEquals(response.getCode(), HttpStatusCode.OK); + } + + + /** + * GetPageLinkAnnotations Test + * @throws ApiException + * if the Api call fails + */ + + @Test + public void getPageLinkAnnotationsTest() throws ApiException + { + String name = "PdfWithLinks.pdf"; + this.uploadFile(name); + + int pageNumber = 1; + String folder = this.tempFolder; + + LinkAnnotationsResponse response = this.pdfApi.getPageLinkAnnotations(name, pageNumber, null, folder); + assertEquals(response.getCode(), HttpStatusCode.OK); + } + + + // Merge Tests + + /** + * PutMergeDocuments Test + * @throws ApiException + * if the Api call fails + */ + + @Test + public void putMergeDocumentsTest() throws ApiException + { + ArrayList nameList = new ArrayList(); + nameList.add("4pages.pdf"); + nameList.add("PdfWithImages2.pdf"); + nameList.add("marketing.pdf"); + + for (String name : nameList) + { + this.uploadFile(name); + } + + String resultName = "MergingResult.pdf"; + + MergeDocuments mergeDocuments = new MergeDocuments(); + + for(int i = 0; i < nameList.size(); i++) + { + nameList.set(i, this.tempFolder + '/' + nameList.get(i)); + } + + mergeDocuments.setList(nameList); + + String folder = this.tempFolder; + + DocumentResponse response = this.pdfApi.putMergeDocuments(resultName, mergeDocuments, null, folder); + assertEquals(response.getCode(), HttpStatusCode.OK); + } + + + + // Pages Tests + + /** + * DeletePage Test + * @throws ApiException + * if the Api call fails + */ + + @Test + public void deletePageTest() throws ApiException + { + String name = "4pages.pdf"; + this.uploadFile(name); + + int pageNumber = 1; + String folder = this.tempFolder; + + SaaSposeResponse response = this.pdfApi.deletePage(name, pageNumber, null, folder); + assertEquals(response.getCode(), HttpStatusCode.OK); + } + + + /** + * GetPage Test + * @throws ApiException + * if the Api call fails + */ + + @Test + public void getPageTest() throws ApiException + { + String name = "4pages.pdf"; + this.uploadFile(name); + + int pageNumber = 3; + String folder = this.tempFolder; + + File response = this.pdfApi.getPage(name, pageNumber, null, 0, 0, null, folder); + assertNotNull(response); + } + + /** + * GetPageWithFormat Test + * @throws ApiException + * if the Api call fails + */ + + @Test + public void getPageWithFormatTest() throws ApiException + { + String name = "4pages.pdf"; + this.uploadFile(name); + + int pageNumber = 3; + String folder = this.tempFolder; + + File response = this.pdfApi.getPage(name, pageNumber, "jpeg", 100, 100, null, folder); + assertNotNull(response); + } + + /** + * GetPages Test + * @throws ApiException + * if the Api call fails + */ + + @Test + public void getPagesTest() throws ApiException + { + String name = "4pages.pdf"; + this.uploadFile(name); + + String folder = this.tempFolder; + + DocumentPagesResponse response = this.pdfApi.getPages(name, null, folder); + assertEquals(response.getCode(), HttpStatusCode.OK); + } + + + /** + * GetWordsPerPage Test + * @throws ApiException + * if the Api call fails + */ + + @Test + public void getWordsPerPageTest() throws ApiException + { + String name = "4pages.pdf"; + this.uploadFile(name); + + String folder = this.tempFolder; + + WordCountResponse response = this.pdfApi.getWordsPerPage(name, null, folder); + assertEquals(response.getCode(), HttpStatusCode.OK); + } + + + /** + * PostMovePage Test + * @throws ApiException + * if the Api call fails + */ + + @Test + public void postMovePageTest() throws ApiException + { + String name = "4pages.pdf"; + this.uploadFile(name); + + String folder = this.tempFolder; + int pageNumber = 1; + int newIndex = 1; + + SaaSposeResponse response = this.pdfApi.postMovePage(name, pageNumber, newIndex, null, folder); + assertEquals(response.getCode(), HttpStatusCode.OK); + } + + + /** + * PutAddNewPage Test + * @throws ApiException + * if the Api call fails + */ + + @Test + public void putAddNewPageTest() throws ApiException + { + String name = "4pages.pdf"; + this.uploadFile(name); + + String folder = this.tempFolder; + + DocumentPagesResponse response = this.pdfApi.putAddNewPage(name, null, folder); + assertEquals(response.getCode(), HttpStatusCode.OK); + } + + + /** + * PutPageAddStamp Test + * @throws ApiException + * if the Api call fails + */ + + @Test + public void putPageAddStampTest() throws ApiException + { + String name = "4pages.pdf"; + this.uploadFile(name); + + String stampFileName = "Penguins.jpg"; + this.uploadFile(stampFileName); + + int pageNumber = 1; + String folder = this.tempFolder; + + + Stamp stamp = new Stamp(); + stamp.setType(StampType.IMAGE); + stamp.setFileName(folder + '/' + stampFileName); + stamp.setBackground(true); + stamp.setWidth(200.); + stamp.setHeight(200.); + stamp.setXindent(100.); + stamp.setYindent(100.); + + SaaSposeResponse response = this.pdfApi.putPageAddStamp(name, pageNumber, stamp, null, folder); + assertEquals(response.getCode(), HttpStatusCode.OK); + } + + + // Paragraphs Tests + + /** + * PutAddText Test + * @throws ApiException + * if the Api call fails + */ + + @Test + public void putAddTextTest() throws ApiException + { + String name = "4pages.pdf"; + this.uploadFile(name); + + int pageNumber = 1; + String folder = this.tempFolder; + + Rectangle rectangle = new Rectangle(); + rectangle.setX(100); + rectangle.setY(100); + rectangle.setWidth(200); + rectangle.setHeight(200); + + Color foregroundColor = new Color(); + foregroundColor.setA(0x00); + foregroundColor.setR(0x00); + foregroundColor.setG(0xFF); + foregroundColor.setB(0x00); + + Color backgroundColor = new Color(); + backgroundColor.setA(0x00); + backgroundColor.setR(0xFF); + backgroundColor.setG(0x00); + backgroundColor.setB(0x00); + + TextState textState = new TextState(); + textState.setFont("Arial"); + textState.setFontSize(10.); + textState.setForegroundColor(foregroundColor); + textState.setBackgroundColor(backgroundColor); + textState.setFontStyle(FontStyles.BOLD); + + final Segment segment = new Segment(); + segment.setValue("segment 1"); + segment.setTextState(textState); + + final TextLine textLine = new TextLine(); + textLine.setHorizontalAlignment(TextHorizontalAlignment.RIGHT); + textLine.setSegments(new ArrayList(){{ add(segment);}}); + + Paragraph paragraph = new Paragraph(); + paragraph.setRectangle(rectangle); + paragraph.setLeftMargin(10.); + paragraph.setRightMargin(10.); + paragraph.setTopMargin(20.); + paragraph.setBottomMargin(20.); + paragraph.setHorizontalAlignment(TextHorizontalAlignment.FULLJUSTIFY); + paragraph.setLineSpacing(LineSpacing.FONTSIZE); + paragraph.setRotation(10.); + paragraph.setSubsequentLinesIndent(20.); + paragraph.setVerticalAlignment(VerticalAlignment.CENTER); + paragraph.setWrapMode(WrapMode.BYWORDS); + paragraph.setLines(new ArrayList(){{ add(textLine);}}); + + + SaaSposeResponse response = this.pdfApi.putAddText(name, pageNumber, paragraph, folder); + assertEquals(response.getCode(), HttpStatusCode.OK); + } + + + // Properties Tests + + /** + * DeleteProperties Test + * @throws ApiException + * if the Api call fails + */ + + @Test + public void deletePropertiesTest() throws ApiException + { + String name = "PdfWithAcroForm.pdf"; + this.uploadFile(name); + + DocumentProperty property1 = new DocumentProperty(); + property1.setName("prop1"); + property1.setValue("val1"); + + String folder = this.tempFolder; + + DocumentProperty property2 = new DocumentProperty(); + property2.setName("prop2"); + property2.setValue("val2"); + + + this.pdfApi.putSetProperty(name, property1.getName(), property1, null, folder); + this.pdfApi.putSetProperty(name, property2.getName(), property2, null, folder); + + SaaSposeResponse response = this.pdfApi.deleteProperties(name, null, folder); + assertEquals(response.getCode(), HttpStatusCode.OK); + } + + + /** + * DeleteProperty Test + * @throws ApiException + * if the Api call fails + */ + + @Test + public void deletePropertyTest() throws ApiException + { + String name = "PdfWithAcroForm.pdf"; + this.uploadFile(name); + + DocumentProperty property1 = new DocumentProperty(); + property1.setName("prop1"); + property1.setValue("val1"); + + String folder = this.tempFolder; + + this.pdfApi.putSetProperty(name, property1.getName(), property1, null, folder); + + SaaSposeResponse response = this.pdfApi.deleteProperty(name, property1.getName(), null, folder); + assertEquals(response.getCode(), HttpStatusCode.OK); + } + + + /** + * GetDocumentProperties Test + * @throws ApiException + * if the Api call fails + */ + + @Test + public void getDocumentPropertiesTest() throws ApiException + { + String name = "PdfWithAcroForm.pdf"; + this.uploadFile(name); + + DocumentProperty property1 = new DocumentProperty(); + property1.setName("prop1"); + property1.setValue("val1"); + + String folder = this.tempFolder; + + DocumentProperty property2 = new DocumentProperty(); + property2.setName("prop2"); + property2.setValue("val2"); + + this.pdfApi.putSetProperty(name, property1.getName(), property1, null, folder); + this.pdfApi.putSetProperty(name, property2.getName(), property2, null, folder); + + DocumentPropertiesResponse response = this.pdfApi.getDocumentProperties(name, null, folder); + assertEquals(response.getCode(), HttpStatusCode.OK); + } + + + /** + * GetDocumentProperty Test + * @throws ApiException + * if the Api call fails + */ + + @Test + public void getDocumentPropertyTest() throws ApiException + { + String name = "PdfWithAcroForm.pdf"; + this.uploadFile(name); + + DocumentProperty property1 = new DocumentProperty(); + property1.setName("prop1"); + property1.setValue("val1"); + + String folder = this.tempFolder; + + this.pdfApi.putSetProperty(name, property1.getName(), property1, null, folder); + + DocumentPropertyResponse response = this.pdfApi.getDocumentProperty(name, property1.getName(), null, folder); + assertEquals(response.getCode(), HttpStatusCode.OK); + } + + + /** + * PutSetProperty Test + * @throws ApiException + * if the Api call fails + */ + + @Test + public void putSetPropertyTest() throws ApiException + { + String name = "PdfWithAcroForm.pdf"; + this.uploadFile(name); + + DocumentProperty property1 = new DocumentProperty(); + property1.setName("prop1"); + property1.setValue("val1"); + + String folder = this.tempFolder; + + DocumentPropertyResponse response = this.pdfApi.putSetProperty(name, property1.getName(), property1, null, folder); + assertEquals(response.getCode(), HttpStatusCode.OK); + } + + + + // Sign Tests + + /** + * PostSignDocument Test + * @throws ApiException + * if the Api call fails + */ + + @Test + public void postSignDocumentTest() throws ApiException + { + String name = "BlankWithSignature.pdf"; + this.uploadFile(name); + + String signatureFileName = "test1234.pfx"; + this.uploadFile(signatureFileName); + + Rectangle rectangle = new Rectangle(); + rectangle.setX(100); + rectangle.setY(100); + rectangle.setWidth(400); + rectangle.setHeight(100); + + String folder = this.tempFolder; + + Signature signature = new Signature(); + signature.setAuthority("Sergey Smal"); + signature.setContact("test@mail.ru"); + signature.setDate("08/01/2012 12:15:00.000 PM"); + signature.setFormFieldName("Signature1"); + signature.setLocation("Ukraine"); + signature.setPassword("test1234"); + signature.setRectangle(rectangle); + signature.setSignaturePath(folder + '/' + signatureFileName); + signature.setSignatureType(SignatureType.PKCS_7); + signature.setVisible(true); + + SaaSposeResponse response = this.pdfApi.postSignDocument(name, signature, null, folder); + assertEquals(response.getCode(), HttpStatusCode.OK); + } + + + /** + * PostSignPage Test + * @throws ApiException + * if the Api call fails + */ + + @Test + public void postSignPageTest() throws ApiException + { + String name = "BlankWithSignature.pdf"; + this.uploadFile(name); + + String signatureFileName = "test1234.pfx"; + this.uploadFile(signatureFileName); + + int pageNumber = 1; + + Rectangle rectangle = new Rectangle(); + rectangle.setX(100); + rectangle.setY(100); + rectangle.setWidth(400); + rectangle.setHeight(100); + + String folder = this.tempFolder; + + Signature signature = new Signature(); + signature.setAuthority("Sergey Smal"); + signature.setContact("test@mail.ru"); + signature.setDate("08/01/2012 12:15:00.000 PM"); + signature.setFormFieldName("Signature1"); + signature.setLocation("Ukraine"); + signature.setPassword("test1234"); + signature.setRectangle(rectangle); + signature.setSignaturePath(folder + '/' + signatureFileName); + signature.setSignatureType(SignatureType.PKCS_7); + signature.setVisible(true); + + SaaSposeResponse response = this.pdfApi.postSignPage(name, pageNumber, signature, null, folder); + assertEquals(response.getCode(), HttpStatusCode.OK); + } + + + /** + * GetVerifySignature Test + * @throws ApiException + * if the Api call fails + */ + + @Test + public void getVerifySignatureTest() throws ApiException + { + String name = "BlankWithSignature.pdf"; + this.uploadFile(name); + + String signatureFileName = "test1234.pfx"; + this.uploadFile(signatureFileName); + + Rectangle rectangle = new Rectangle(); + rectangle.setX(100); + rectangle.setY(100); + rectangle.setWidth(400); + rectangle.setHeight(100); + + String folder = this.tempFolder; + + Signature signature = new Signature(); + signature.setAuthority("Sergey Smal"); + signature.setContact("test@mail.ru"); + signature.setDate("08/01/2012 12:15:00.000 PM"); + signature.setFormFieldName("Signature1"); + signature.setLocation("Ukraine"); + signature.setPassword("test1234"); + signature.setRectangle(rectangle); + signature.setSignaturePath(folder + '/' + signatureFileName); + signature.setSignatureType(SignatureType.PKCS_7); + signature.setVisible(true); + + SaaSposeResponse responseSign = this.pdfApi.postSignDocument(name, signature, null, folder); + assertEquals(responseSign.getCode(), HttpStatusCode.OK); + + SignatureVerifyResponse response = this.pdfApi.getVerifySignature(name, signature.getFormFieldName(), folder); + assertEquals(response.getCode(), HttpStatusCode.OK); + } + + // Text Items Tests + + /** + * GetPageTextItems Test + * @throws ApiException + * if the Api call fails + */ + + @Test + public void getPageTextItemsTest() throws ApiException + { + String name = "4pages.pdf"; + this.uploadFile(name); + + int pageNumber = 1; + String folder = this.tempFolder; + + TextItemsResponse response = this.pdfApi.getPageTextItems(name, pageNumber, null, null, folder); + assertEquals(response.getCode(), HttpStatusCode.OK); + } + + /** + * GetTextItems Test + * @throws ApiException + * if the Api call fails + */ + + @Test + public void getTextItemsTest() throws ApiException + { + String name = "4pages.pdf"; + this.uploadFile(name); + + String folder = this.tempFolder; + + TextItemsResponse response = this.pdfApi.getTextItems(name, null, null, folder); + assertEquals(response.getCode(), HttpStatusCode.OK); + } + + + // Text Replace Tests + + /** + * PostDocumentReplaceText Test + * @throws ApiException + * if the Api call fails + */ + + @Test + public void postDocumentReplaceTextTest() throws ApiException + { + String name = "4pages.pdf"; + this.uploadFile(name); + + TextReplaceRequest textReplaceRequest = new TextReplaceRequest(); + textReplaceRequest.setOldValue("Page"); + textReplaceRequest.setNewValue("p_a_g_e"); + textReplaceRequest.setRegex(false); + + String folder = this.tempFolder; + + DocumentTextReplaceResponse response = this.pdfApi.postDocumentReplaceText(name, textReplaceRequest, null, folder); + assertEquals(response.getCode(), HttpStatusCode.OK); + } + + + /** + * PostDocumentReplaceTextList Test + * @throws ApiException + * if the Api call fails + */ + + @Test + public void postDocumentReplaceTextListTest() throws ApiException + { + String name = "4pages.pdf"; + this.uploadFile(name); + + final TextReplaceRequest textReplaceRequest1 = new TextReplaceRequest(); + textReplaceRequest1.setOldValue("First"); + textReplaceRequest1.setNewValue("1"); + textReplaceRequest1.setRegex(false); + + final TextReplaceRequest textReplaceRequest2 = new TextReplaceRequest(); + textReplaceRequest2.setOldValue("Page"); + textReplaceRequest2.setNewValue("p_a_g_e"); + textReplaceRequest2.setRegex(false); + + TextReplaceListRequest textReplaceListRequest = new TextReplaceListRequest(); + textReplaceListRequest.setTextReplaces(new ArrayList() + {{ add(textReplaceRequest1); add(textReplaceRequest2);}}); + + String folder = this.tempFolder; + + DocumentTextReplaceResponse response = this.pdfApi.postDocumentReplaceTextList(name, textReplaceListRequest, null, folder); + assertEquals(response.getCode(), HttpStatusCode.OK); + } + + + /** + * PostPageReplaceText Test + * @throws ApiException + * if the Api call fails + */ + + @Test + public void postPageReplaceTextTest() throws ApiException + { + String name = "4pages.pdf"; + this.uploadFile(name); + + int pageNumber = 1; + + TextReplaceRequest textReplaceRequest = new TextReplaceRequest(); + textReplaceRequest.setOldValue("Page"); + textReplaceRequest.setNewValue("p_a_g_e"); + textReplaceRequest.setRegex(false); + + String folder = this.tempFolder; + + PageTextReplaceResponse response = this.pdfApi.postPageReplaceText(name, pageNumber, textReplaceRequest, null, folder); + assertEquals(response.getCode(), HttpStatusCode.OK); + } + + + /** + * PostPageReplaceTextList Test + * @throws ApiException + * if the Api call fails + */ + + @Test + public void postPageReplaceTextListTest() throws ApiException + { + String name = "4pages.pdf"; + this.uploadFile(name); + + int pageNumber = 1; + + final TextReplaceRequest textReplaceRequest1 = new TextReplaceRequest(); + textReplaceRequest1.setOldValue("First"); + textReplaceRequest1.setNewValue("1"); + textReplaceRequest1.setRegex(false); + + final TextReplaceRequest textReplaceRequest2 = new TextReplaceRequest(); + textReplaceRequest2.setOldValue("Page"); + textReplaceRequest2.setNewValue("p_a_g_e"); + textReplaceRequest2.setRegex(false); + + TextReplaceListRequest textReplaceListRequest = new TextReplaceListRequest(); + textReplaceListRequest.setTextReplaces(new ArrayList() + {{ add(textReplaceRequest1); add(textReplaceRequest2);}}); + + String folder = this.tempFolder; + + PageTextReplaceResponse response = this.pdfApi.postPageReplaceTextList(name, pageNumber, textReplaceListRequest, null, folder); + assertEquals(response.getCode(), HttpStatusCode.OK); + } + + + // OCR Tests + + /** + * PutSearchableDocument Test + * @throws ApiException + * if the Api call fails + */ + + @Test + public void putSearchableDocumentTest() throws ApiException + { + String name = "rusdoc.pdf"; + this.uploadFile(name); + + String lang = "rus,eng"; + String folder = this.tempFolder; + + SaaSposeResponse response = this.pdfApi.putSearchableDocument(name, null, folder, lang); + assertEquals(response.getCode(), HttpStatusCode.OK); + } + + /** + * PutSearchableDocumentWithDefaultLang Test + * @throws ApiException + * if the Api call fails + */ + + @Test + public void putSearchableDocumentWithDefaultLangTest() throws ApiException + { + String name = "rusdoc.pdf"; + this.uploadFile(name); + + String folder = this.tempFolder; + + SaaSposeResponse response = this.pdfApi.putSearchableDocument(name, null, folder, null); + assertEquals(response.getCode(), HttpStatusCode.OK); + } + + + // Text Tests + + /** + * GetText Test + * @throws ApiException + * if the Api call fails + */ + + @Test + public void getTextTest() throws ApiException + { + String name = "4pages.pdf"; + this.uploadFile(name); + + int x = 0; + int y = 0; + int width = 0; + int height = 0; + String folder = this.tempFolder; + + TextRectsResponse response = this.pdfApi.getText(name, x, y, width, height, null, null, null, folder); + assertEquals(response.getCode(), HttpStatusCode.OK); + } + + + /** + * GetPageTextByTwoTextOnPage Test + * @throws ApiException + * if the Api call fails + */ + + @Test + public void getPageTextByTwoTextOnPageTest() throws ApiException + { + String name = "4pages.pdf"; + this.uploadFile(name); + + int pageNumber = 1; + int x = 0; + int y = 0; + int width = 0; + int height = 0; + + List format = new ArrayList(){{ add("First Page"); add("Second Page");}}; + String folder = this.tempFolder; + + TextRectsResponse response = this.pdfApi.getPageText(name, pageNumber, x, y, width, height, format, null, null, folder); + assertEquals(response.getCode(), HttpStatusCode.OK); + } + + + // Text Replace Tests + + /** + * PostDocumentTextReplaceWholeDocByRect Test + * @throws ApiException + * if the Api call fails + */ + + @Test + public void postDocumentTextReplaceWholeDocByRectTest() throws ApiException + { + String name = "4pages.pdf"; + this.uploadFile(name); + + Rectangle rect = new Rectangle(); + rect.setX(100); + rect.setY(700); + rect.setWidth(300); + rect.setHeight(300); + + final TextReplace textReplace = new TextReplace(); + textReplace.setOldValue("Page"); + textReplace.setNewValue("p_a_g_e"); + textReplace.setRect(rect); + + TextReplaceListRequest textReplaceList = new TextReplaceListRequest(); + textReplaceList.setTextReplaces(new ArrayList(){{ add(textReplace); }}); + textReplaceList.setStartIndex(0); + textReplaceList.setCountReplace(0); + + String folder = this.tempFolder; + + TextReplaceResponse response = this.pdfApi.postDocumentTextReplace(name, textReplaceList, null, folder); + assertEquals(response.getCode(), HttpStatusCode.OK); + } + + + /** + * PostPageTextReplaceByRect Test + * @throws ApiException + * if the Api call fails + */ + + @Test + public void postPageTextReplaceByRectTest() throws ApiException + { + String name = "4pages.pdf"; + this.uploadFile(name); + int pageNumber = 1; + + Rectangle rect = new Rectangle(); + rect.setX(100); + rect.setY(700); + rect.setWidth(300); + rect.setHeight(300); + + final TextReplace textReplace = new TextReplace(); + textReplace.setOldValue("Page"); + textReplace.setNewValue("p_a_g_e"); + textReplace.setRect(rect); + + TextReplaceListRequest textReplaceList = new TextReplaceListRequest(); + textReplaceList.setTextReplaces(new ArrayList(){{ add(textReplace); }}); + textReplaceList.setStartIndex(0); + textReplaceList.setCountReplace(0); + + String folder = this.tempFolder; + + TextReplaceResponse response = this.pdfApi.postPageTextReplace(name, pageNumber, textReplaceList, null, folder); + assertEquals(response.getCode(), HttpStatusCode.OK); + } + + + // Convert Tests + + /** + * GetPdfInStorageToDoc Test + * @throws ApiException + * if the Api call fails + */ + + @Test + public void getPdfInStorageToDocTest() throws ApiException + { + String name = "4pages.pdf"; + this.uploadFile(name); + String folder = this.tempFolder; + + File response = this.pdfApi.getPdfInStorageToDoc(name, null, null, null, null, null, null, null, null, folder); + assertNotNull(response); + } + + /** + * PutPdfInStorageToDoc Test + * @throws ApiException + * if the Api call fails + */ + + @Test + public void putPdfInStorageToDocTest() throws ApiException + { + String name = "4pages.pdf"; + this.uploadFile(name); + String folder = this.tempFolder; + String resFileName = "result.doc"; + + SaaSposeResponse response = this.pdfApi.putPdfInStorageToDoc(name, this.tempFolder + '/' + resFileName, null, null, null, null, null, null, null, null, folder); + assertEquals(response.getCode(), HttpStatusCode.CREATED); + } + + /** + * PutPdfInRequestToDoc Test + * @throws ApiException + * if the Api call fails + */ + + @Test + public void putPdfInRequestToDocTest() throws ApiException + { + String name = "4pages.pdf"; + File file = new File(testDataFolder + "/" + name); + String resFileName = "result.doc"; + + SaaSposeResponse response = this.pdfApi.putPdfInRequestToDoc(this.tempFolder + '/' + resFileName, null, null, null, null, null, null, null, null, file); + assertEquals(response.getCode(), HttpStatusCode.CREATED); + } + + /** + * GetPdfInStorageToPdfA Test + * @throws ApiException + * if the Api call fails + */ + + @Test + public void getPdfInStorageToPdfATest() throws ApiException + { + String name = "4pages.pdf"; + this.uploadFile(name); + + String type = PdfAType.PDFA1A.toString(); + String folder = this.tempFolder; + + + File response = this.pdfApi.getPdfInStorageToPdfA(name, type, folder); + assertNotNull(response); + } + + /** + * PutPdfInStorageToPdfA Test + * @throws ApiException + * if the Api call fails + */ + + @Test + public void putPdfInStorageToPdfATest() throws ApiException + { + String name = "4pages.pdf"; + this.uploadFile(name); + + String type = PdfAType.PDFA1A.toString(); + String folder = this.tempFolder; + String resFileName = "result.pdf"; + + SaaSposeResponse response = this.pdfApi.putPdfInStorageToPdfA(name, this.tempFolder + '/' + resFileName, type, folder); + assertEquals(response.getCode(), HttpStatusCode.CREATED); + } + + /** + * PutPdfInRequestToPdfA Test + * @throws ApiException + * if the Api call fails + */ + + @Test + public void putPdfInRequestToPdfATest() throws ApiException + { + String name = "4pages.pdf"; + File file = new File(testDataFolder + "/" + name); + String type = PdfAType.PDFA1A.toString(); + String resFileName = "result.pdf"; + + SaaSposeResponse response = this.pdfApi.putPdfInRequestToPdfA(this.tempFolder + '/' + resFileName, type, file); + assertEquals(response.getCode(), HttpStatusCode.CREATED); + } + + /** + * GetPdfInStorageToTiff Test + * @throws ApiException + * if the Api call fails + */ + + @Test + public void getPdfInStorageToTiffTest() throws ApiException + { + String name = "4pages.pdf"; + this.uploadFile(name); + + String folder = this.tempFolder; + + + File response = this.pdfApi.getPdfInStorageToTiff(name, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, folder); + assertNotNull(response); + } + + /** + * PutPdfInStorageToTiff Test + * @throws ApiException + * if the Api call fails + */ + + @Test + public void putPdfInStorageToTiffTest() throws ApiException + { + String name = "4pages.pdf"; + this.uploadFile(name); + + String folder = this.tempFolder; + String resFileName = "result.tiff"; + + SaaSposeResponse response = this.pdfApi.putPdfInStorageToTiff(name, this.tempFolder + '/' + resFileName, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, folder); + assertEquals(response.getCode(), HttpStatusCode.CREATED); + } + + /** + * PutPdfInRequestToTiff Test + * @throws ApiException + * if the Api call fails + */ + + @Test + public void putPdfInRequestToTiffTest() throws ApiException + { + String name = "4pages.pdf"; + File file = new File(testDataFolder + "/" + name); + String resFileName = "result.tiff"; + + SaaSposeResponse response = this.pdfApi.putPdfInRequestToTiff(this.tempFolder + '/' + resFileName, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, file); + assertEquals(response.getCode(), HttpStatusCode.CREATED); + } + + /** + * GetPdfInStorageToSvg Test + * @throws ApiException + * if the Api call fails + */ + + @Test + public void getPdfInStorageToSvgTest() throws ApiException + { + String name = "4pages.pdf"; + this.uploadFile(name); + + String folder = this.tempFolder; + + + File response = this.pdfApi.getPdfInStorageToSvg(name, null, folder); + assertNotNull(response); + } + + /** + * PutPdfInStorageToSvg Test + * @throws ApiException + * if the Api call fails + */ + + @Test + public void putPdfInStorageToSvgTest() throws ApiException + { + String name = "4pages.pdf"; + this.uploadFile(name); + + String folder = this.tempFolder; + String resFileName = "result.svg"; + + SaaSposeResponse response = this.pdfApi.putPdfInStorageToSvg(name, this.tempFolder + '/' + resFileName, null, folder); + assertEquals(response.getCode(), HttpStatusCode.CREATED); + } + + /** + * PutPdfInRequestToSvg Test + * @throws ApiException + * if the Api call fails + */ + + @Test + public void putPdfInRequestToSvgTest() throws ApiException + { + String name = "4pages.pdf"; + File file = new File(testDataFolder + "/" + name); + String resFileName = "result.svg"; + + SaaSposeResponse response = this.pdfApi.putPdfInRequestToSvg(this.tempFolder + '/' + resFileName, null, file); + assertEquals(response.getCode(), HttpStatusCode.CREATED); + } + + /** + * GetPdfInStorageToXps Test + * @throws ApiException + * if the Api call fails + */ + + @Test + public void getPdfInStorageToXpsTest() throws ApiException + { + String name = "4pages.pdf"; + this.uploadFile(name); + + String folder = this.tempFolder; + + + File response = this.pdfApi.getPdfInStorageToXps(name, folder); + assertNotNull(response); + } + + /** + * PutPdfInStorageToXps Test + * @throws ApiException + * if the Api call fails + */ + + @Test + public void putPdfInStorageToXpsTest() throws ApiException + { + String name = "4pages.pdf"; + this.uploadFile(name); + + String folder = this.tempFolder; + String resFileName = "result.xps"; + + SaaSposeResponse response = this.pdfApi.putPdfInStorageToXps(name, this.tempFolder + '/' + resFileName, folder); + assertEquals(response.getCode(), HttpStatusCode.CREATED); + } + + /** + * PutPdfInRequestToXps Test + * @throws ApiException + * if the Api call fails + */ + + @Test + public void putPdfInRequestToXpsTest() throws ApiException + { + String name = "4pages.pdf"; + File file = new File(testDataFolder + "/" + name); + String resFileName = "result.xps"; + + SaaSposeResponse response = this.pdfApi.putPdfInRequestToXps(this.tempFolder + '/' + resFileName, file); + assertEquals(response.getCode(), HttpStatusCode.CREATED); + } + + /** + * GetPdfInStorageToXls Test + * @throws ApiException + * if the Api call fails + */ + + @Test + public void getPdfInStorageToXlsTest() throws ApiException + { + String name = "4pages.pdf"; + this.uploadFile(name); + + String folder = this.tempFolder; + + + File response = this.pdfApi.getPdfInStorageToXls(name, null, null, null, null, folder); + assertNotNull(response); + } + + /** + * PutPdfInStorageToXls Test + * @throws ApiException + * if the Api call fails + */ + + @Test + public void putPdfInStorageToXlsTest() throws ApiException + { + String name = "4pages.pdf"; + this.uploadFile(name); + + String folder = this.tempFolder; + String resFileName = "result.xls"; + + SaaSposeResponse response = this.pdfApi.putPdfInStorageToXls(name, this.tempFolder + '/' + resFileName, null, null, null, null, folder); + assertEquals(response.getCode(), HttpStatusCode.CREATED); + } + + /** + * PutPdfInRequestToXls Test + * @throws ApiException + * if the Api call fails + */ + + @Test + public void putPdfInRequestToXlsTest() throws ApiException + { + String name = "4pages.pdf"; + File file = new File(testDataFolder + "/" + name); + String resFileName = "result.xls"; + + SaaSposeResponse response = this.pdfApi.putPdfInRequestToXls(this.tempFolder + '/' + resFileName, null, null, null, null, file); + assertEquals(response.getCode(), HttpStatusCode.CREATED); + } + + + /** + * GetPdfInStorageToHtml Test + * @throws ApiException + * if the Api call fails + */ + + @Test + public void getPdfInStorageToHtmlTest() throws ApiException + { + String name = "4pages.pdf"; + this.uploadFile(name); + + String folder = this.tempFolder; + + + File response = this.pdfApi.getPdfInStorageToHtml(name, null, null, null, null, null, null, null, null, + null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, folder); + assertNotNull(response); + } + + /** + * PutPdfInStorageToHtml Test + * @throws ApiException + * if the Api call fails + */ + + @Test + public void putPdfInStorageToHtmlTest() throws ApiException + { + String name = "4pages.pdf"; + this.uploadFile(name); + + String folder = this.tempFolder; + String resFileName = "result.html"; + + SaaSposeResponse response = this.pdfApi.putPdfInStorageToHtml( + name, + this.tempFolder + '/' + resFileName, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + folder); + assertEquals(response.getCode(), HttpStatusCode.CREATED); + } + + /** + * PutPdfInRequestToHtml Test + * @throws ApiException + * if the Api call fails + */ + + @Test + public void putPdfInRequestToHtmlTest() throws ApiException + { + String name = "4pages.pdf"; + File file = new File(testDataFolder + "/" + name); + String resFileName = "result.html"; + + SaaSposeResponse response = this.pdfApi.putPdfInRequestToHtml( + this.tempFolder + '/' + resFileName, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + file); + assertEquals(response.getCode(), HttpStatusCode.CREATED); + } + + /** + * GetPdfInStorageToEpub Test + * @throws ApiException + * if the Api call fails + */ + + @Test + public void getPdfInStorageToEpubTest() throws ApiException + { + String name = "4pages.pdf"; + this.uploadFile(name); + + String folder = this.tempFolder; + + + File response = this.pdfApi.getPdfInStorageToEpub(name, null, folder); + assertNotNull(response); + } + + /** + * PutPdfInStorageToEpub Test + * @throws ApiException + * if the Api call fails + */ + + @Test + public void putPdfInStorageToEpubTest() throws ApiException + { + String name = "4pages.pdf"; + this.uploadFile(name); + + String folder = this.tempFolder; + String resFileName = "result.epub"; + + SaaSposeResponse response = this.pdfApi.putPdfInStorageToEpub(name, this.tempFolder + '/' + resFileName, null, folder); + assertEquals(response.getCode(), HttpStatusCode.CREATED); + } + + /** + * PutPdfInRequestToEpub Test + * @throws ApiException + * if the Api call fails + */ + + @Test + public void putPdfInRequestToEpubTest() throws ApiException + { + String name = "4pages.pdf"; + File file = new File(testDataFolder + "/" + name); + String resFileName = "result.epub"; + + SaaSposeResponse response = this.pdfApi.putPdfInRequestToEpub(this.tempFolder + '/' + resFileName, null, file); + assertEquals(response.getCode(), HttpStatusCode.CREATED); + } + + + /** + * GetPdfInStorageToPptx Test + * @throws ApiException + * if the Api call fails + */ + + @Test + public void getPdfInStorageToPptxTest() throws ApiException + { + String name = "4pages.pdf"; + this.uploadFile(name); + + String folder = this.tempFolder; + + + File response = this.pdfApi.getPdfInStorageToPptx(name, null, null, folder); + assertNotNull(response); + } + + /** + * PutPdfInStorageToPptx Test + * @throws ApiException + * if the Api call fails + */ + + @Test + public void putPdfInStorageToPptxTest() throws ApiException + { + String name = "4pages.pdf"; + this.uploadFile(name); + + String folder = this.tempFolder; + String resFileName = "result.pptx"; + + SaaSposeResponse response = this.pdfApi.putPdfInStorageToPptx(name, this.tempFolder + '/' + resFileName, null, null, folder); + assertEquals(response.getCode(), HttpStatusCode.CREATED); + } + + /** + * PutPdfInRequestToPptx Test + * @throws ApiException + * if the Api call fails + */ + + @Test + public void putPdfInRequestToPptxTest() throws ApiException + { + String name = "4pages.pdf"; + File file = new File(testDataFolder + "/" + name); + String resFileName = "result.pptx"; + + SaaSposeResponse response = this.pdfApi.putPdfInRequestToPptx(this.tempFolder + '/' + resFileName, null, null, file); + assertEquals(response.getCode(), HttpStatusCode.CREATED); + } + + + /** + * GetPdfInStorageToLaTeX Test + * @throws ApiException + * if the Api call fails + */ + + @Test + public void getPdfInStorageToLaTeXTest() throws ApiException + { + String name = "4pages.pdf"; + this.uploadFile(name); + + String folder = this.tempFolder; + + + File response = this.pdfApi.getPdfInStorageToLaTeX(name, null, folder); + assertNotNull(response); + } + + /** + * PutPdfInStorageToLaTeX Test + * @throws ApiException + * if the Api call fails + */ + + @Test + public void putPdfInStorageToLaTeXTest() throws ApiException + { + String name = "4pages.pdf"; + this.uploadFile(name); + + String folder = this.tempFolder; + String resFileName = "result.latex"; + + SaaSposeResponse response = this.pdfApi.putPdfInStorageToLaTeX(name, this.tempFolder + '/' + resFileName, null, folder); + assertEquals(response.getCode(), HttpStatusCode.CREATED); + } + + /** + * PutPdfInRequestToLaTeX Test + * @throws ApiException + * if the Api call fails + */ + + @Test + public void putPdfInRequestToLaTeXTest() throws ApiException + { + String name = "4pages.pdf"; + File file = new File(testDataFolder + "/" + name); + String resFileName = "result.latex"; + + SaaSposeResponse response = this.pdfApi.putPdfInRequestToLaTeX(this.tempFolder + '/' + resFileName, null, file); + assertEquals(response.getCode(), HttpStatusCode.CREATED); + } + + + /** + * GetPdfInStorageToMobiXml Test + * @throws ApiException + * if the Api call fails + */ + + @Test + public void getPdfInStorageToMobiXmlTest() throws ApiException + { + String name = "4pages.pdf"; + this.uploadFile(name); + + String folder = this.tempFolder; + + + File response = this.pdfApi.getPdfInStorageToMobiXml(name, folder); + assertNotNull(response); + } + + + /** + * PutPdfInStorageToMobiXml Test + * @throws ApiException + * if the Api call fails + */ + + @Test + public void putPdfInStorageToMobiXmlTest() throws ApiException + { + String name = "4pages.pdf"; + this.uploadFile(name); + + String folder = this.tempFolder; + String resFileName = "result.mobi"; + + SaaSposeResponse response = this.pdfApi.putPdfInStorageToMobiXml(name, this.tempFolder + '/' + resFileName, folder); + assertEquals(response.getCode(), HttpStatusCode.CREATED); + } + + + /** + * PutPdfInRequestToMobiXml Test + * @throws ApiException + * if the Api call fails + */ + + @Test + public void putPdfInRequestToMobiXmlTest() throws ApiException + { + String name = "4pages.pdf"; + File file = new File(testDataFolder + "/" + name); + String resFileName = "result.mobi"; + + SaaSposeResponse response = this.pdfApi.putPdfInRequestToMobiXml(this.tempFolder + '/' + resFileName, file); + assertEquals(response.getCode(), HttpStatusCode.CREATED); + } + + + /** + * GetXfaPdfInStorageToAcroForm Test + * @throws ApiException + * if the Api call fails + */ + + @Test + public void getXfaPdfInStorageToAcroFormTest() throws ApiException + { + String name = "PdfWithXfaForm.pdf"; + this.uploadFile(name); + + String folder = this.tempFolder; + + + File response = this.pdfApi.getXfaPdfInStorageToAcroForm(name, folder); + assertNotNull(response); + } + + /** + * PutXfaPdfInStorageToAcroForm Test + * @throws ApiException + * if the Api call fails + */ + + @Test + public void putXfaPdfInStorageToAcroFormTest() throws ApiException + { + String name = "PdfWithXfaForm.pdf"; + this.uploadFile(name); + + String folder = this.tempFolder; + String resFileName = "result.pdf"; + + SaaSposeResponse response = this.pdfApi.putXfaPdfInStorageToAcroForm(name, this.tempFolder + '/' + resFileName, folder); + assertEquals(response.getCode(), HttpStatusCode.CREATED); + } + + /** + * PutXfaPdfInRequestToAcroForm Test + * @throws ApiException + * if the Api call fails + */ + + @Test + public void putXfaPdfInRequestToAcroFormTest() throws ApiException + { + String name = "PdfWithXfaForm.pdf"; + File file = new File(testDataFolder + "/" + name); + String resFileName = "result.pdf"; + + SaaSposeResponse response = this.pdfApi.putXfaPdfInRequestToAcroForm(this.tempFolder + '/' + resFileName, file); + assertEquals(response.getCode(), HttpStatusCode.CREATED); + } + + + /** + * GetPdfInStorageToXml Test + * @throws ApiException + * if the Api call fails + */ + + @Test + public void getPdfInStorageToXmlTest() throws ApiException + { + String name = "4pages.pdf"; + this.uploadFile(name); + + String folder = this.tempFolder; + + + File response = this.pdfApi.getPdfInStorageToXml(name, folder); + assertNotNull(response); + } + + /** + * PutPdfInStorageToXml Test + * @throws ApiException + * if the Api call fails + */ + + @Test + public void putPdfInStorageToXmlTest() throws ApiException + { + String name = "4pages.pdf"; + this.uploadFile(name); + + String folder = this.tempFolder; + String resFileName = "result.xml"; + + SaaSposeResponse response = this.pdfApi.putPdfInStorageToXml(name, this.tempFolder + '/' + resFileName, folder); + assertEquals(response.getCode(), HttpStatusCode.CREATED); + } + + /** + * PutPdfInRequestToXml Test + * @throws ApiException + * if the Api call fails + */ + + @Test + public void putPdfInRequestToXmlTest() throws ApiException + { + String name = "4pages.pdf"; + File file = new File(testDataFolder + "/" + name); + String resFileName = "result.xml"; + + SaaSposeResponse response = this.pdfApi.putPdfInRequestToXml(this.tempFolder + '/' + resFileName, file); + assertEquals(response.getCode(), HttpStatusCode.CREATED); + } + + + // Upload/Download Tests + /** + * UploadFile Test + * @throws ApiException + * if the Api call fails + */ + + @Test + public void uploadFileTest() throws ApiException + { + String name = "4pages.pdf"; + String path = this.tempFolder + '/' + name; + File file = new File(testDataFolder + "/" + name); + SaaSposeResponse response = this.pdfApi.putCreate(path, file, null, null); + assertEquals(response.getCode(), HttpStatusCode.OK); + } + + /** + * GetDownload Test + * @throws ApiException + * if the Api call fails + */ + + @Test + public void getDownloadTest() throws ApiException + { + String name = "4pages.pdf"; + this.uploadFile(name); + + String path = this.tempFolder + '/' + name; + + File response = this.pdfApi.getDownload(path, null, null); + assertNotNull(response); + } + + + // Privileges Tests + + /** + * PutPrivileges Test + * @throws ApiException + * if the Api call fails + */ + + @Test + public void putPrivilegesTest() throws ApiException + { + String name = "4pages.pdf"; + this.uploadFile(name); + + DocumentPrivilege documentPrivilege = new DocumentPrivilege(); + documentPrivilege.setAllowCopy(false); + documentPrivilege.setAllowPrint(false); + + String folder = this.tempFolder; + + SaaSposeResponse response = this.pdfApi.putPrivileges(name, documentPrivilege, folder); + assertEquals(response.getCode(), HttpStatusCode.OK); + } + + // Convert To PDF Tests + + /** + * GetEpubInStorageToPdf Test + * @throws ApiException + * if the Api call fails + */ + + @Test + public void getEpubInStorageToPdfTest() throws ApiException + { + String name = "4pages.epub"; + this.uploadFile(name); + + + String srcPath = this.tempFolder + '/' + name; + + File response = this.pdfApi.getEpubInStorageToPdf(srcPath); + assertNotNull(response); + } + + + /** + * PutEpubInStorageToPdf Test + * @throws ApiException + * if the Api call fails + */ + + @Test + public void putEpubInStorageToPdfTest() throws ApiException + { + String name = "4pages.epub"; + this.uploadFile(name); + + + String srcPath = this.tempFolder + '/' + name; + String resultName = "fromEpub.pdf"; + + SaaSposeResponse response = this.pdfApi.putEpubInStorageToPdf(resultName, srcPath, this.tempFolder); + assertEquals(response.getCode(), HttpStatusCode.CREATED); + } + + /** + * GetWebInStorageToPdf Test + * @throws ApiException + * if the Api call fails + */ + + @Test + public void getWebInStorageToPdfTest() throws ApiException + { + String sourceUrl = "http://google.com"; + + File response = this.pdfApi.getWebInStorageToPdf(sourceUrl, null, null , null, + null, null, null, null); + assertNotNull(response); + } + + + /** + * PutWebInStorageToPdf Test + * @throws ApiException + * if the Api call fails + */ + + @Test + public void putWebInStorageToPdfTest() throws ApiException + { + String sourceUrl = "http://google.com"; + String resultName = "fromWeb.pdf"; + + SaaSposeResponse response = this.pdfApi.putWebInStorageToPdf(resultName, sourceUrl, null, + null, null, null, null, null, + null, this.tempFolder); + assertEquals(response.getCode(), HttpStatusCode.CREATED); + } + + + /** + * GetLaTeXInStorageToPdf Test + * @throws ApiException + * if the Api call fails + */ + + @Test + public void getLaTeXInStorageToPdfTest() throws ApiException + { + String name = "TexExample.tex"; + this.uploadFile(name); + + + String srcPath = this.tempFolder + '/' + name; + + File response = this.pdfApi.getLaTeXInStorageToPdf(srcPath); + assertNotNull(response); + } + + + /** + * PutLaTeXInStorageToPdf Test + * @throws ApiException + * if the Api call fails + */ + + @Test + public void putLaTeXInStorageToPdfTest() throws ApiException + { + String name = "TexExample.tex"; + this.uploadFile(name); + + + String srcPath = this.tempFolder + '/' + name; + String resultName = "fromTex.pdf"; + + SaaSposeResponse response = this.pdfApi.putLaTeXInStorageToPdf(resultName, srcPath, this.tempFolder); + assertEquals(response.getCode(), HttpStatusCode.CREATED); + } + + + /** + * GetMhtInStorageToPdf Test + * @throws ApiException + * if the Api call fails + */ + + @Test + public void getMhtInStorageToPdfTest() throws ApiException + { + String name = "MhtExample.mht"; + this.uploadFile(name); + + + String srcPath = this.tempFolder + '/' + name; + + File response = this.pdfApi.getMhtInStorageToPdf(srcPath); + assertNotNull(response); + } + + + /** + * PutMhtInStorageToPdf Test + * @throws ApiException + * if the Api call fails + */ + + @Test + public void putMhtInStorageToPdfTest() throws ApiException + { + String name = "MhtExample.mht"; + this.uploadFile(name); + + + String srcPath = this.tempFolder + '/' + name; + String resultName = "fromMht.pdf"; + + SaaSposeResponse response = this.pdfApi.putMhtInStorageToPdf(resultName, srcPath, this.tempFolder); + assertEquals(response.getCode(), HttpStatusCode.CREATED); + } + + + /** + * GetHtmlInStorageToPdf Test + * @throws ApiException + * if the Api call fails + */ + + @Test + public void getHtmlInStorageToPdfTest() throws ApiException + { + String name = "HtmlWithImage.zip"; + this.uploadFile(name); + + String htmlFileName = "HtmlWithImage.html"; + double height = 650; + double width = 250; + String srcPath = this.tempFolder + '/' + name; + + File response = this.pdfApi.getHtmlInStorageToPdf(srcPath, htmlFileName, height, width, + null, null, null, null, null); + assertNotNull(response); + } + + + /** + * PutHtmlInStorageToPdf Test + * @throws ApiException + * if the Api call fails + */ + + @Test + public void putHtmlInStorageToPdfTest() throws ApiException + { + String name = "HtmlWithImage.zip"; + this.uploadFile(name); + + String htmlFileName = "HtmlWithImage.html"; + double height = 650; + double width = 250; + String resultName = "fromHtml.pdf"; + String srcPath = this.tempFolder + '/' + name; + + + SaaSposeResponse response = this.pdfApi.putHtmlInStorageToPdf(name, srcPath, htmlFileName, + height, width, null, null, null, + null, null, null); + assertEquals(response.getCode(), HttpStatusCode.CREATED); + } + + /** + * GetXslFoInStorageToPdf Test + * @throws ApiException + * if the Api call fails + */ + + @Test + public void getXslFoInStorageToPdfTest() throws ApiException + { + String name = "XslfoExample.xslfo"; + this.uploadFile(name); + + + String srcPath = this.tempFolder + '/' + name; + + File response = this.pdfApi.getXslFoInStorageToPdf(srcPath); + assertNotNull(response); + } + + + /** + * PutXslFoInStorageToPdf Test + * @throws ApiException + * if the Api call fails + */ + + @Test + public void putXslFoInStorageToPdfTest() throws ApiException + { + String name = "XslfoExample.xslfo"; + this.uploadFile(name); + + + String srcPath = this.tempFolder + '/' + name; + String resultName = "fromXlsFo.pdf"; + + SaaSposeResponse response = this.pdfApi.putXslFoInStorageToPdf(resultName, srcPath, this.tempFolder); + assertEquals(response.getCode(), HttpStatusCode.CREATED); + } + + + /** + * GetXpsInStorageToPdf Test + * @throws ApiException + * if the Api call fails + */ + + @Test + public void getXpsInStorageToPdfTest() throws ApiException + { + String name = "Simple.xps"; + this.uploadFile(name); + + + String srcPath = this.tempFolder + '/' + name; + + File response = this.pdfApi.getXpsInStorageToPdf(srcPath); + assertNotNull(response); + } + + + /** + * PutXpsInStorageToPdf Test + * @throws ApiException + * if the Api call fails + */ + + @Test + public void putXpsInStorageToPdfTest() throws ApiException + { + String name = "Simple.xps"; + this.uploadFile(name); + + + String srcPath = this.tempFolder + '/' + name; + String resultName = "fromXps.pdf"; + + SaaSposeResponse response = this.pdfApi.putXpsInStorageToPdf(resultName, srcPath, this.tempFolder); + assertEquals(response.getCode(), HttpStatusCode.CREATED); + } + + + /** + * GetSvgInStorageToPdf Test + * @throws ApiException + * if the Api call fails + */ + + @Test + public void getSvgInStorageToPdfTest() throws ApiException + { + String name = "Simple.svg"; + this.uploadFile(name); + + + String srcPath = this.tempFolder + '/' + name; + + File response = this.pdfApi.getSvgInStorageToPdf(srcPath, null, null, null, + null, null, null, null, null); + assertNotNull(response); + } + + + /** + * PutSvgInStorageToPdf Test + * @throws ApiException + * if the Api call fails + */ + + @Test + public void putSvgInStorageToPdfTest() throws ApiException + { + String name = "Simple.svg"; + this.uploadFile(name); + + + String srcPath = this.tempFolder + '/' + name; + String resultName = "fromSvg.pdf"; + + SaaSposeResponse response = this.pdfApi.putSvgInStorageToPdf(resultName, srcPath, null, + null, null, null, null, null, + null, null, this.tempFolder); + assertEquals(response.getCode(), HttpStatusCode.CREATED); + } + + /** + * GetPclInStorageToPdf Test + * @throws ApiException + * if the Api call fails + */ + + @Test + public void getPclInStorageToPdfTest() throws ApiException + { + String name = "template.pcl"; + this.uploadFile(name); + + + String srcPath = this.tempFolder + '/' + name; + + File response = this.pdfApi.getPclInStorageToPdf(srcPath); + assertNotNull(response); + } + + + /** + * PutPclInStorageToPdf Test + * @throws ApiException + * if the Api call fails + */ + + @Test + public void putPclInStorageToPdfTest() throws ApiException + { + String name = "template.pcl"; + this.uploadFile(name); + + + String srcPath = this.tempFolder + '/' + name; + String resultName = "fromPcl.pdf"; + + SaaSposeResponse response = this.pdfApi.putPclInStorageToPdf(resultName, srcPath, this.tempFolder); + assertEquals(response.getCode(), HttpStatusCode.CREATED); + } + + + /** + * GetXmlInStorageToPdf Test + * @throws ApiException + * if the Api call fails + */ + + @Test + public void getXmlInStorageToPdfTest() throws ApiException + { + String name = "template.xml"; + this.uploadFile(name); + + + String srcPath = this.tempFolder + '/' + name; + + File response = this.pdfApi.getXmlInStorageToPdf(srcPath, null); + assertNotNull(response); + } + + + /** + * PutXmlInStorageToPdf Test + * @throws ApiException + * if the Api call fails + */ + + @Test + public void putXmlInStorageToPdfTest() throws ApiException + { + String name = "template.xml"; + this.uploadFile(name); + + + String srcPath = this.tempFolder + '/' + name; + String resultName = "fromXml.pdf"; + + SaaSposeResponse response = this.pdfApi.putXmlInStorageToPdf(resultName, srcPath, null, this.tempFolder); + assertEquals(response.getCode(), HttpStatusCode.CREATED); + } +} diff --git a/testData/33539.jpg b/testData/33539.jpg new file mode 100644 index 0000000..7a9ed44 Binary files /dev/null and b/testData/33539.jpg differ diff --git a/testData/44781.jpg b/testData/44781.jpg new file mode 100644 index 0000000..6dceae9 Binary files /dev/null and b/testData/44781.jpg differ diff --git a/testData/4pages.epub b/testData/4pages.epub new file mode 100644 index 0000000..3991bd5 Binary files /dev/null and b/testData/4pages.epub differ diff --git a/testData/4pages.pdf b/testData/4pages.pdf new file mode 100644 index 0000000..2ea645f Binary files /dev/null and b/testData/4pages.pdf differ diff --git a/testData/BlankWithSignature.pdf b/testData/BlankWithSignature.pdf new file mode 100644 index 0000000..0481e36 Binary files /dev/null and b/testData/BlankWithSignature.pdf differ diff --git a/testData/Hello world.pdf b/testData/Hello world.pdf new file mode 100644 index 0000000..9ce3d9e Binary files /dev/null and b/testData/Hello world.pdf differ diff --git a/testData/HtmlExample1.html b/testData/HtmlExample1.html new file mode 100644 index 0000000..f48c473 --- /dev/null +++ b/testData/HtmlExample1.html @@ -0,0 +1,27 @@ + + + Html example + + + + +

This sample contains table.

+ + + + + + + + + + + +
col: 1, row: 1col: 2, row: 2col: 3, row: 3
col: 1, row: 1col: 2, row: 2col: 3, row: 3
col: 1, row: 1col: 2, row: 2col: 3, row: 2
+ + \ No newline at end of file diff --git a/testData/HtmlWithImage.zip b/testData/HtmlWithImage.zip new file mode 100644 index 0000000..3582cce Binary files /dev/null and b/testData/HtmlWithImage.zip differ diff --git a/testData/Koala.jpg b/testData/Koala.jpg new file mode 100644 index 0000000..78704a0 Binary files /dev/null and b/testData/Koala.jpg differ diff --git a/testData/MhtExample.mht b/testData/MhtExample.mht new file mode 100644 index 0000000..6d82cb7 --- /dev/null +++ b/testData/MhtExample.mht @@ -0,0 +1,12752 @@ +MIME-Version: 1.0 +Content-Type: multipart/related; boundary="----=_NextPart_01CC5782.4EF02DF0" + +This document is a Single File Web Page, also known as a Web Archive file. If you are seeing this message, your browser or editor doesn't support Web Archive files. Please download a browser that supports Web Archive, such as Windows® Internet Explorer®. + +------=_NextPart_01CC5782.4EF02DF0 +Content-Location: file:///C:/D088118C/email.htm +Content-Transfer-Encoding: quoted-printable +Content-Type: text/html; charset="us-ascii" + + + + + + + + + + + + + + + + + + + + +
+ +

 

+ +

 

+ +

<= +o:p> 

+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

3D"cid:image002.png@01CC56A7.B8F6F02=

+ + + + +
+
+

Test Email with Tables<= +span + style=3D'font-size:10.0pt;font-family:"Arial","sans-serif"'>

+
+

July + 27, 2011

+
+

This is a test summary. This is a test + summary. This is a test summary. This is a test summary. This is a test + summary. This is a test summary. This is a test summary. This is a test + summary. This is a test summary. This is a test summary. This is a test s= +ummary. + This is a test summary. This is a test summary. This is a test summary. T= +his + is a test summary. This is a test summary. This is a test summary. This i= +s a + test summary.      +

+
+

 

+
+

+ + + + +
+

 <= +/o:p>

+
+
+

 

+
+

 

+
+

Test

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

Column1

+
+

Column2

+
+

Column3

+
+

Column4

+
+

Column5

+
+

 

+
+

1

+
+

0.00 = +

+
+

(0)= +

+
+

0 <= +/span>

+
+

(2)= +

+
+

 

+
+

2

+
+

0.11 = +

+
+

0 <= +/span>

+
+

1 <= +/span>

+
+

(2)= +

+
+

 

+
+

3

+
+

2.00<= +/p> +

+

3 <= +/span>

+
+

2 <= +/span>

+
+

6 <= +/span>

+
+

 

+
+

4

+
+

3.00 = +

+
+

3 <= +/span>

+
+

1 <= +/span>

+
+

7 <= +/span>

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

Column1

+
+

Column2

+
+

Column3

+
+

Column4

+
+

Column5

+
+

Column6

+
+

Column7

+
+

Column8

+
+

Column9

+
+

Column10

+
+

Column11

+
+

Column12

+
+

Column13

+
+

Column14

+
+

Column15

+
+

1

+
+

1.11 +

+
+

1.11 +

+
+

1 +

+
+

(1)

+
+

1 +

+
+

2 +

+
+

3 +

+
+

(4)

+
+

08/31/11

+
+

(00)= +

+
+

08/31/11

+
+

(11)<= +/p> +

+

1 +

+
+

1.11 = +

+
+

2

+
+

2.22 = +

+
+

2.22 = +

+
+

1 +

+
+

(2)<= +/p> +

+

1 +

+
+

2 +

+
+

33 +

+
+

(44)= +

+
+

08/31/11

+
+

(11)= +

+
+

08/31/11

+
+

(22)= +

+
+

2 <= +/span>

+
+

2.22 = +

+
+

3

+
+

3.33 = +

+
+

3.33 = +

+
+

1 +

+
+

(3)<= +/p> +

+

1 +

+
+

22 +

+
+

333

+
+

(444)

+
+

08/31/11

+
+

(22)= +

+
+

08/31/11

+
+

(33)= +

+
+

3 <= +/span>

+
+

3.33 = +

+
+

4

+
+

4.44 = +

+
+

4.44 = +

+
+

1 +

+
+

(4)<= +/p> +

+

0 +

+
+

222

+
+

3333

+
+

(4444)

+
+

08/31/11

+
+

(33)= +

+
+

08/31/11

+
+

(44)= +

+
+

4 +

+
+

4.44

+
+
+

Test Table Header

+
+

Column1

+
+

Column2

+
+

Column3

+
+

Column4

+
+

Column5

+
+

Column6

+
+

Column7

+
+

Column8

+
+

Column9

+
+

Column10

+
+

Column11

+
+

Column12

+
+

Column13

+
+

Column14

+
+

Column15

+
+

1

+
+

0.07

+
+

0.07

+
+

1 <= +/span>

+
+

(1)= +

+
+

1 <= +/span>

+
+

5 <= +/span>

+
+

6 <= +/span>

+
+

(12)

+
+

08/31/11

+
+

(22)<= +/p> +

+

08/31/11

+
+

(11)<= +/p> +

+

2 <= +/span>

+
+

1.11

+
+

2

+
+

0.07

+
+

0.07

+
+

1 <= +/span>

+
+

(1)= +

+
+

1 <= +/span>

+
+

3 <= +/span>

+
+

3 <= +/span>

+
+

(18)

+
+

08/31/11

+
+

(11)= +

+
+

08/31/11

+
+

(22)<= +/p> +

+

1 <= +/span>

+
+

1.11 = +

+
+

3

+
+

0.12

+
+

0.12

+
+

1 <= +/span>

+
+

(2)= +

+
+

(2)= +

+
+

9 <= +/span>

+
+

10 = +

+
+

(22)

+
+

08/31/11

+
+

(33)= +

+
+

08/31/11

+
+

(33)

+
+

3 <= +/span>

+
+

1.11 = +

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

Column1

+
+

Column2

+
+

Column3

+
+

Column4

+
+

Column5

+
+

Column6

+
+

Column7

+
+

Column8

+
+

Column9

+
+

Column10

+
+

Column11

+
+

Column12

+
+

Column13

+
+

Column14

+
+

Column15

+
+

1

+
+

0.07

+
+

0.07

+
+

1 <= +/span>

+
+

(1)= +

+
+

1 <= +/span>

+
+

5 <= +/span>

+
+

6 <= +/span>

+
+

(12)

+
+

08/31/11

+
+

(22)<= +/p> +

+

08/31/11

+
+

(11)<= +/p> +

+

2 <= +/span>

+
+

1.11

+
+

2

+
+

0.07

+
+

0.07

+
+

1 <= +/span>

+
+

(1)= +

+
+

1 <= +/span>

+
+

3 <= +/span>

+
+

3 <= +/span>

+
+

(18)

+
+

08/31/11

+
+

(11)= +

+
+

08/31/11

+
+

(22)<= +/p> +

+

1 <= +/span>

+
+

1.11 = +

+
+

3

+
+

0.12

+
+

0.12

+
+

1 <= +/span>

+
+

(2)= +

+
+

(2)= +

+
+

9 <= +/span>

+
+

10 = +

+
+

(22)

+
+

08/31/11

+
+

(33)= +

+
+

08/31/11

+
+

(33)

+
+

3 <= +/span>

+
+

1.11 = +

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

Column1

+
+

Column2

+
+

Column3

+
+

Column4

+
+

Column5

+
+

Column6

+
+

Column7

+
+

Column8

+
+

Column9

+
+

Column10

+
+

Column11

+
+

Column12

+
+

Column13

+
+

Column14

+
+

Column15

+
+

1

+
+

0.07

+
+

0.07

+
+

1 <= +/span>

+
+

(1)= +

+
+

1 <= +/span>

+
+

5 <= +/span>

+
+

6 <= +/span>

+
+

(12)

+
+

08/31/11

+
+

(22)<= +/p> +

+

08/31/11

+
+

(11)<= +/p> +

+

2 <= +/span>

+
+

1.11

+
+

2

+
+

0.07

+
+

0.07

+
+

1 <= +/span>

+
+

(1)= +

+
+

1 <= +/span>

+
+

3 <= +/span>

+
+

3 <= +/span>

+
+

(18)

+
+

08/31/11

+
+

(11)= +

+
+

08/31/11

+
+

(22)<= +/p> +

+

1 <= +/span>

+
+

(1.11)

+
+

3

+
+

0.12

+
+

0.12

+
+

1 <= +/span>

+
+

(2)= +

+
+

(2)= +

+
+

9 <= +/span>

+
+

10 = +

+
+

(22)

+
+

08/31/11

+
+

(33)= +

+
+

08/31/11

+
+

(33)

+
+

3 <= +/span>

+
+

1.11 = +

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

Column1

+
+

Column2

+
+

Column3

+
+

Column4

+
+

Column5

+
+

Column6

+
+

Column7

+
+

Column8

+
+

Column9

+
+

Column10

+
+

Column11

+
+

Column12

+
+

Column13

+
+

Column14

+
+

Column15

+
+

1

+
+

0.07

+
+

0.07

+
+

1 <= +/span>

+
+

(2)= +

+
+

1 <= +/span>

+
+

5 <= +/span>

+
+

6 <= +/span>

+
+

(12)

+
+

08/31/11

+
+

(22)<= +/p> +

+

08/31/11

+
+

(11)<= +/p> +

+

2 <= +/span>

+
+

(1.11)

+
+

2

+
+

0.07

+
+

0.07

+
+

1 <= +/span>

+
+

(18)

+
+

1 <= +/span>

+
+

3 <= +/span>

+
+

3 <= +/span>

+
+

(18)

+
+

08/31/11

+
+

(11)= +

+
+

08/31/11

+
+

(22)<= +/p> +

+

1 <= +/span>

+
+

(1.11)

+
+

3

+
+

0.12

+
+

0.12

+
+

1 <= +/span>

+
+

(4)= +

+
+

(2)= +

+
+

9 <= +/span>

+
+

10 = +

+
+

(22)

+
+

08/31/11

+
+

(33)= +

+
+

08/31/11

+
+

(33)

+
+

3 <= +/span>

+
+

1.11 = +

+
+

Test Table Header

+
+

Another Table

+
+

Column1

+
+

Column2

+
+

Column3

+
+

Column4

+
+

Column5

+
+

Column6

+
+

Column7

+
+

Column8

+
+

Column9

+
+

Column10

+
+

Column11

+
+

Column12

+
+

1

+
+

08/31/11

+
+

0.111

+
+

1

+
+

(4)= +

+
+

(3)<= +/p> +

+

(0)= +

+
+

(6)<= +/p> +

+

0 <= +/span>

+
+

08/31/11

+
+

(6)= +

+
+

08/31/11

+
+

(2)= +

+
+

2 <= +/span>

+
+

(0.00)= +

+
+

2

+
+

08/31/11

+
+

0.2222

+
+

2

+
+

(5)<= +/p> +

+

(2)<= +/p> +

+

(1)<= +/p> +

+

(7)<= +/p> +

+

(2)<= +/p> +

+

08/31/11

+
+

(8)= +

+
+

08/31/11

+
+

(4)= +

+
+

1 <= +/span>

+
+

(3.33)= +

+
+

3

+
+

08/31/11

+
+

0.444

+
+

3

+
+

(6)<= +/p> +

+

(1)<= +/p> +

+

(2)= +

+
+

(8)<= +/p> +

+

(2)= +

+
+

08/31/11

+
+

(8)= +

+
+

08/31/11

+
+

(4)= +

+
+

1 <= +/span>

+
+

(2.22)= +

+
+

4

+
+

08/31/11

+
+

0.333

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

Column1

+
+

Column2

+
+

Column3

+
+

Column4

+
+

Column5

+
+

Column6

+
+

Column7

+
+

Column8

+
+

Column9

+
+

Column10

+
+

Column11

+
+

Column12

+
+

5

+
+

08/31/11

+
+

0.555

+
+

1

+
+

(4)= +

+
+

(3)<= +/p> +

+

(0)= +

+
+

(6)<= +/p> +

+

0 <= +/span>

+
+

08/31/11

+
+

(6)= +

+
+

08/31/11

+
+

11 = +

+
+

2 <= +/span>

+
+

(3.37)

+
+

6

+
+

08/31/11

+
+

0.666

+
+

2

+
+

(5)<= +/p> +

+

(2)<= +/p> +

+

(1)<= +/p> +

+

(7)<= +/p> +

+

(2)<= +/p> +

+

08/31/11

+
+

(8)= +

+
+

08/31/11

+
+

13 = +

+
+

3 <= +/span>

+
+

(3.02)

+
+

Another one

+
+

3

+
+

(6)<= +/p> +

+

(1)<= +/p> +

+

(2)= +

+
+

(8)<= +/p> +

+

(2)= +

+
+

08/31/11

+
+

(8)= +

+
+

08/31/11

+
+

14 = +

+
+

4 <= +/span>

+
+

(1.80)

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

Column1

+
+

Column2

+
+

Column3

+
+

Column4

+
+

Column5

+
+

Column6

+
+

Column7

+
+

Column8

+
+

Column9

+
+

Column10

+
+

Column11

+
+

Column12

+
+

1-Aug

+
+

0.99 = +

+
+

1

+
+

(4)= +

+
+

(3)<= +/p> +

+

(0)= +

+
+

(6)<= +/p> +

+

0 <= +/span>

+
+

08/31/11

+
+

(6)= +

+
+

08/31/11

+
+

11 = +

+
+

2 <= +/span>

+
+

(3.37)

+
+

1-Aug

+
+

0.00 = +

+
+

2

+
+

(5)<= +/p> +

+

(2)<= +/p> +

+

(1)<= +/p> +

+

(7)<= +/p> +

+

(2)<= +/p> +

+

08/31/11

+
+

(8)= +

+
+

08/31/11

+
+

13 = +

+
+

3 <= +/span>

+
+

(3.02)

+
+

1-Aug

+
+

0.11 = +

+
+

3

+
+

(6)<= +/p> +

+

(1)<= +/p> +

+

(2)= +

+
+

(8)<= +/p> +

+

(2)= +

+
+

08/31/11

+
+

(8)= +

+
+

08/31/11

+
+

14 = +

+
+

4 <= +/span>

+
+

(1.80)

+
+

1-Aug

+
+

0.33 = +

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

1-Aug

+
+

0.22 <= +/p> +

+

Column1

+
+

Column2

+
+

Column3

+
+

Column4

+
+

Column5

+
+

Column6

+
+

Column7

+
+

Column8

+
+

Column9

+
+

Column10

+
+

Column11

+
+

Column12

+
+

1

+
+

(4)= +

+
+

(3)<= +/p> +

+

(0)= +

+
+

(6)<= +/p> +

+

0 <= +/span>

+
+

08/31/11

+
+

(6)= +

+
+

08/31/11

+
+

11 = +

+
+

2 <= +/span>

+
+

(3.37)

+
+

2

+
+

(5)<= +/p> +

+

(2)<= +/p> +

+

(1)<= +/p> +

+

(7)<= +/p> +

+

(2)<= +/p> +

+

08/31/11

+
+

(8)= +

+
+

08/31/11

+
+

13 = +

+
+

3 <= +/span>

+
+

(3.02)

+
+

3

+
+

(6)<= +/p> +

+

(1)<= +/p> +

+

(2)= +

+
+

(8)<= +/p> +

+

(2)= +

+
+

08/31/11

+
+

(8)= +

+
+

08/31/11

+
+

14 = +

+
+

4 <= +/span>

+
+

(1.80)

+
+

This is a test summary. This is a test + summary. This is a test summary. This is a test summary. This is a test + summary. This is a test summary. This is a test summary. This is a test + summary. This is a test summary. This is a test summary. This is a test s= +ummary. + This is a test summary. This is a test summary. This is a test summary. T= +his + is a test summary. This is a test summary. This is a test summary. This i= +s a + test summary. <= +/i>

+
+

Table Header

+
+

Header 2

+
+

Column1

+
+

Column2

+
+

Column3

+
+

Column4

+
+

Column5

+
+

Column6

+
+

Column7 <= +/b>

+
+

Column8

+
+

Column9

+
+

Column10

+
+

Column11

+
+

Column12

+
+

Column13

+
+

Column14<= +/o:p>

+
+

AAAAA

+
+

1/11 +

+

1

+
+

AAAA

+
+

 

+
+

 

+
+

 

+
+

FFFF<= +/p> +

+

JAN-11

+
+

00.000

+
+

0.001 <= +/p> +

+

0.11 = +

+
+

BBBBB

+
+

1/11 +

+

2

+
+

0.000

+
+

BBBB

+
+

0.000

+
+

0.000

+
+

0.000

+
+

0.000

+
+

FFFF<= +/p> +

+

JAN-11

+
+

   00.000

+
+

0.001 <= +/p> +

+

0.022 = +

+
+

CCCCC

+
+

1/11 +

+

3

+
+

0.000

+
+

CCCC

+
+

0.000

+
+

0.000

+
+

0.000

+
+

0.000

+
+

FFFF<= +/p> +

+

JAN-11

+
+

   00.000

+
+

0.001 <= +/p> +

+

0.333

+
+

DDDDD

+
+

1/11 +

+

4

+
+

DDDD

+
+

FFFF<= +/p> +

+

JAN-11

+
+

   00.000

+
+

0.000

+
+

0.444

+
+

EEEEE

+
+

1/11 +

+

5

+
+

3.000

+
+

EEEE

+
+

3.000

+
+

3.000

+
+

3.000

+
+

3.000

+
+

FFFF<= +/p> +

+

JAN-11

+
+

   00.000

+
+

(0.001)<= +/p> +

+

0.555= +

+
+

FFFFF

+
+

1/11 +

+

6

+
+

2.00 = +

+
+

FFFFF

+
+

2.00 = +

+
+

2.00 = +

+
+

2.00 = +

+
+

2.00 = +

+
+

FFFF<= +/p> +

+

JAN-11

+
+

   00.000

+
+

(0.001)= +

+
+

0.666

+
+

GGGG

+
+

1/11 +

+

7

+
+

4.000

+
+

GGGG

+
+

4.000

+
+

4.000

+
+

4.000

+
+

4.000

+
+

FFFF +

+

Jan-11 +

+

   00.000

+
+

(0.001)= +

+
+

0.777 = +

+
+

HHHHH

+
+

1/11 +

+

8

+
+

5.000

+
+

HHHH

+
+

5.000

+
+

5.000

+
+

5.000

+
+

5.000

+
+

IIIIIIIIIIIIII

+
+

1/11<= +/p> +

+

9

+
+

2.000

+
+

IIIIIIIIII

+
+

2.000

+
+

2.000

+
+

2.000

+
+

2.000

+
+

Header 3

+
+

JJJJJJJ

+
+

1/11

+
+

10

+
+

2.000

+
+

JJJJJ

+
+

2.000

+
+

2.000

+
+

2.000

+
+

2.000

+
+

Column1

+
+

Column2

+
+

Column3

+
+

Column4

+
+

Column5

+
+

KKKKKK

+
+

1/11<= +/p> +

+

11 +

+

KKKKK

+
+

0.000

+
+

0.000

+
+

0.000

+
+

    CCCC

+
+

AAAA

+
+

11 +

+
+

11 = +

+
+

11 = +

+
+

11 +

+
+

LLLLLLL

+
+

1/11<= +/p> +

+

12 +

+

LLLLL

+
+

 

+
+

 

+
+

 

+
+

    DDDD

+
+

AAAA

+
+

11 +

+
+

11 +

+
+

11 +

+
+

11 +

+
+

MMMMM

+
+

1/11<= +/p> +

+

13

+
+

MMMM

+
+

 

+
+

 

+
+

 

+
+

EEEEE

+
+

BBBB

+
+

11 +

+
+

11 +

+
+

11 +

+
+

11 +

+
+

NNNNNN

+
+

1/11<= +/p> +

+

14

+
+

NNNNN

+
+

 

+
+

 

+
+

 

+
+

 

+
+

FFFFF

+
+

CCCCC

+
+

11 +

+
+

11 +

+
+

11 +

+
+

11 +

+
+

OOOOO

+
+

1/11<= +/p> +

+

15

+
+

OOOOO

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

This is a test + summary. This is a test summary. This is a test summary. This is a test + summary. This is a test summary. This is a test summary. This is a test + summary. This is a test summary. This is a test summary. This is a test + summary. This is a test summary. This is a test summary. This is a test + summary. This is a test summary. This is a test summary. This is a test + summary. This is a test summary. This is a test summary. Please see: http://www.microsoft.com

+
+ +
+ +

 <= +/p> + +

+ + + + + +------=_NextPart_01CC5782.4EF02DF0 +Content-Location: file:///C:/D088118C/email_files/themedata.thmx +Content-Transfer-Encoding: base64 +Content-Type: application/vnd.ms-officetheme + +UEsDBBQABgAIAAAAIQCCirwT+gAAABwCAAATAAAAW0NvbnRlbnRfVHlwZXNdLnhtbKyRy2rDMBBF +94X+g9C22HK6KKXYzqJJd30s0g8Y5LEtao+ENAnJ33fsuFC6CC10IxBizpl7Va6P46AOGJPzVOlV +XmiFZH3jqKv0++4pu9cqMVADgyes9AmTXtfXV+XuFDApmaZU6Z45PBiTbI8jpNwHJHlpfRyB5Ro7 +E8B+QIfmtijujPXESJzxxNB1+SoLRNegeoPILzCKx7Cg8Pv5DCSAmAtYq8czYVqi0hDC4CywRDAH +an7oM9+2zmLj7X4UaT6DF9jNBDO/XGD1P+ov5wZb2A+stkfp4lx/xCH9LdtSay6Tc/7Uu5AuGC6X +t7Rh5r+tPwEAAP//AwBQSwMEFAAGAAgAAAAhAKXWp+fAAAAANgEAAAsAAABfcmVscy8ucmVsc4SP +z2rDMAyH74W9g9F9UdLDGCV2L6WQQy+jfQDhKH9oIhvbG+vbT8cGCrsIhKTv96k9/q6L+eGU5yAW +mqoGw+JDP8to4XY9v3+CyYWkpyUIW3hwhqN727VfvFDRozzNMRulSLYwlRIPiNlPvFKuQmTRyRDS +SkXbNGIkf6eRcV/XH5ieGeA2TNP1FlLXN2Cuj6jJ/7PDMMyeT8F/ryzlRQRuN5RMaeRioagv41O9 +kKhlqtQe0LW4+db9AQAA//8DAFBLAwQUAAYACAAAACEAa3mWFoMAAACKAAAAHAAAAHRoZW1lL3Ro +ZW1lL3RoZW1lTWFuYWdlci54bWwMzE0KwyAQQOF9oXeQ2TdjuyhFYrLLrrv2AEOcGkHHoNKf29fl +44M3zt8U1ZtLDVksnAcNimXNLoi38Hwspxuo2kgcxSxs4ccV5ul4GMm0jRPfSchzUX0j1ZCFrbXd +INa1K9Uh7yzdXrkkaj2LR1fo0/cp4kXrKyYKAjj9AQAA//8DAFBLAwQUAAYACAAAACEAlrWt4pYG +AABQGwAAFgAAAHRoZW1lL3RoZW1lL3RoZW1lMS54bWzsWU9v2zYUvw/YdyB0b2MndhoHdYrYsZst +TRvEboceaYmW2FCiQNJJfRva44ABw7phhxXYbYdhW4EW2KX7NNk6bB3Qr7BHUpLFWF6SNtiKrT4k +Evnj+/8eH6mr1+7HDB0SISlP2l79cs1DJPF5QJOw7d0e9i+teUgqnASY8YS0vSmR3rWN99+7itdV +RGKCYH0i13Hbi5RK15eWpA/DWF7mKUlgbsxFjBW8inApEPgI6MZsablWW12KMU08lOAYyN4aj6lP +0FCT9DZy4j0Gr4mSesBnYqBJE2eFwQYHdY2QU9llAh1i1vaAT8CPhuS+8hDDUsFE26uZn7e0cXUJ +r2eLmFqwtrSub37ZumxBcLBseIpwVDCt9xutK1sFfQNgah7X6/W6vXpBzwCw74OmVpYyzUZ/rd7J +aZZA9nGedrfWrDVcfIn+ypzMrU6n02xlsliiBmQfG3P4tdpqY3PZwRuQxTfn8I3OZre76uANyOJX +5/D9K63Vhos3oIjR5GAOrR3a72fUC8iYs+1K+BrA12oZfIaCaCiiS7MY80QtirUY3+OiDwANZFjR +BKlpSsbYhyju4ngkKNYM8DrBpRk75Mu5Ic0LSV/QVLW9D1MMGTGj9+r596+eP0XHD54dP/jp+OHD +4wc/WkLOqm2chOVVL7/97M/HH6M/nn7z8tEX1XhZxv/6wye//Px5NRDSZybOiy+f/PbsyYuvPv39 +u0cV8E2BR2X4kMZEopvkCO3zGBQzVnElJyNxvhXDCNPyis0klDjBmksF/Z6KHPTNKWaZdxw5OsS1 +4B0B5aMKeH1yzxF4EImJohWcd6LYAe5yzjpcVFphR/MqmXk4ScJq5mJSxu1jfFjFu4sTx7+9SQp1 +Mw9LR/FuRBwx9xhOFA5JQhTSc/yAkArt7lLq2HWX+oJLPlboLkUdTCtNMqQjJ5pmi7ZpDH6ZVukM +/nZss3sHdTir0nqLHLpIyArMKoQfEuaY8TqeKBxXkRzimJUNfgOrqErIwVT4ZVxPKvB0SBhHvYBI +WbXmlgB9S07fwVCxKt2+y6axixSKHlTRvIE5LyO3+EE3wnFahR3QJCpjP5AHEKIY7XFVBd/lbobo +d/ADTha6+w4ljrtPrwa3aeiINAsQPTMR2pdQqp0KHNPk78oxo1CPbQxcXDmGAvji68cVkfW2FuJN +2JOqMmH7RPldhDtZdLtcBPTtr7lbeJLsEQjz+Y3nXcl9V3K9/3zJXZTPZy20s9oKZVf3DbYpNi1y +vLBDHlPGBmrKyA1pmmQJ+0TQh0G9zpwOSXFiSiN4zOq6gwsFNmuQ4OojqqJBhFNosOueJhLKjHQo +UcolHOzMcCVtjYcmXdljYVMfGGw9kFjt8sAOr+jh/FxQkDG7TWgOnzmjFU3grMxWrmREQe3XYVbX +Qp2ZW92IZkqdw61QGXw4rxoMFtaEBgRB2wJWXoXzuWYNBxPMSKDtbvfe3C3GCxfpIhnhgGQ+0nrP ++6hunJTHirkJgNip8JE+5J1itRK3lib7BtzO4qQyu8YCdrn33sRLeQTPvKTz9kQ6sqScnCxBR22v +1VxuesjHadsbw5kWHuMUvC51z4dZCBdDvhI27E9NZpPlM2+2csXcJKjDNYW1+5zCTh1IhVRbWEY2 +NMxUFgIs0Zys/MtNMOtFKWAj/TWkWFmDYPjXpAA7uq4l4zHxVdnZpRFtO/ualVI+UUQMouAIjdhE +7GNwvw5V0CegEq4mTEXQL3CPpq1tptzinCVd+fbK4Ow4ZmmEs3KrUzTPZAs3eVzIYN5K4oFulbIb +5c6vikn5C1KlHMb/M1X0fgI3BSuB9oAP17gCI52vbY8LFXGoQmlE/b6AxsHUDogWuIuFaQgquEw2 +/wU51P9tzlkaJq3hwKf2aYgEhf1IRYKQPShLJvpOIVbP9i5LkmWETESVxJWpFXtEDgkb6hq4qvd2 +D0UQ6qaaZGXA4E7Gn/ueZdAo1E1OOd+cGlLsvTYH/unOxyYzKOXWYdPQ5PYvRKzYVe16szzfe8uK +6IlZm9XIswKYlbaCVpb2rynCObdaW7HmNF5u5sKBF+c1hsGiIUrhvgfpP7D/UeEz+2VCb6hDvg+1 +FcGHBk0Mwgai+pJtPJAukHZwBI2THbTBpElZ02atk7ZavllfcKdb8D1hbC3ZWfx9TmMXzZnLzsnF +izR2ZmHH1nZsoanBsydTFIbG+UHGOMZ80ip/deKje+DoLbjfnzAlTTDBNyWBofUcmDyA5LcczdKN +vwAAAP//AwBQSwMEFAAGAAgAAAAhAA3RkJ+2AAAAGwEAACcAAAB0aGVtZS90aGVtZS9fcmVscy90 +aGVtZU1hbmFnZXIueG1sLnJlbHOEj00KwjAUhPeCdwhvb9O6EJEm3YjQrdQDhOQ1DTY/JFHs7Q2u +LAguh2G+mWm7l53JE2My3jFoqhoIOumVcZrBbbjsjkBSFk6J2TtksGCCjm837RVnkUsoTSYkUigu +MZhyDidKk5zQilT5gK44o49W5CKjpkHIu9BI93V9oPGbAXzFJL1iEHvVABmWUJr/s/04GolnLx8W +Xf5RQXPZhQUoosbM4CObqkwEylu6usTfAAAA//8DAFBLAQItABQABgAIAAAAIQCCirwT+gAAABwC +AAATAAAAAAAAAAAAAAAAAAAAAABbQ29udGVudF9UeXBlc10ueG1sUEsBAi0AFAAGAAgAAAAhAKXW +p+fAAAAANgEAAAsAAAAAAAAAAAAAAAAAKwEAAF9yZWxzLy5yZWxzUEsBAi0AFAAGAAgAAAAhAGt5 +lhaDAAAAigAAABwAAAAAAAAAAAAAAAAAFAIAAHRoZW1lL3RoZW1lL3RoZW1lTWFuYWdlci54bWxQ +SwECLQAUAAYACAAAACEAlrWt4pYGAABQGwAAFgAAAAAAAAAAAAAAAADRAgAAdGhlbWUvdGhlbWUv +dGhlbWUxLnhtbFBLAQItABQABgAIAAAAIQAN0ZCftgAAABsBAAAnAAAAAAAAAAAAAAAAAJsJAAB0 +aGVtZS90aGVtZS9fcmVscy90aGVtZU1hbmFnZXIueG1sLnJlbHNQSwUGAAAAAAUABQBdAQAAlgoA +AAAA + +------=_NextPart_01CC5782.4EF02DF0 +Content-Location: file:///C:/D088118C/email_files/colorschememapping.xml +Content-Transfer-Encoding: quoted-printable +Content-Type: text/xml + + + +------=_NextPart_01CC5782.4EF02DF0 +Content-Location: file:///C:/D088118C/email_files/image001.png +Content-Transfer-Encoding: base64 +Content-Type: image/png + +iVBORw0KGgoAAAANSUhEUgAAAHgAAAAlCAIAAAAGFrqsAAAAAXNSR0IArs4c6QAAAAlwSFlzAAAO +xAAADsMB2mqY3AAACcxJREFUaEPtWnlUk1cWz5eVhCQEIltAZJNFIQqC6AEFJTqKoCg42ta6oaN1 +m46OW/WPzow654xbEXehOmMr1lOh1iqrWgEFwjItQgApi6AsgbCEJF/2zA2hMcVzRM7AR48nj+98 +5/C+++7yu/fde98DRK5Q4sxj7BFAUKVq7KWYJeAQ1BzRmIQBHhMpZiE4RP47SB1KrQ4cTsQj77FD +EMV4Ay2UKu/+9Ircp4gJdWVZWbyvWENEq8fRNqlSfTan7moKX9XefzMpNniG8zgqM6aiYbvqxuvB +4XT59aK0O1XdQoVMolCr1eOlCQZy8VodbryeLpnqu6eNXZ0KIgkXzHVwdGCOlyYYyMUjCG68nh5U ++bypl0AicmiEbWuDJjpbjbUmsIe0Wo1Opx1rQW/yx0O5x/6B9qJfo9HJ1X54/Bx7i6O7QnkR7iTC +mCtTIxD8eeeOpMREmUSCsdXj094JRNLUwuZgEj7I35ZIwNvZs8a0EBmZP8jN3ZSQMHv27LPnztmw +2dgINUgZhwNLp1JztbCpIKPWbSIL72hdTyC2ieXY2Iz8OrARZyoFr8N2oBrdN4VNJVl1a8PdZHTy +v9Ir/3mtLD3ruUSqwEARIpFIIOARPIKBrCEiML3r0Ohwr7pl5bVCCqp287VNLnlVXtMnEYkXceh7 +E4IsLUk/3L2r0WgiIiKK+cV3v/8eRVEul7vyj6ucnJxaWlpupt549uyZpaVleHjE4qgoKysrQ8i8 +ePHiu/S0iooKrVbr5+e3avUHzs6D/fjjxz/m5uQ2NTUyGIzomBgKhbL700+506ZdvHS5q6vr4YMH +AQEBbm5uN1JvlJaUEAiEoKDg2OWxNjbsgoL83p7eJdHRJBJpVMIfkckVo8JoWCY9SnVxlVDcLfP2 +sXXlMLNqu77Ka5GKVcqGts9W+C+c565QoKtWxr98+TIkZFZDQ4NQ2AHgQnO9ZevWsLA56elpPz56 +BOACrPD+05ate/ftAxSqKisPHjzwpKDA0dFRrh+KM0lJK+LiIKAunD9/6eKF5uZmDocDOQNw9PD0 +LCoqilocdTk5+f69e3t2/2Wqn5+Tk/OD3BzwAYgGsg8/WrN7z56M+/fBPZ//7e8wP6xp70KAoHIs +7qNRpfphRVv5y14ZxYKgUCycZCPokqZmP7fU4aKm2q2L5zIYFLFYvDQmuri4yMfHZ8OGjdMDAnq6 +e06cPF4tELDZbFdXt7Xr1nl4eJSWlp4+dZJMJn/9daq3j8+RI/9IOpOYkLApLj4evFJXVxc0Iygg +MDAjI2P7tk8oFPLOnbuAFXzKycn56vp18B8wP3f+Qnpa2pYtmyUSSWQk76M1a1xdXWFt4henm5qa +Tp3+IjQ0rF8shtgH97wLjsPTwDXpmD69SlVFaw+/uv3Ok/r1SXlxJx4fvvikvrG95nnHt1k1dzKq +O0VigwIdnV3z50eCxkeOHoV9Zpg8f+GihYWFFYt17d//McxIUfm2bdsB6KSz5160tMASCFh+aZnR +Clgr7BLxeAsg3pNTvjTO90tl27fvwOPx4DBgcuvb20wmE/LGvYwMI83pxERQAHAfdUzGtutoF8sf +lr0sfdYukSp93dnzfe1XebPX87xojtZkDmPRPPeF8z3o9NcXSXKFnE6nz50bDlvYECPuHu729vYz +g2fOmTt3sE/C4z29JiuVyo6OdjqdAQStra2XL12srKw0EMBaSC+Qzf25XN4CnjHWoBJGLuCxrK0V +Cn22hKML1ICZISEREfOMNFx/LpVK7RZ1Q6kYPkhHQjHKQOtLLQ7Xjap+6ZT+1NxT96JbJVeryMQ2 +JpXfJZ0yiRW90KuZgr9e9uoav/VSXmP3bxs72OAsFss0LZKIJIhBK5YVOMBoF5lEBjRlMpRGo61e +/cG06dOTr1zZuWP7yRPHq6urgay9vU2tUfv6+sJyUzSYDCaTwQAdYTlACZyhtML7NWcy2dJE0EiQ +HIb2/wIaqjxUH4kErX3a8DSluODK0/zUksyb/KLHtU/yawuyBRNIhDmBHIRMKBcIn1W2dYrQcmF/ +bruqQUZoEGny8xolkqEVAiAYcNbgABHwq/6t1RonIW8ayULDwk6dOr1p8+a21tbDhw59duBATU0N +0BPwBEgdxp1hWKvRAryvQ3XIVyAwiBtFfI2s4K5jxEMslvy3pD7nauH9z7PLkorRVknHL51tFa01 +uXWPTuYVXS4qTSt5fqvEBVX4eLKpCOJHJszCaxc7Wc/0siWqdZLaFnWL0FokivVzsGfTTMUbtr5+ +85sM/RzYbjJjaFEH7hP0A7BOPJME9S0mZmlWVmZK8hWqBRUSBTQthkxiHCKRCEougUDUQwxXdoN8 +3hA3VIURQ/TmghEfWDRqTXZS3g/rvineda/7Rg2lRSrtFJOZZIewSR6xvkFR/guXB1qTqDZKcuB0 +D4RItKAQA7iO0X/wDgmZSLMkTWZRF3GswhmUjwMnrVo2hUIhmjb2A/oBrL8ZAzjDz9BJBMFDeEql +UvgA2z+Sxzty7BiUTT6fP8HWdsIEdgmf/3PFz8ZlfX192VlZ8CaTSfqw1Q36YOjJYsAJo36igdQB +lo3ggcsv607VIi+PjX9dFHc5lrDMNedGSf6+h/zEJ2wHK884X7UFkTfP75Mz8c5zXN/kTKOR54W6 +xS/1deQgQqEQ2l4jDdiOymRSmQy2r3FSo9UqlSq1Sj2woQf1VKvhBk4/+nr7vkxJSbt9u6pKUFlZ +lZWZCT2Zp+dkDsdpWexyCN5jR49mZmYKBNWlJaUnjh/Pyc4BLgPL4a029N2mSoJoKaRCFB0RJu9C +TBxpPiKSiZGnYgdNxuHKD96W3qoPsnHkxE3tQtE7hzKogv74qytpzsy3cO7r7c3MzACrwiMiXFxc +DLkS3nQ4wNHpptUJUi2LZQU1zJQbVEs4s0B5hC4FThbQeru7uwPu0Gz4+ftDmwxfNyYkQLLOyszY +uGG9s5MTdClUGi2SF1lUWEgi6bcRZHAIfxqNasoZsj+DwYQKOVJYhqUnHD58eCAFjuRBXhPbWVA9 +vOzcPvR1/ti/prgRKeudFTXFZZkXmQVN29t4KhRyANRl4kQ6HawapITuODBwRnBwEF1vqn4S0AeU +ZwQG+vj6wEWFYRL+LGRraxcWFurt5e3g4EAkECGBAO5RS5bs27svZFYI0MCvcEtnZ2evUavAo9CB +7N+/f8WKOPYE9jTuNB8fb5AO+QXyu6enh1EB8LiNtTUsBPoB748ElrcSw8kQoyP4sD5/vwkwvVR6 +v6F8u3UAtDmisQgAc0RjgbK+1GNze4eRNb9jMYgMNacOLPxjTh1YoDyQOhTm/4/GAmtzRGOBsqEY +mnM0FlibIxoLlEHG/wAMoLe4jQMBlwAAAABJRU5ErkJggk== + +------=_NextPart_01CC5782.4EF02DF0 +Content-Location: file:///C:/D088118C/email_files/image002.jpg +Content-Transfer-Encoding: base64 +Content-Type: image/jpeg + +/9j/4AAQSkZJRgABAQEAYABgAAD/2wBDAAoHBwgHBgoICAgLCgoLDhgQDg0NDh0VFhEYIx8lJCIf +IiEmKzcvJik0KSEiMEExNDk7Pj4+JS5ESUM8SDc9Pjv/2wBDAQoLCw4NDhwQEBw7KCIoOzs7Ozs7 +Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozv/wAARCAAlAHgDASIA +AhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQA +AAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3 +ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWm +p6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEA +AwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSEx +BhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElK +U1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3 +uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwD2HFGK +KKYgxRiiigAxWdc67p9prFrpMs3+l3WTGgGegzz6dDVm+vBaW7OqGWXB8uJSNzn0Fcvpb6RN4iu9 +Vuw39oW1vunkJzDCAMNt/Lr9a1hBNOTIlKzUUdhijFYsfjLw3LfRWUesWrTzLujUPwwxnr0/CpLD +xVoOqag+n2OpwT3SZzGp54649fwrIs1sUYrITxXoMmsf2RHqkD324r5Kkk7h1GemfaotR8Y6DYXU +unyatbR3qqcRlvutjgE9B+NAG5ijFcp4a8X20nhbT73XdRt4bq5ieUlsJuVWIJArW0/xRoeqQ+bY +6lDOnmiL5c5DnoCOozQBq4oxRRQAYooooAKKSigDFn8WabBdT22JibfIkkMZWJSOxc8VWtfFNzfX +UVtBpMy+aRiUsGQL/eyO1bd7YWmowCC9gSeIMG2OMjI6Go7TSbCxup7q2tlimuMeY4J+bHQew9hW +icLbGl6fLtqZd5YXTu11cWzXLwHMW1/v891HYelRX1qlv4I1eU2cNrNNaTNIsfc7TjNdKcEYNVxp +9oLJ7LyV+zyKyvGehB6ik6jasYKCTuea6vpWnr8FtM22sQO22bcFAbczDJz1ycmtrxTZWlhrng42 +sEcBW+MIKKFOwxnIz6V1cmj6dNpkemyWkbWcYUJCfurt6flipLrTrO9kt5Lm3SV7V98Jb+BsYyPw +qCzgLFrjwXe22nbbHUtO1G6cWd1Hjz4pHywDD+IZ/iqTweNCPw1uJb/7M0jCc3zTY3mTJzuzznpj +8K6qw8HeHdL1D7fZaVDFc5JDjJ2k9cAnA/Ckm8G+HJ9TbUpdIt2umO5nIOGPqVzgn3xQB574XtLW +9v8AwJHcQpLGthdSIrjIyG4NdXZW0EHxcv0iiRFk0mOR1VQAWEmA2PXHeujt9C0q0ktZLeyijezR +kgKj/Vq33gPrU40+0XUW1EQILtohE038RQHOPpmgCzRSUUALRSUUALRRRQAUUUUAFFFFABRRRQAU +UUUAFFFFABRRRQAUUUUAf//Z + +------=_NextPart_01CC5782.4EF02DF0 +Content-Location: file:///C:/D088118C/email_files/image003.gif +Content-Transfer-Encoding: base64 +Content-Type: image/gif + +R0lGODdh2AGOAHcAACH+GlNvZnR3YXJlOiBNaWNyb3NvZnQgT2ZmaWNlACwAAAAA2AGOAIEAAACA +gIDAwMD///8C/5yPqcvtD6OctNqLs968+w+G4kiW5omm6sq27gvH8kzX9o3n+s73/g8MCofEovGI +TCqXzKbzCY1Kp9Sq9YrNarfcrvfbBIgHYgD4jE6fzWa1+w2Ptsfxuv3Oo7cNe7I4ABgoOEhYaHiI +mKi4yNjo+AgZKTlJWWl5iZmpuQmo0dfHJyA6SlpqeoqaqrrK2ur6ChsrO0tba3uLm6u7y9srEODJ +BxrqW2x8jJysvMzc7PycClwCAF1tfY2drb3NbStNQt0tPk5ebn5+/j0Sjt7u/g4fL3+qLsI+j5+v +v8/PWx9yr5/AgQQL5vsHIqDBhQwbOnyG8IPChxQrWrz4KqKHif8YO3r82FBjB44gS5o8CU8kB5Io +W7p8eU3lBpYwa9q86c8ETZw8e/pcJdPTz6FEi5oKmmGn0aVMSyLFoLSp1KkPn16ISjWr1n5WLWDd +Cjbsu64Vvoo9i7YbWQpm07p9C1En3Ll0t62d0Lau3r3e5PL9C9jXXT9s6CDIGzix4lGD9wwjtjiy +ZKBJ5zxGPDnzXLKGHR8uAzq06NGkS5s+jTq16tWsW7t+DTu27Nm0a9u+jTu36MF8DgzDrDk42saW +FwAXjnwrbwjHkzuXuvxB8+fUi0Z3ML269p7XG2TfDr5mdwbfw5tHOd74+fVZ0ysozz7+RfcJ4Mu/ +75D+Yfz8fer/991fgDf9B5mABqLn14EKOpXggg5iRCAZD044X4MUXrhQhPZhyGE2GnYI4kAfhkii +PiOWiGI8J6bIIjortgjjOC/GSKM2M9aIYzXECfNbjj7GBFVvj0n4Y5HO8Fbce0YuuUxXhpHh22e6 +TUlllVZeiWWWWm7JZZen3TVHlPUxSeYxO/qhXplq5jTNmm7mcuObcroS55x2RmPhnXqiUueefvbp +p56ABmrnoITKaeihbiaqqJqMNkrmo5AuKemkRVZqqY+YZorjppzS6OmnMIYqKoukloriqaiSqOqq +IA65UZEbnjJrNrVa9ORVhCnpoxjL+MrMraQAi2uVlUGZZo5e//6anZfOPhtaMLkWqF1e0F6LbbZd +9hItW2H25pu24o5LbrnmnotubEmJuR9VxMKy7SuiHTMvMqHZey9TowU5LZFTkavLaMYIPHC+BRvM +VKsUTRkLwkURXJ3C3VgrG76guQpkmwa9W0psptR78MUYQyPxNhXLC/LIIU0j7LC8eKxyUwSWwaws +s8Uc1n/prvaxwzhPpfPONKPs888Jr1P0yyIbvZ1+EPuSMtPUlUxr1FInR/XV/GWt9X1cdx3f12Cv +J/bY5pVtNnhop62dhkK/DXfccs9N9x86rQArQHjvrULeCfGdgt9/Bw74OoXf3ffhiKMguESKT5N4 +5HhMTnnllttfjnnmmm/Oeeeefw566KKPTnrppTc+Euozqb5S4P0izfjr9rDuCe26oom47WUJA47u +XoELObInyD444Y/bA3zwvkswxrewE78SG8kXb/zwfS/v7fXY44X39nhB37rzhgsPzmHlu378395z +z/j047dPvvV3i498/PWDvy788K8vXRmS564/+fEPO+7TG/30Zj8Dym94/mNg+hIyQOZE0Dvdu97+ +JvieAqqvgabroAc/CMIQinCEJCyhCU+IwhSqcIUsbKELXwjDGMpwhjSsoQ1viMMc6nCHPJxcAQAA +Ow== + +------=_NextPart_01CC5782.4EF02DF0 +Content-Location: file:///C:/D088118C/email_files/image004.gif +Content-Transfer-Encoding: base64 +Content-Type: image/gif + +R0lGODdh1wGNAHcAACH+GlNvZnR3YXJlOiBNaWNyb3NvZnQgT2ZmaWNlACwAAAAA1wGNAIcAAAAd +HR0WFhYUFBQaGhoZGRkKCgoNDQ0MDAwTExMICAgJCQkHBwcFBQUfHx8VFRUPDw8EBAQBAQEODg4S +EhIGBgYcHBwbGxsXFxcLCwseHh4DAwMyMjIpKSkrKys5OTk+Pj4sLCwkJCQ0NDQgICAvLy8iIiI7 +OzsqKio1NTUuLi4tLS09PT0lJSU/Pz8hISEnJycxMTE6Ojo2NjYmJiYwMDAoKCg4ODg3Nzc8PDwj +IyMzMzNCQkJDQ0NRUVFMTExOTk5LS0tBQUFGRkZERERNTU1UVFRSUlJTU1NcXFxKSkpPT09QUFBI +SEhXV1daWlpAQEBHR0dFRUVdXV1WVlZVVVVfX19eXl5YWFhbW1tJSUl0dHR+fn57e3t8fHx5eXli +YmJgYGB4eHh1dXVjY2Nzc3Nubm5ycnJvb29kZGRxcXFwcHBmZmZoaGhsbGx2dnZ9fX1lZWVqampt +bW1ra2t3d3dpaWl/f39hYWF6enpnZ2eFhYWOjo6Li4uIiIiKioqNjY2Pj4+Hh4eAgICUlJSSkpKM +jIyGhoafn5+Dg4OBgYGVlZWJiYmampqQkJCCgoKEhISWlpaRkZGXl5eenp6cnJyYmJidnZ2Tk5Ob +m5uZmZm+vr6xsbG9vb23t7e1tbW7u7u0tLS6urqrq6utra2mpqapqam8vLyoqKilpaWkpKS/v7+h +oaGvr6+goKCjo6Ozs7OqqqqwsLCsrKy5ubm2tra4uLiurq6ioqKysrLb29va2trd3d3Z2dnBwcHQ +0NDCwsLX19fY2Nje3t7FxcXf39/ExMTAwMDR0dHNzc3Ozs7GxsbPz8/KysrMzMzDw8PU1NTJycnI +yMjHx8fS0tLLy8vT09PV1dXc3NzW1tb8/Pzl5eX7+/vk5OT9/f3u7u719fX+/v7x8fHo6Ojv7+/h +4eHt7e3w8PD5+fnn5+fg4ODr6+v39/fs7Ozz8/Pm5uby8vLj4+P6+vr29vb4+Pj09PTq6uri4uLp +6en///8BAgMBAgMBAgMBAgMBAgMBAgMI/wDzCRxIsKDBgwgTKlzIsKHDhxAjSpxIsaLFixgzatzI +saPHjyBDihxJsqTJkyhTqlzJsqXLlzBjypxJs6bNmzhz6tzJs6fPn0CDCh1KtKjRo0iTKl3KtKnT +p1CjSp1KtarVktp07drGrdsuXt6uih1LtmzEbxw6OOgVwMMHcGbjyp0rNpw4XyB+CQDGja7fv4CN +agsmLNy4EN/IiRgxLGw+bsKClTNHubLly5gza97MubPnz6BDix5NurTp06hTq17NurXr1+fCQfwW +ggO6dCTICVTn4JvAdSVMDNjDp4/x48iTK1/OvLnz59CjS59Ovbr169iza9/Ovbv37+C9+//5A/dh +OHbs8pUj0G7wphPnBJ4PVoCTr0748+vfz7+///8ABijggAQWaOCBCCao4IIMNujggxBGKOGDm3jS +hzsUvcMDOOKgkAI8BcUTwCfE+GLiiSimqOKKLLbo4oswxijjjDTWaOONOOao44489ujjj0D2CAwo +gGBIkWPoyGNQMQGEYswxUEYp5ZRUVmnllVhmqeWWXHbp5ZdghinmmGSWaeaZaKap5pm+iFIkSEw6 +ueacdNZp55145qnnnnz2+WWbb34U55N+FmrooYgmquiijLLpppEeDdropJRWaumlmGYaJaCQdiSp +pqCGKuqopJa66aNwNkmoqay26uqrsJr/yWmqcsZq66245mrqrIKqquuvwAYrrJ+8RurrsMgmq+yy +XRbr6bHMRivttME6y9Gn1Gar7bakWrsRttyGK+64iXqrEbjkpqvuumuamxG67MYr77xauosRvPTm +q6+89l6E774AB8xtvxb9K/DBCCtLcEUGJ+zww7guTFHDEFdscakST0TxxRx3bGnGEm3s8cgkHwoy +QfJ0Mkoo4GwyCid9DSRyyTTXfOfJA6VjQA8+7HJADz/MQ9DMNhdttKyoStQNAqPk040BpBj0jQPH +IJPM1VhnrfXWXHft9ddghy322GSXbfbZaKet9tpst+3223DH7bYyy/DRKUP0lGJKO0Dw/3DKN0Hw +4ImS+cyDSiAJbMFFF4w37vjjkEcu+eSUV2755ZhnrvnmnHfu+eeghy766KSXbvroXnwhSHkOnSPE +EOlpo0A7+aCzAO35mEPECAygoMIKwAcv/PDEF2/88cgnr/zyzDfv/PPQRy/99NRXb/312GevPfYl +DELPRPSkQggY66hSSBidruPAJsw04/778Mcv//z012///fjnr//+/Pfv//8ADKAAB0jAAhrwgAgs +oDOMYbeJnIMIRciHO3gQwYKoo0klCpIGN8jBDnrwgyAMoQhHSEIaASNpxqrV0VbIwjTh7CFEa6EM +ZzilFzokhjTMYQtt2BAc6vCHReMhQ/98CMQikkyICyGiEZd4MSQqRIlMjKLDnJgQKErxigGjIkKs +iMUu0kuLB+GiF8e4LjAuCVpkTOPDzFgQMarxjdpi49DQCMc66kuOMqOjHfcYLzwKxI18DGS1UPgs +FQrykOPyYz4AichGwkqRjHSkJHdFyGvpcZKYRBYkL5nJTv5qk4b0pCh1BcpVjfKUt+KhGLiQD3kY +Ygzem2MoUUnLVr2QHGIgQxkEsYsFmOEM38vjLGtJzFHd0gvc6IMhdtGAQxgEHg54BjR+Qc1qWvOa +2MymNrfJzW5685vgDKc4x0nOcprznOhMpzrXyc52unOdyIgGH0DkkHqcYQzayMc50ID/iHN0IQ2G +SE8+xFGGMCCgCEY4gkIXytCGOvShEI2oRCdK0Ypa9KIYzahGN8rRjnr0oyANqUhHStKQIuEIiRBa +Pc2ghnQoQiAAwB0A1iEQcawhCQhQgg+WwNOe+vSnQA2qUIdK1KIa9ahITapSl8rUpjr1qVCNqlSn +StWqWnWqTFhCSiVyji2woQ2BaIcb0tAHgQoEmtJ8p1rXyta2uvWtcI2rXOdK13HGc54UWcMb8sEO +M4jhjMMspmAzVcrBGjZUhT2sYi+V2MU6tlGNfaxkERXZyVq2T5W9rGbxlNnNenZOnf2saB0VqBSa +crSoRVppC3na1Lo2TKF9rWzrVclv/3Fytri1Umxzy9tTrdaSge2tcHcr3NwSt7izPS5yX6vc5aa2 +uc4drS9AsYh60Kq1il2FNKSxCjytIhrT6G6uVtEMYohXYMZYRRPscd3JroIagyhDNe60Cmu8AQ7z +9W40lnFeOyGDDISIhrKcEbdfSIMICzCrRLgxhm6AoQlOUOkfbyvYavThAUgohty01gtBQCAOwujv +nOorB0Y0o0zf9ZoyrjGHCDACGxuOsdqYUQ0jCOHGOM6xjnfM4x6wAAASeAI9I0IOEEzgFxRoBCsI +N+HgGnEVy4iGiLMEZbMVIw0AIMEQoMDlLnv5y2AOM5ijMAAAtIAQwpDx1YLxhQWIgf8XbMsGHcQM +BSFIgQEAKIEU6MznPvv5z4D+Mw9cAIBCG/rQiE60ohMdzIiwgxEisEYFpmAQczhgFb9whqY3zelO +e/rToA61qEdN6lKb+tSoTrUzgtEHOgQD1cJwhAtA4IJa2/rWtqY1EV6w6F77+teGtoAUaI3rYhv7 +2LgGAREOAIAO9GDWyI52rXuwAGBb+9rYzra2rd2FQgDi2+AOt7jHHW5HHAIBhW4AFYbMkHNE4Qfc +mAcMttEKPqTBSOZQwgcYoAIOxODfAA+4wAdO8IIb/OAIT7jCF27wFLBABjHggMQnTvGK+3sGLMi4 +xjfOcY334AI767jIPR6AbZv85Cj/T7nKV87ylrscACkYtLRn7oLXVeDQCl4IO1zxCm104wW64cbs +BDIPVvyBAmj4whuWzvSmO/3pUI+61KdO9apb/ep1yLrWsz4IIADAAX14hNjHTvayPwIQTHg5sDng +CEi4/e1wf3sgooBoIkQiEXHPu973LvcTIJoJi8A73wc/+EREYgSHrgIfCM94ve+hDzRAdBscIfjG +W/7ymM983MVwdap/AQ2JJkJ8IqIOC+xiCDyABZPzMbVjUEPNsFcx2pRB+9rTPhnI6IXud9+LdEQC +ABgoQhOiQPziG//4RVCB2gFQA0ns4fnQf74qrCG2YtgB0RjwQy/kVgwqIDoAi9i+/9yCwQUCHPoP +5diwMnaB+EN3IBbZiL3859++PhxCEWAwhSxKkfOGzOMY4pAKsQBY2NUqq2AMAqZbK3IMz1ANDviA +DngNrPABFFiBH8ACNoByNiAJgtCBHviBHngIkfAEhzYDhQCCgjB9XRNeW0IMqQCCg9AIy7AmxOAK +IHgHrjCDa/ILM4BoBOAI+aUmzzAJIAgHs1CAZeQMyjANkxASkYQoq1ANrIAEGYQiDAiBEAgNr3AD +ONCFXogDOaADwOYBkuAHZniGaJiGfuAKrxc2wkAJKJB43UBgWcNdKLYMW8OCarIK07A1/DUnxlAJ +aTgIpUAMIxYNW5NeWVRbGnFBTv/mQmqyItKQCiJgAtbgDFhoDaXAhV/YhTnQAr5GAo7ACGYoCVaA +aD1QDnQoNnaoJcgwB4iWAW4QhPSiXVtjXlikSOugAY94Js+QgF7CIgw4P8FgCQBwAB+AAzOwjMso +A6DYaxogCX/ACNRYjYxwCVZzNboACIjGAFcAjGliDKNgjYwACZFgiNFFKX5kDlCQAMdQhRt0DNEw +CkFwDMAgI8M4P9QQCykwAv7ojylwAx3waxdQCIawHJfwC10jZVFiDLKQHIJQCEg4JqtADFvTiukI +WYyIEd8AABvAA3gYDSI5kiRZkiZ5kiX5C7BAAwPQDM6AkiaJDLMwAjtQkza5AzP/8Iy+9gKYAAiG +8JM/WQnMkAyfxpBacoCehpEZKS149A1EsAGFVgM7YHFUWZVWOXEpAAMAoAA1eZUUlwI6qWgYUAh8 +UJaRAIuHFgO6QJScZpRL2UQbaRHksHx0+QCF4AiBkJd6GQiVoAybJgyZgGgbAATT4AtvSTNyxI4S +YGgQUAiE4AiQGZmSOZmUWZmRaQmDcGgFgAl3aZmTWQls6Wng+AyfMJmAUAjAcJiIGZcUsQ2JJgTS +QGNYOJu0WZsOSA2eUAOHpgPWoAy2iYXgiCWr0IDAOWWqCZe/hRHosAzPEAsC8AeLwAebYJhqEg2I +gGgSIATAkJrHyUeK1A7r0z50/wIMtEAI5mmehVAIx0Cd3WlH0AUmwDCbwdmecPSe9KlY9nmfhpWf ++ilYm1QLy7CdAjqgBFqgBnqgCJqgCrqgDNqgDvqgEBqhEjqhFFqhFnqhGJqhGrqhGfoMp5Cc5zIi +8MhBwPAMIVSiIoSiJ2qiIfQMLPpBz3CPLSqjIBSjImSjNUqjHTQkDfQR3XAAGvACJDCkRFqkRnqk +SJqkLyACSdqkTuqkS/qkUjqlQ2oCOkClWNqkVpqlXGqkOnClXdqlOmACYRqmY1qmYkqmaJqlIiCk +a0qlbfqmVKoDitBoHTEMFwAK07CnfNqnfvqngBqo05AJD0AMgnqoiPqnf6ABif/aqI1aBx3gqJIq +qGmQApN6qX7qA0OAqZwqBFjAqZzKAW4AqpgqAnBAqpdKAIGAqo4KDAnACqzqqLYQA+kAEthgAjEz +EtZgAyWxCSNgEqUgBCYBCD5gEmPABiWBB6xUEkXQhCVxAlFTEipgDCVBA7pQEuygAfcAEujQC/lE +EvOwCyXhDthgEuQwDCaxDuVgEunQDSXRDeNgEuqAOyTBC6NHErpgXSMRDrvQfx+hDbuweoExsARb +sAZ7sAibsAq7sAzbsA4bFLJREvKQqyIhD99aEhE7Et5gsSbBsSKhDR5LEhtrEiNLErIBsvsqHyn7 +GAKrEeHAC1JwNx4RDtlgA03/4Bgg4Q3R0AFP0LIzOwpJQBKxAAMoAAciqwke4AgjwQgoQAOVQBLc +8AYe0AoXCxLyEAceAAwZ6xHyUATS4A1HYAPIsLUcMQ9DELBSIAwhgQ89sA71sAMrQK8bgQ8vAAGs +AxLUwAPXcAtEQLYc4QtDoAyaUAUk0QkQIAUksQcjoAzvQBKHEAbRsA0j8Q7MIAV5QBJ2MAjRUAWq +MBJYwAfRMASfEBJGAADN4AS4gAxCMA0fEQ49AADZEAQAoLYfUQ8xUAHCEATG0Awn0LgcIQ+eYALs +9hHswAv50Awt4Lcb4Q7l0AxBQLsh4Q23AABMQBKNQAGJUBJwMAEx4AhV+xFc//AFcmurehADmMBe +IqEOUxADG5ALIYENHWAMI0CtMAAKIAENL3ANu+AA1pCzy+AA6tAY5qCtHvEONCAOJKEOKCAFtToS +O1esIjEKVCBrdvoR4KAOXJAGJHEGR9ALc7BXIoEFl0sScSAIvYC6JNENvbACpiASI3AMH3AM+YAC +nRASKAAN+QADyBAS4CAC6eANM6AC2fC9GYENL4DAIsGD0WANyrsRvlAE7BAKJTASpIAAGtAAcrCv +4XAIS0ASWxAH4WAGZDASWVAHJdEEgBAOQ6C0IuEEsBAOLDCAIaECxyAEnlAPNSDDHyEPkZYPJvAL +IdEOIkANUPAJyeCzGDEMHuCAxCEhab+jBCJRD7fQAkDQwCExD8PgBzngriIRCy3gBjQ1Et+wBy3g +BeYwEmRgtCRhD23QApUwvB5RDlXQAqNwtx4xA8cwDlrQAqLgrxkhDypwDfkQAtQQEuZQAtegAShQ +AhzgGx3BDT88EtxQDrqnDvvaC5xMEvIwvh9xDr3AzSDhDr1wr8ZMziKxDr1QwSCRDt46EuPwPfHQ +CyIRDumgJPUcvfW8DbvQC7pAxA/7zwAd0AI90ARd0AZ90Aid0Aq90Azd0A790BAd0RI90RRd0RZ9 +0Rid0Rq90Rzd0QwdEAA7 + +------=_NextPart_01CC5782.4EF02DF0 +Content-Location: file:///C:/D088118C/email_files/filelist.xml +Content-Transfer-Encoding: quoted-printable +Content-Type: text/xml; charset="utf-8" + + + + + + + + + + + +------=_NextPart_01CC5782.4EF02DF0-- diff --git a/testData/PdfWithAcroForm.pdf b/testData/PdfWithAcroForm.pdf new file mode 100644 index 0000000..9577504 Binary files /dev/null and b/testData/PdfWithAcroForm.pdf differ diff --git a/testData/PdfWithAnnotations.pdf b/testData/PdfWithAnnotations.pdf new file mode 100644 index 0000000..44f9e7d Binary files /dev/null and b/testData/PdfWithAnnotations.pdf differ diff --git a/testData/PdfWithBookmarks.pdf b/testData/PdfWithBookmarks.pdf new file mode 100644 index 0000000..21c02fb Binary files /dev/null and b/testData/PdfWithBookmarks.pdf differ diff --git a/testData/PdfWithEmbeddedFiles.pdf b/testData/PdfWithEmbeddedFiles.pdf new file mode 100644 index 0000000..5cf1f7a Binary files /dev/null and b/testData/PdfWithEmbeddedFiles.pdf differ diff --git a/testData/PdfWithImages2.pdf b/testData/PdfWithImages2.pdf new file mode 100644 index 0000000..ccb58f3 Binary files /dev/null and b/testData/PdfWithImages2.pdf differ diff --git a/testData/PdfWithLinks.pdf b/testData/PdfWithLinks.pdf new file mode 100644 index 0000000..f99c0f1 Binary files /dev/null and b/testData/PdfWithLinks.pdf differ diff --git a/testData/PdfWithXfaForm.pdf b/testData/PdfWithXfaForm.pdf new file mode 100644 index 0000000..3ddd022 Binary files /dev/null and b/testData/PdfWithXfaForm.pdf differ diff --git a/testData/Penguins.emf b/testData/Penguins.emf new file mode 100644 index 0000000..95f32ad Binary files /dev/null and b/testData/Penguins.emf differ diff --git a/testData/Penguins.jpg b/testData/Penguins.jpg new file mode 100644 index 0000000..660a458 Binary files /dev/null and b/testData/Penguins.jpg differ diff --git a/testData/Simple.svg b/testData/Simple.svg new file mode 100644 index 0000000..7a120db --- /dev/null +++ b/testData/Simple.svg @@ -0,0 +1,12 @@ + + + + + + + diff --git a/testData/Simple.xps b/testData/Simple.xps new file mode 100644 index 0000000..480c9ab Binary files /dev/null and b/testData/Simple.xps differ diff --git a/testData/TexExample.tex b/testData/TexExample.tex new file mode 100644 index 0000000..f1e58bf --- /dev/null +++ b/testData/TexExample.tex @@ -0,0 +1,305 @@ +%% Introduction to latex facilities. +%% Sat 31 Dec 2005 +%% Stephen Eglen. + +%% Text following a percent sign (%) until the end of line is treated +%% as a comment. + +\documentclass{article} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% This section is called the preamble, where we can specify which +%% latex packages we required. Most (but not of all) of the packages +%% below should be fairly standard in most latex documents. The +%% exception is xspace and the new \latex command, which you probably +%% do not need. +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%% Better math support: +\usepackage{amsmath} + +%% Bibliography style: +\usepackage{mathptmx} % Use the Times font. +\usepackage{graphicx} % Needed for including graphics. +\usepackage{url} % Facility for activating URLs. + +%% Set the paper size to be A4, with a 2cm margin +%% all around the page. +\usepackage[a4paper,margin=2cm]{geometry} + +%% Natbib is a popular style for formatting references. +\usepackage{natbib} +%% bibpunct sets the punctuation used for formatting citations. +\bibpunct{(}{)}{;}{a}{,}{,} + +%% textcomp provides extra control sequences for accessing text symbols: +\usepackage{textcomp} +\newcommand*{\micro}{\textmu} +%% Here, we define the \micro command to print a text "mu". +%% "\newcommand" returns an error if "\micro" is already defined. + +%% This is an example of a new macro that I've created to save me +%% having to type \LaTeX each time. The xspace command provides space +%% after the word LaTeX where appropriate. +\usepackage{xspace} +\providecommand*{\latex}{\LaTeX\xspace} +%% "\providecommand" does nothing if "\latex" is already defined. + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% Start of the document. +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\begin{document} + +\author{Stephen J. Eglen\\ + Department of Applied Mathematics and Theoretical Physics\\ + University of Cambridge\\ + Wilberforce Road\\ + Cambridge CB3 0WA U.K.} +\date{\today} +\title{A short example of how to use \latex for scientific reports} +\maketitle + +\begin{abstract} + The purpose of this short document is to provide a brief overview of + the facilities that \latex offers for formatting scientific reports. + Furthermore, the source files for regenerating this report are + freely available so that users can easily start writing their own + reports using \latex. +\end{abstract} + +\section{Introduction} + +\latex is a typesetting program; given an input file with formatting +instructions (e.g intro.tex), the program will create your document in +one of several formats (DVI, Postscript or PDF). It is therefore not +a WYSIWYG word processor. \latex is known as a logical markup +language, similar for example to HTML, so that you describe a piece of +text as a ``section heading'' rather than saying that it should be +formatted in a certain way. It has excellent facilities for +typesetting mathematics, and handles large documents (such as theses) +well. The aim of this document is not to provide an overview of +\latex, since many other guides have already been written (see +Section~\ref{sec:summary}). Instead, it has been written primarily to +provide simple workable examples that you can cut and paste to help +you get started with \latex. The examples have been selected to be +those most likely to be useful when writing a scientific report. This +document is best read by comparing the source code with the resulting +output. + +\section{Running \latex} + +The files to accompany this paper are at: +\url{http://www.damtp.cam.ac.uk/user/eglen/texintro}. Get the +following files and put them into a new directory. + +\begin{enumerate} +\item \url{intro.tex}: the main \latex document. +\item \url{example.bib}: a short bibliography. +\item \url{sigmoid.ps}: example postscript image. +\item \url{sigmoid.pdf}: example PDF image. +\end{enumerate} + +Change directory to where you stored the files and type the +following (ignoring comments placed after \#\#): + +\begin{verbatim} +latex intro ## Run latex 1st time. +bibtex intro ## Extract required references +latex intro ## Run latex 2nd to resolve references. +latex intro ## Probably need to run latex a 3rd time. +xdvi intro ## View the DVI (device independent) file. +dvips -o intro.ps intro ## Create a postscript file for printing. +\end{verbatim} + +You will notice that you run latex several times here; this is so that +references can be resolved, and references can be extracted from your +bibtex file. After running latex, you will be told if you need to run +it again to resolve references. After a while, you will get the idea +of how many times you need to run latex to resolve all your +references. + +If instead you would like to generate PDF files (see +Section~\ref{sec:graphics} for a discussion of file formats for +included images), you can try the following shorter sequence: + +\begin{verbatim} +pdflatex intro +bibtex intro +pdflatex intro +pdflatex intro +xpdf intro.pdf ## View the resulting PDF +\end{verbatim} + +Whether you prefer to generate DVI or PDF is up to you. The xdvi +viewer has some nice features, such as it can reload your document +easily and has a ``magnifying glass'' that is activated by the mouse. +On the other hand, xpdf will display the document more accurately as +it will be printed. + +\section{Tables} + +Tables are relatively straightforward to generate. Note that tables +and figures are not always placed exactly where you wish, as +they can \textit{float} to other parts of the document. Rather than +trying to battle with \latex as to where they are placed, concentrate +first on getting the right content and let \latex worry about the +positioning. Instead, use labels to your tables to refer to them. +See Table~\ref{tab:simple} and Table~\ref{tab:pars} for examples. + +\begin{table} + \centering + \begin{tabular}{ccc} + year & min temp (\textdegree C) & max temp (\textdegree C)\\ + \hline + 1970 & $-5$ & 35\\ + 1975 & $-7$ & 29\\ + 1980 & $-3$ & 30\\ + 1985 & $-2$ & 32\\ + \end{tabular} + \caption{Fictional minimal and maximal temperatures recorded in + Cambridge over several years.} + \label{tab:simple} +\end{table} +%% Why are the negative numbers above enclosed in math mode? +%% Hint: consider the difference between "-" in text and in math. + +\begin{table}[htbp] + \centering + \begin{tabular}{lccc}\\ \hline + & \multicolumn{1}{c}{$\phi$ (\micro m)} + & \multicolumn{1}{c}{$\alpha$} + & $\delta_{12}$ (\micro m)\\ \hline + W81S1\\ + $h_{11}(u)$ & 67.94 & 7.81\\ + $h_{22}(u)$ & 66.27 & 5.40\\ + $h_{12}(u)$ & & &18\\ + \hline + M623\\ + $h_{11}(u)$ &112.79 & 3.05\\ + $h_{22}(u)$ & 65.46 & 8.11\\ + $h_{12}(u)$ & & &20\\ + \hline + \end{tabular} + \caption{Summary of parameter estimates for the univariate + functions $h_{11}(u)$, $h_{22}(u)$ and the bivariate function + $h_{12}(u)$. For the univariate fits, $\alpha$ and $\phi$ are + least-square estimates (assuming $\delta$ was fixed at 15 \micro m). + The final column gives the + maximum likelihood estimate of $\delta_{12}$ assuming that the + interaction between types is simple inhibition. + \label{tab:pars}} +\end{table} + + +\section{Bibliography management} + +Scientific reports normally require a section where your references +are listed. Bibtex is an excellent system for maintaining references, +especially for large documents. Each reference needs a unique key; +you can then refer to the reference in your \latex document by using +this key within a cite command. + +Take care when formatting your references, especially when it comes to +writing authors names and the case of letters in journal titles. In +our examples, the files are found in \url{example.bib}. As an example +of a citation, see \citep{ihaka1996} or \citep{ihaka1996,venables1999}. + +Bibtex is flexible enough to format your references in a wide number +of different styles to suit your needs. In this file I have used the +``natbib'' package, which is suitable for the natural sciences. +Depending on the type of cite command you get (and the package that +you use for citations), you can get different styles of citation. See +Table~\ref{tab:cite} for some examples. + +\begin{table} + \centering + \begin{tabular}{ll} + \hline + command & result\\ \hline + \verb+\citep{ihaka1996}+ & \citep{ihaka1996}\\ + \verb+\citet{ihaka1996}+ & \citet{ihaka1996}\\ + \verb+\citep[see][p. 300]{ihaka1996}+ & + \citep[see][p. 300]{ihaka1996} + \\ + \verb+\citeauthor{ihaka1996}+ & \citeauthor{ihaka1996} + \\ + \verb+\citeyear{ihaka1996}+ & \citeyear{ihaka1996} + \\ + \hline + \end{tabular} + \caption{Examples of different citation commands available in the + natbib package.} + \label{tab:cite} +\end{table} + + +\section{Graphics} +\label{sec:graphics} + +\latex can include images in one of several format, depending on +whether you use latex (postscript format required) or pdflatex (either +jpeg, png or pdf required). Figures can be included either at their +natural size, or you can specify e.g. the figure width. +Figure~\ref{fig:example} shows an example image which intentionally +looks slightly different depending on whether you compile the document +with latex or pdflatex. Note that in this example the suffix of the +image file is not included so that this document compiles under both +latex and pdflatex. + +\begin{figure} + \centering + \includegraphics[width=6cm]{sigmoid} + \caption{Example of a sigmoidal curve generated by the R programming + environment. The title above the curve indicates whether you have + included the postscript or the pdf version of the figure.} + \label{fig:example} +\end{figure} + +\section{Mathematics} + +\latex can format mathematics with ease, either in line, such as +$x \times y$, or on separate lines, such as: +\[ x^2 +y^2 = z^2 \] + +If you are writing several lines of equations, you can use statements +like the following: + +\begin{align} + b(t) & = s(t) - \int_{0}^{T} a(t') \cdot i(T-t') dt' + \\ + a(t) & = \int_{0}^{T} b(t) \cdot e(T-t') dt' \label{eq:am} + \\ + g(t) & = b(t) \ast e(t) \nonumber +\end{align} + +By using labels on certain equations, we can refer to equations by +number, such as equation~(\ref{eq:am}). + +\section{Summary} +\label{sec:summary} +This short guide should give you a flavour of what can be done with +\latex. It is by no means complete, or supposed to be +self-explanatory. It is, however, hopefully enough to get you +started! Try experimenting by editing the source file and then +recompiling this document. As mentioned earlier, there are many +guides for latex. Two that I can recommend are +\url{http://www.andy-roberts.net/misc/latex/index.html} and +`` The (Not So) Short Introduction to LaTeX2e'' +(\url{http://ctan.tug.org/tex-archive/info/lshort/english/lshort.pdf}). + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% Finally we specify the format required for our references and the +%% name of the bibtex file where our references should be taken from. +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\bibliographystyle{plainnat} +\bibliography{example} + +\end{document} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% The end. +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \ No newline at end of file diff --git a/testData/XslfoExample.xslfo b/testData/XslfoExample.xslfo new file mode 100644 index 0000000..9362138 --- /dev/null +++ b/testData/XslfoExample.xslfo @@ -0,0 +1,246 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Copyright (c) 2010, Alle Rechte vorbehalten. Inhalte dürfen ohne die Genehmigung des Herausgebers nicht kopiert oder weitergegeben werden. + + + + + + + + + + + + + + + + + + + + + + + + + + + Andritz erhält Auftrag für Glüh- und Beizlinie aus Taiwan + + + + Staff Reporters + + 09 December 2010 + + Stahl Monitor + + Nachrichten + + + + + + GRAZ --Der Grazer Technologiekonzern Andritz hat einen Auftrag für 70 Mio EUR an Land gezogen. An die taiwanische Walsin Lihwa Corporation liefert der Konzern nach Angaben vom Donnerstag eine Glüh- und Beizlinie für Edelstahlwarm- und -kaltband mit einer Jahreskapazität von 350.000 Tonnen. Die Inbetriebnahme sei für Ende 2012 geplant. + + + + + + + 0020101209e6c900001 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Materialbezeichnung + + + + + + + + + + Platin + + + + + + + Art + + + + + + + + + + Platin Fortlaufend + + + + + + + + US-Dollar (USD) + | + Feinunze + + + + + + + + + + + Seite | Exportiert am: 10/12/10 + + + + + + + + + + + + + + + + + + + + + + + + + + + Copyright 2010 Alle Rechte vorbehalten. Inhalte dürfen ohne die Genehmigung des + + + Herausgebers nicht kopiert oder weitergegeben werden. + + + + + + + + + + + Historische Preise + + + + + + + + + + + + \ No newline at end of file diff --git a/testData/butterfly.jpg b/testData/butterfly.jpg new file mode 100644 index 0000000..02d05c0 Binary files /dev/null and b/testData/butterfly.jpg differ diff --git a/testData/marketing.pdf b/testData/marketing.pdf new file mode 100644 index 0000000..2f0aa80 Binary files /dev/null and b/testData/marketing.pdf differ diff --git a/testData/rusdoc.pdf b/testData/rusdoc.pdf new file mode 100644 index 0000000..ec7f5cc Binary files /dev/null and b/testData/rusdoc.pdf differ diff --git a/testData/template.pcl b/testData/template.pcl new file mode 100644 index 0000000..cbe17ae Binary files /dev/null and b/testData/template.pcl differ diff --git a/testData/template.xml b/testData/template.xml new file mode 100644 index 0000000..f66c324 --- /dev/null +++ b/testData/template.xml @@ -0,0 +1 @@ +Sample Text_x0038_.4Its test to set column width as per contnents
\ No newline at end of file diff --git a/testData/test1234.pfx b/testData/test1234.pfx new file mode 100644 index 0000000..eea1e8f Binary files /dev/null and b/testData/test1234.pfx differ