code: private PublishDocumentResponse publishDocument(PublishDocumentRequest request) {
          checkNotNull(request, "request should not be null.");
          checkNotNull(request.getDocumentId(), "documentId should not be null.");
          InternalRequest internalRequest = this.createRequest(HttpMethodName.PUT, request, DOC, request.getDocumentId());
          internalRequest.addParameter("publish", null);
          // need to set content-length, otherwise auth will failed
          // cause HTTP will set Content-Length auto when send http request
          internalRequest.addHeader(Headers.CONTENT_LENGTH, "0");
          PublishDocumentResponse response;
          try {
              response = this.invokeHttpClient(internalRequest, PublishDocumentResponse.class);
          } finally {
              try {
                  internalRequest.getContent().close();
              } catch (Exception e) {
                  // ignore exception
              }
          }
  
          return response;
      }
docs: publish a Document.
  
  @param request  The request object containing a documentId.
  
  @return A PublishDocumentResponse object containing the information returned by Document.