code: public Metadata updateMetadata(Metadata metadata) {
          String scope;
          if (metadata.getScope().equals(Metadata.GLOBAL_METADATA_SCOPE)) {
              scope = Metadata.GLOBAL_METADATA_SCOPE;
          } else {
              scope = Metadata.ENTERPRISE_METADATA_SCOPE;
          }
  
          URL url = METADATA_URL_TEMPLATE.build(this.getAPI().getBaseURL(), this.getID(),
                  scope, metadata.getTemplateName());
          BoxAPIRequest request = new BoxAPIRequest(this.getAPI(), url, "PUT");
          request.addHeader("Content-Type", "application/json-patch+json");
          request.setBody(metadata.getPatch());
          BoxJSONResponse response = (BoxJSONResponse) request.send();
          return new Metadata(JsonObject.readFrom(response.getJSON()));
      }
docs: Updates the file metadata.
  
  @param metadata the new metadata values.
  @return the metadata returned from the server.