public ServiceCall < ToneAnalysis > tone ( ToneOptions toneOptions ) { Validator . notNull ( toneOptions , "toneOptions cannot be null" ) ; String [ ] pathSegments = { "v3/tone" } ; RequestBuilder builder = RequestBuilder . post ( RequestBuilder . constructHttpUrl ( getEndPoint ( ) , pathSegments ) ) ; builder . query ( "version" , versionDate ) ; Map < String , String > sdkHeaders = SdkCommon . getSdkHeaders ( "tone_analyzer" , "v3" , "tone" ) ; for ( Entry < String , String > header : sdkHeaders . entrySet ( ) ) { builder . header ( header . getKey ( ) , header . getValue ( ) ) ; } builder . header ( "Accept" , "application/json" ) ; if ( toneOptions . contentLanguage ( ) != null ) { builder . header ( "Content-Language" , toneOptions . contentLanguage ( ) ) ; } if ( toneOptions . acceptLanguage ( ) != null ) { builder . header ( "Accept-Language" , toneOptions . acceptLanguage ( ) ) ; } if ( toneOptions . contentType ( ) != null ) { builder . header ( "Content-Type" , toneOptions . contentType ( ) ) ; } if ( toneOptions . sentences ( ) != null ) { builder . query ( "sentences" , String . valueOf ( toneOptions . sentences ( ) ) ) ; } if ( toneOptions . tones ( ) != null ) { builder . query ( "tones" , RequestUtils . join ( toneOptions . tones ( ) , "," ) ) ; } builder . bodyContent ( toneOptions . contentType ( ) , toneOptions . toneInput ( ) , null , toneOptions . body ( ) ) ; return createServiceCall ( builder . build ( ) , ResponseConverterUtils . getObject ( ToneAnalysis . class ) ) ; }
Analyze general tone .