jerryshao commented on code in PR #7133:
URL: https://github.com/apache/gravitino/pull/7133#discussion_r2081111571
##########
common/src/main/java/org/apache/gravitino/dto/requests/ModelVersionUpdateRequest.java:
##########
@@ -167,4 +170,34 @@ public void validate() throws IllegalArgumentException {
StringUtils.isNotBlank(newUri), "\"newUri\" field is required and
cannot be empty");
}
}
+
+ /** Request to update the aliases of a model version. */
+ @EqualsAndHashCode
+ @AllArgsConstructor
+ @NoArgsConstructor(force = true)
+ @ToString
+ @Getter
+ class UpdateModelVersionAliasesRequest implements ModelVersionUpdateRequest {
+ @JsonProperty("aliasesToAdd")
+ private final String[] aliasesToAdd;
+
+ @JsonProperty("aliasesToRemove")
+ private final String[] aliasesToRemove;
+
+ /** {@inheritDoc} */
+ @Override
+ public ModelVersionChange modelVersionChange() {
+ return ModelVersionChange.updateAliases(aliasesToAdd, aliasesToRemove);
+ }
+
+ /**
+ * Validates the request, i.e., always pass.
+ *
+ * @throws IllegalArgumentException If the request is invalid, this
exception is thrown.
+ */
+ @Override
+ public void validate() throws IllegalArgumentException {
+ // always pass
Review Comment:
Also here, do we need to verify the request?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]