public ServiceCall < HTMLReturn > convertToHtml ( ConvertToHtmlOptions convertToHtmlOptions ) { Validator . notNull ( convertToHtmlOptions , "convertToHtmlOptions cannot be null" ) ; String [ ] pathSegments = { "v1/html_conversion" } ; RequestBuilder builder = RequestBuilder . post ( RequestBuilder . constructHttpUrl ( getEndPoint ( ) , pathSegments ) ) ; builder . query ( "version" , versionDate ) ; Map < String , String > sdkHeaders = SdkCommon . getSdkHeaders ( "compare-comply" , "v1" , "convertToHtml" ) ; for ( Entry < String , String > header : sdkHeaders . entrySet ( ) ) { builder . header ( header . getKey ( ) , header . getValue ( ) ) ; } builder . header ( "Accept" , "application/json" ) ; if ( convertToHtmlOptions . model ( ) != null ) { builder . query ( "model" , convertToHtmlOptions . model ( ) ) ; } MultipartBody . Builder multipartBuilder = new MultipartBody . Builder ( ) ; multipartBuilder . setType ( MultipartBody . FORM ) ; RequestBody fileBody = RequestUtils . inputStreamBody ( convertToHtmlOptions . file ( ) , convertToHtmlOptions . fileContentType ( ) ) ; multipartBuilder . addFormDataPart ( "file" , convertToHtmlOptions . filename ( ) , fileBody ) ; builder . body ( multipartBuilder . build ( ) ) ; return createServiceCall ( builder . build ( ) , ResponseConverterUtils . getObject ( HTMLReturn . class ) ) ; }
Convert document to HTML .