code: public Sheet sortSheet(long sheetId, SortSpecifier sortSpecifier, Integer level) throws SmartsheetException {
          Util.throwIfNull(sortSpecifier);
  
          String path = "sheets/" + sheetId + "/sort";
          if (level != null) {
              path += "?level=" + level;
          }
  
          HttpRequest request = createHttpRequest(smartsheet.getBaseURI().resolve(path), HttpMethod.POST);
  
          ByteArrayOutputStream objectBytesStream = new ByteArrayOutputStream();
          this.smartsheet.getJsonSerializer().serialize(sortSpecifier, objectBytesStream);
  
          HttpEntity entity = new HttpEntity();
          entity.setContentType("application/json");
          entity.setContent(new ByteArrayInputStream(objectBytesStream.toByteArray()));
          entity.setContentLength(objectBytesStream.size());
          request.setEntity(entity);
  
          Sheet obj = null;
          try {
              HttpResponse response = this.smartsheet.getHttpClient().request(request);
              switch (response.getStatusCode()) {
                  case 200: {
                      InputStream inputStream = response.getEntity().getContent();
                      try {
                          obj = this.smartsheet.getJsonSerializer().deserialize(Sheet.class, inputStream);
                      } catch (IOException e) {
                          throw new SmartsheetException(e);
                      }
                      break;
                  }
                  default:
                      handleError(response);
              }
          } finally {
              smartsheet.getHttpClient().releaseConnection();
          }
          return obj;
      }
docs: Sort a sheet according to the sort criteria.
  
  It mirrors to the following Smartsheet REST API method: POST /sheet/{sheetId}/sort
  
  Exceptions:
  - IllegalArgumentException : if any argument is null
  - InvalidRequestException : if there is any problem with the REST API request
  - AuthorizationException : if there is any problem with the REST API authorization(access token)
  - ServiceUnavailableException : if the REST API service is not available (possibly due to rate limiting)
  - SmartsheetRestException : if there is any other REST API related error occurred during the operation
  - SmartsheetException : if there is any other error occurred during the operation
  
  @param sheetId the sheet id
  @param sortSpecifier the sort criteria
  @param level compatibility level
  @return the update request object
  @throws SmartsheetException the smartsheet exception