code: public ChatResult adaptResult(ComapiResult<?> result, Boolean success) {
  
          return new ChatResult(result.isSuccessful() && success, result.isSuccessful() ? null : new ChatResult.Error(result));
      }
docs: Translates Foundation result to Chat SDK result.
  
  @param result  Foundation result.
  @param success True if required Chat SDK processing was successful.
  @return Chat SDK result.