public ServiceCall < Entity > updateEntity ( UpdateEntityOptions updateEntityOptions ) { Validator . notNull ( updateEntityOptions , "updateEntityOptions cannot be null" ) ; String [ ] pathSegments = { "v1/workspaces" , "entities" } ; String [ ] pathParameters = { updateEntityOptions . workspaceId ( ) , updateEntityOptions . entity ( ) } ; RequestBuilder builder = RequestBuilder . post ( RequestBuilder . constructHttpUrl ( getEndPoint ( ) , pathSegments , pathParameters ) ) ; builder . query ( "version" , versionDate ) ; Map < String , String > sdkHeaders = SdkCommon . getSdkHeaders ( "conversation" , "v1" , "updateEntity" ) ; for ( Entry < String , String > header : sdkHeaders . entrySet ( ) ) { builder . header ( header . getKey ( ) , header . getValue ( ) ) ; } builder . header ( "Accept" , "application/json" ) ; final JsonObject contentJson = new JsonObject ( ) ; if ( updateEntityOptions . newEntity ( ) != null ) { contentJson . addProperty ( "entity" , updateEntityOptions . newEntity ( ) ) ; } if ( updateEntityOptions . newDescription ( ) != null ) { contentJson . addProperty ( "description" , updateEntityOptions . newDescription ( ) ) ; } if ( updateEntityOptions . newMetadata ( ) != null ) { contentJson . add ( "metadata" , GsonSingleton . getGson ( ) . toJsonTree ( updateEntityOptions . newMetadata ( ) ) ) ; } if ( updateEntityOptions . newFuzzyMatch ( ) != null ) { contentJson . addProperty ( "fuzzy_match" , updateEntityOptions . newFuzzyMatch ( ) ) ; } if ( updateEntityOptions . newValues ( ) != null ) { contentJson . add ( "values" , GsonSingleton . getGson ( ) . toJsonTree ( updateEntityOptions . newValues ( ) ) ) ; } builder . bodyJson ( contentJson ) ; return createServiceCall ( builder . build ( ) , ResponseConverterUtils . getObject ( Entity . class ) ) ; }
Update entity .