public ServiceCall < FeedbackReturn > addFeedback ( AddFeedbackOptions addFeedbackOptions ) { Validator . notNull ( addFeedbackOptions , "addFeedbackOptions cannot be null" ) ; String [ ] pathSegments = { "v1/feedback" } ; RequestBuilder builder = RequestBuilder . post ( RequestBuilder . constructHttpUrl ( getEndPoint ( ) , pathSegments ) ) ; builder . query ( "version" , versionDate ) ; Map < String , String > sdkHeaders = SdkCommon . getSdkHeaders ( "compare-comply" , "v1" , "addFeedback" ) ; for ( Entry < String , String > header : sdkHeaders . entrySet ( ) ) { builder . header ( header . getKey ( ) , header . getValue ( ) ) ; } builder . header ( "Accept" , "application/json" ) ; final JsonObject contentJson = new JsonObject ( ) ; contentJson . add ( "feedback_data" , GsonSingleton . getGson ( ) . toJsonTree ( addFeedbackOptions . feedbackData ( ) ) ) ; if ( addFeedbackOptions . userId ( ) != null ) { contentJson . addProperty ( "user_id" , addFeedbackOptions . userId ( ) ) ; } if ( addFeedbackOptions . comment ( ) != null ) { contentJson . addProperty ( "comment" , addFeedbackOptions . comment ( ) ) ; } builder . bodyJson ( contentJson ) ; return createServiceCall ( builder . build ( ) , ResponseConverterUtils . getObject ( FeedbackReturn . class ) ) ; }
Add feedback .