This is an automated email from the ASF dual-hosted git repository.

roryqi pushed a commit to branch branch-0.9
in repository https://gitbox.apache.org/repos/asf/gravitino.git


The following commit(s) were added to refs/heads/branch-0.9 by this push:
     new 984971640c [#6920] docs(docs): Add doc to Model update (#7038)
984971640c is described below

commit 984971640ccb8d5e9de36da4e5aea54a960457d1
Author: github-actions[bot] 
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Tue Apr 22 20:32:16 2025 +0800

    [#6920] docs(docs): Add doc to Model update (#7038)
    
    ### What changes were proposed in this pull request?
    
    Add doc to Model update. Except for Update Comment, this needs to wait
    for PR merging.
    
    ### Why are the changes needed?
    
    Fix: #6920
    
    ### Does this PR introduce _any_ user-facing change?
    
    Add docs of Model update .
    
    ### How was this patch tested?
    
    local test.
    
    Signed-off-by: dependabot[bot] <[email protected]>
    Co-authored-by: Lord of Abyss 
<[email protected]>
    Co-authored-by: Qiming Teng <[email protected]>
    Co-authored-by: mchades <[email protected]>
    Co-authored-by: gavin.wang <[email protected]>
    Co-authored-by: FANNG <[email protected]>
    Co-authored-by: roryqi <[email protected]>
    Co-authored-by: dependabot[bot] 
<49699333+dependabot[bot]@users.noreply.github.com>
    Co-authored-by: Jerry Shao <[email protected]>
    Co-authored-by: yangyang zhong <[email protected]>
    Co-authored-by: Eric Chang <[email protected]>
    Co-authored-by: Mini Yu <[email protected]>
    Co-authored-by: Kang <[email protected]>
    Co-authored-by: Justin Mclean <[email protected]>
    Co-authored-by: Danhua Wang <[email protected]>
    Co-authored-by: yunchi <[email protected]>
    Co-authored-by: RickyMa <[email protected]>
    Co-authored-by: Yuhui <[email protected]>
---
 docs/gravitino-server-config.md               |   2 +-
 docs/manage-model-metadata-using-gravitino.md | 332 ++++++++++++++++++++++++++
 docs/open-api/models.yaml                     | 246 +++++++++++++++++++
 3 files changed, 579 insertions(+), 1 deletion(-)

diff --git a/docs/gravitino-server-config.md b/docs/gravitino-server-config.md
index 87ff1d56fa..26be0f4ff9 100644
--- a/docs/gravitino-server-config.md
+++ b/docs/gravitino-server-config.md
@@ -128,7 +128,7 @@ Gravitino triggers a pre-event before the operation, a 
post-event after the comp
 | metalake operation                  | `CreateMetalakeEvent`, 
`AlterMetalakeEvent`, `DropMetalakeEvent`, `LoadMetalakeEvent`, 
`ListMetalakeEvent`, `CreateMetalakeFailureEvent`, `AlterMetalakeFailureEvent`, 
`DropMetalakeFailureEvent`, `LoadMetalakeFailureEvent`, 
`ListMetalakeFailureEvent`                                                      
                                                                                
                                                                      [...]
 | Iceberg REST server table operation | `IcebergCreateTableEvent`, 
`IcebergUpdateTableEvent`, `IcebergDropTableEvent`, `IcebergLoadTableEvent`, 
`IcebergListTableEvent`, `IcebergTableExistsEvent`, `IcebergRenameTableEvent`, 
`IcebergCreateTableFailureEvent`, `IcebergUpdateTableFailureEvent`, 
`IcebergDropTableFailureEvent`, `IcebergLoadTableFailureEvent`, 
`IcebergListTableFailureEvent`, `IcebergRenameTableFailureEvent`, 
`IcebergTableExistsFailureEvent`                                        [...]
 | tag operation                       | `ListTagsEvent`, `ListTagsInfoEvent`, 
`CreateTagEvent`, `GetTagEvent`, `AlterTagEvent`, `DeleteTagEvent`, 
`ListMetadataObjectsForTagEvent`, `ListTagsForMetadataObjectEvent`, 
`ListTagsInfoForMetadataObjectEvent`, `AssociateTagsForMetadataObjectEvent`, 
`GetTagForMetadataObjectEvent`, `ListTagsFailureEvent`, 
`ListTagInfoFailureEvent`, `CreateTagFailureEvent`, `GetTagFailureEvent`, 
`AlterTagFailureEvent`, `DeleteTagFailureEvent`, `ListMetadataObjectsFo [...]
-| model operation                     | `DeleteModelEvent`,  
`DeleteModelVersionEvent`,  `GetModelEvent`, `GetModelVersionEvent`, 
`LinkModelVersionEvent`, `ListModelEvent`, `ListModelVersionsEvent`,  
`RegisterAndLinkModelEvent`, `RegisterModelEvent`, 
`AlterModelVersionEvent`,`DeleteModelFailureEvent`, 
`DeleteModelVersionFailureEvent`, `GetModelFailureEvent`, 
`GetModelVersionFailureEvent`, `LinkModelVersionFailureEvent`, 
`ListModelFailureEvent`, `ListModelVersionFailureEvent`, `RegisterAn [...]
+| model operation                     | `DeleteModelEvent`,  
`DeleteModelVersionEvent`,  `GetModelEvent`, `GetModelVersionEvent`, 
`LinkModelVersionEvent`, `ListModelEvent`, `ListModelVersionsEvent`,  
`RegisterAndLinkModelEvent`, `RegisterModelEvent`, `AlterModelEvent`, 
`AlterModelVersionEvent`,`DeleteModelFailureEvent`, 
`DeleteModelVersionFailureEvent`, `GetModelFailureEvent`, 
`GetModelVersionFailureEvent`, `LinkModelVersionFailureEvent`, 
`ListModelFailureEvent`, `ListModelVersionFailure [...]
 | user operation                      | `AddUserEvent`, `GetUserEvent`, 
`ListUserNamesEvent`, `ListUsersEvent`, `RemoveUserEvent`, 
`GrantUserRolesEvent`, `RevokeUserRolesEvent`, `AddUserFailureEvent`, 
`GetUserFailureEvent`, `GrantUserRolesFailureEvent`, 
`ListUserNamesFailureEvent`, `ListUsersFailureEvent`, `RemoveUserFailureEvent`, 
`RevokeUserRolesFailureEvent`                                                   
                                                                               
[...]
 | group operation                     | `AddGroupEvent`, `GetGroupEvent`, 
`ListGroupNamesEvent`, `ListGroupsEvent`, `RemoveGroupEvent`, 
`GrantGroupRolesEvent`, `RevokeGroupRolesEvent`, `AddGroupFailureEvent`, 
`GetGroupFailureEvent`, `GrantGroupRolesFailureEvent`, 
`ListGroupNamesFailureEvent`, `ListGroupsFailureEvent`, 
`RemoveGroupFailureEvent`, `RevokeGroupRolesFailureEvent`                       
                                                                                
             [...]
 | role operation                      | `CreateRoleEvent`, `DeleteRoleEvent`, 
`GetRoleEvent`, `GrantPrivilegesEvent`, `ListRoleNamesEvent`, 
`RevokePrivilegesEvent`, `CreateRoleFailureEvent`, `DeleteRoleFailureEvent`, 
`GetRoleFailureEvent`, `GrantPrivilegesFailureEvent`, 
`ListRoleNamesFailureEvent`, `RevokePrivilegesFailureEvent`                     
                                                                                
                                                              [...]
diff --git a/docs/manage-model-metadata-using-gravitino.md 
b/docs/manage-model-metadata-using-gravitino.md
index 74d2a3e76a..d0b8143cb7 100644
--- a/docs/manage-model-metadata-using-gravitino.md
+++ b/docs/manage-model-metadata-using-gravitino.md
@@ -302,6 +302,111 @@ model: Model = 
catalog.as_model_catalog().get_model(ident=NameIdentifier.of("mod
 </TabItem>
 </Tabs>
 
+### Alter a model
+
+You can modify a model's metadata (e.g., rename or modify properties) by 
+sending a `PUT` request to the 
`/api/metalakes/{metalake_name}/catalogs/{catalog_name}/schemas/
+{schema_name}/models/{model_name}` endpoint or using the Gravitino Java/Python 
client. The following is an example of modifying a model:
+
+<Tabs groupId="language" queryString>
+ <TabItem value="shell" label="Shell">
+
+```shell
+cat <<EOF >model.json
+{
+  "updates": [
+    {
+      "@type": "rename",
+      "newName": "new_name"
+    },
+    {
+      "@type": "setProperty",
+      "property": "k2",
+      "value": "v2"
+    },
+    {
+      "@type": "removeProperty",
+      "property": "k1"
+    }
+  ]
+}
+EOF
+ 
+curl -X PUT \
+  -H "Accept: application/vnd.gravitino.v1+json" \
+  -H "Content-Type: application/json" \
+  -d '@model.json' \
+  
http://localhost:8090/api/metalakes/mymetalake/catalogs/mycatalog/schemas/myschema/models/mymodel
+ ```
+
+
+ </TabItem>
+ <TabItem value="java" label="Java">
+
+ ```java
+ // Load the catalog and model
+ GravitinoClient gravitinoClient = GravitinoClient
+     .builder("http://localhost:8090";)
+     .withMetalake("example")
+     .build();
+
+ Catalog catalog = gravitinoClient.loadCatalog("model_catalog");
+ ModelCatalog modelCatalog = catalog.asModelCatalog();
+
+ // Define modifications
+ ModelChange[] changes = {
+     ModelChange.rename("example_model_renamed"),
+     ModelChange.setProperty("k2", "v2"),
+     ModelChange.removeProperty("k1")
+ };
+
+ // Apply changes
+ Model updatedModel = modelCatalog.alterModel(
+     NameIdentifier.of("model_schema", "example_model"),
+     changes
+ );
+ ```
+
+ </TabItem>
+<TabItem value="python" label="Python">
+
+ ```python
+client = GravitinoClient(uri="http://localhost:8090";, 
+                         metalake_name="mymetalake")
+
+catalog = client.load_catalog(name="mycatalog").as_model_catalog()
+
+# Define modifications
+changes = (
+    ModelChange.rename("renamed"),
+    ModelChange.set_property("k2", "v2"),
+    ModelChange.remove_property("k1"),
+)
+
+# Apply changes
+updated_model = model_catalog.alter_model(
+    ident=NameIdentifier.of("myschema", "mymodel"), *changes
+)
+ ```
+ </TabItem>
+ </Tabs>
+
+#### Supported modifications
+
+The following operations are supported for altering a model:
+
+
+| Operation           | JSON Example                                           
    | Java Method                               | Python Method                 
             |
+ 
|---------------------|------------------------------------------------------------|-------------------------------------------|--------------------------------------------|
+| **Rename model**    | `{"@type":"rename","newName":"new_name"}`              
    | `ModelChange.rename("new_name")`          | 
`ModelChange.rename("new_name")`           |
+| **Set property**    | 
`{"@type":"setProperty","property":"key","value":"value"}` | 
`ModelChange.setProperty("key", "value")` | `ModelChange.set_property("key", 
"value")` |
+| **Remove property** | `{"@type":"removeProperty","property":"key"}`          
    | `ModelChange.removeProperty("key")`       | 
`ModelChange.remove_property("key")`       |
+
+:::note
+- Multiple modifications can be applied in a single request.
+- If the target model does not exist, a `404 Not Found` error will be returned.
+  :::
+
 ### Delete a model
 
 You can delete a model by sending a `DELETE` request to the 
`/api/metalakes/{metalake_name}
@@ -519,6 +624,233 @@ model_version: ModelVersion = 
catalog.as_model_catalog().get_model_version_by_al
 </TabItem>
 </Tabs>
 
+### Alter a ModelVersion
+
+You can modify a modelVersion's metadata (e.g. update uri, update comment, or 
modify properties) 
+by sending a `PUT` request to the 
`/api/metalakes/{metalake_name}/catalogs/{catalog_name}
+/schemas/{schema_name} /models/{model_name}/versions/{version_number}` 
endpoint or using the Gravitino 
+Java/Python client. The following is an example of modifying a model version:
+
+<Tabs groupId="language" queryString>
+ <TabItem value="shell" label="Shell">
+
+```shell
+cat <<EOF >model.json
+{
+  "updates": [
+    {
+      "@type": "updateComment",
+      "newComment": "Updated comment of model version"
+    },
+    {
+      "@type": "updateUri",
+      "newUri": "new_uri"
+    },
+    {
+      "@type": "setProperty",
+      "property": "key",
+      "value": "value"
+    },
+    {
+      "@type": "removeProperty",
+      "property": "key"
+    }
+  ]
+}
+EOF
+ 
+curl -X PUT \
+  -H "Accept: application/vnd.gravitino.v1+json" \
+  -H "Content-Type: application/json" \
+  -d '@model.json' \
+  
http://localhost:8090/api/metalakes/mymetalake/catalogs/mycatalog/schemas/myschema/models/mymodel/versions/0
+```
+</TabItem>
+<TabItem value="java" label="Java">
+
+```java
+// Load the model catalog
+GravitinoClient gravitinoClient = GravitinoClient
+    .builder("http://localhost:8090";)
+    .withMetalake("example")
+    .build();
+
+Catalog catalog = gravitinoClient.loadCatalog("model_catalog");
+ModelCatalog modelCatalog = catalog.asModelCatalog();
+
+// Define modifications
+ModelVersionChange[] changes = {
+     ModelVersionChange.updateComment("Updated comment of model version"),
+     ModelVersionChange.updateUri("new_uri"),
+     ModelVersionChange.setProperty("key", "value"),
+     ModelVersionChange.removeProperty("key")
+ };
+
+// Apply changes
+ModelVersion updatedModelVersion = modelCatalog.alterModelVersion(
+     NameIdentifier.of("model_schema", "example_model"),
+     0,
+     changes
+ );
+```
+
+</TabItem>
+<TabItem value="python" label="Python">
+
+```python
+client = GravitinoClient(
+    uri="http://localhost:8090";, metalake_name="mymetalake"
+)
+
+# Load Model Catalog
+model_catalog = client.load_catalog(name="mycatalog").as_model_catalog()
+
+# Define modifications
+changes = (
+    ModelVersionChange.update_comment("Updated comment of model version"),
+    ModelVersionChange.update_uri("new_uri"),
+    ModelVersionChange.set_property("k2", "v2"),
+    ModelVersionChange.remove_property("k1"),
+)
+
+# Apply changes
+updated_model = model_catalog.alter_model_version(
+    NameIdentifier.of("myschema", "mymodel"), 0, *changes
+)
+```
+
+</TabItem>
+</Tabs>
+
+#### Supported modifications
+
+| Operation           | JSON Example                                           
    | Java Method                                       | Python Method         
                             |
+|---------------------|------------------------------------------------------------|---------------------------------------------------|----------------------------------------------------|
+| **Update uri**      | `{"@type":"updateUri","newName":"new_uri"}`            
    | `ModelVersionChange.updateUri("new_uri")`         | 
`ModelVersionChange.update_uri("new_uri")`         |
+| **Update comment**  | `{"@type":"updateComment","newComment":"new_comment"}` 
    | `ModelVersionChange.updateComment("new_comment")` | 
`ModelVersionChange.update_comment("new_comment")` |
+| **Set property**    | 
`{"@type":"setProperty","property":"key","value":"value"}` | 
`ModelVersionChange.setProperty("key", "value")`  | 
`ModelVersionChange.set_property("key", "value")`  |
+| **Remove property** | `{"@type":"removeProperty","property":"key"}`          
    | `ModelVersionChange.removeProperty("key")`        | 
`ModelVersionChange.remove_property("key")`        |
+
+:::note
+- Multiple modifications can be applied in a single request.
+- If the target model does not exist, a `404 Not Found` error will be returned.
+- If the target model version does not exist, a `404 Not Found` error will be 
returned.
+  :::
+
+### Alter a ModelVersion by alias
+
+You can also modify a modelVersion's metadata (e.g. update uri, update 
comment, or modify 
+properties) by sending a `PUT` request to the 
`/api/metalakes/{metalake_name}/catalogs/
+{catalog_name}/schemas/{schema_name}/models/{model_name}/aliases/{alias}` 
endpoint or using the Gravitino
+Java/Python client. The following is an example of modifying a model version:
+
+<Tabs groupId="language" queryString>
+ <TabItem value="shell" label="Shell">
+
+```shell
+cat <<EOF >model.json
+{
+  "updates": [
+    {
+      "@type": "updateComment",
+      "newComment": "Updated comment of model version"
+    },
+    {
+      "@type": "updateUri",
+      "newUri": "new_uri"
+    },
+    {
+      "@type": "setProperty",
+      "property": "key",
+      "value": "value"
+    },
+    {
+      "@type": "removeProperty",
+      "property": "key"
+    }
+  ]
+}
+EOF
+ 
+curl -X PUT \
+  -H "Accept: application/vnd.gravitino.v1+json" \
+  -H "Content-Type: application/json" \
+  -d '@model.json' \
+  
http://localhost:8090/api/metalakes/mymetalake/catalogs/mycatalog/schemas/myschema/models/mymodel/aliases/myalias
+```
+</TabItem>
+<TabItem value="java" label="Java">
+
+```java
+// Load the model catalog
+GravitinoClient gravitinoClient = GravitinoClient
+    .builder("http://localhost:8090";)
+    .withMetalake("example")
+    .build();
+
+Catalog catalog = gravitinoClient.loadCatalog("model_catalog");
+ModelCatalog modelCatalog = catalog.asModelCatalog();
+
+// Define modifications
+ModelVersionChange[] changes = {
+     ModelVersionChange.updateComment("Updated comment of model version"),
+     ModelVersionChange.updateUri("new_uri"),
+     ModelVersionChange.setProperty("key", "value"),
+     ModelVersionChange.removeProperty("key")
+ };
+
+// Apply changes
+ModelVersion updatedModelVersion = modelCatalog.alterModelVersion(
+     NameIdentifier.of("model_schema", "example_model"),
+     "myalias",
+     changes
+ );
+```
+
+</TabItem>
+<TabItem value="python" label="Python">
+
+```python
+client = GravitinoClient(
+    uri="http://localhost:8090";, metalake_name="mymetalake"
+)
+
+# Load Model Catalog
+model_catalog = client.load_catalog(name="mycatalog").as_model_catalog()
+
+# Define modifications
+changes = (
+    ModelVersionChange.update_comment("Updated comment of model version"),
+    ModelVersionChange.update_uri("new_uri"),
+    ModelVersionChange.set_property("k2", "v2"),
+    ModelVersionChange.remove_property("k1"),
+)
+
+# Apply changes
+updated_model = model_catalog.alter_model_version_by_alias(
+    NameIdentifier.of("myschema", "myalias", "mymodel"), *changes
+)
+```
+
+</TabItem>
+</Tabs>
+
+#### Supported modifications
+
+| Operation           | JSON Example                                           
    | Java Method                                       | Python Method         
                             |
+|---------------------|------------------------------------------------------------|---------------------------------------------------|----------------------------------------------------|
+| **Update uri**      | `{"@type":"updateUri","newName":"new_uri"}`            
    | `ModelVersionChange.updateUri("new_uri")`         | 
`ModelVersionChange.update_uri("new_uri")`         |
+| **Update comment**  | `{"@type":"updateComment","newComment":"new_comment"}` 
    | `ModelVersionChange.updateComment("new_comment")` | 
`ModelVersionChange.update_comment("new_comment")` |
+| **Set property**    | 
`{"@type":"setProperty","property":"key","value":"value"}` | 
`ModelVersionChange.setProperty("key", "value")`  | 
`ModelVersionChange.set_property("key", "value")`  |
+| **Remove property** | `{"@type":"removeProperty","property":"key"}`          
    | `ModelVersionChange.removeProperty("key")`        | 
`ModelVersionChange.remove_property("key")`        |
+
+
+:::note
+- Multiple modifications can be applied in a single request.
+- If the target model does not exist, a `404 Not Found` error will be returned.
+- If the target model version does not exist, a `404 Not Found` error will be 
returned.
+  :::
+
 ### Delete a ModelVersion
 
 You can delete a ModelVersion by sending a `DELETE` request to the 
`/api/metalakes/{metalake_name}
diff --git a/docs/open-api/models.yaml b/docs/open-api/models.yaml
index 652923286b..b42a44098d 100644
--- a/docs/open-api/models.yaml
+++ b/docs/open-api/models.yaml
@@ -109,6 +109,33 @@ paths:
         "5xx":
           $ref: "./openapi.yaml#/components/responses/ServerErrorResponse"
 
+    put:
+      tags:
+        - model
+      summary: Update model
+      operationId: updateModel
+      requestBody:
+        content:
+          application/json:
+            schema:
+              $ref: "#/components/schemas/ModelUpdatesRequest"
+      responses:
+        "200":
+          $ref: "#/components/responses/ModelResponse"
+        "400":
+          $ref: "./openapi.yaml#/components/responses/BadRequestErrorResponse"
+        "404":
+          description: Not Found - The target model does not exist
+          content:
+            application/vnd.gravitino.v1+json:
+              schema:
+                $ref: "./openapi.yaml#/components/schemas/ErrorModel"
+              examples:
+                NoSuchModelException:
+                  $ref: "#/components/examples/NoSuchModelException"
+        "5xx":
+          $ref: "./openapi.yaml#/components/responses/ServerErrorResponse"
+
     delete:
       tags:
         - model
@@ -149,6 +176,36 @@ paths:
         "5xx":
           $ref: "./openapi.yaml#/components/responses/ServerErrorResponse"
 
+
+    put:
+      tags:
+        - model
+      summary: Update model version
+      operationId: updateModelVersions
+      requestBody:
+        content:
+          application/json:
+            schema:
+              $ref: "#/components/schemas/ModelVersionUpdatesRequest"
+      responses:
+        "200":
+          $ref: "#/components/responses/ModelVersionResponse"
+        "400":
+          $ref: "./openapi.yaml#/components/responses/BadRequestErrorResponse"
+        "404":
+          description: Not Found - The target model or model version does not 
exist
+          content:
+            application/vnd.gravitino.v1+json:
+              schema:
+                $ref: "./openapi.yaml#/components/schemas/ErrorModel"
+              examples:
+                NoSuchModelException:
+                  $ref: "#/components/examples/NoSuchModelException"
+                NoSuchModelVersionException:
+                  $ref: "#/components/examples/NoSuchModelVersionException"
+        "5xx":
+          $ref: "./openapi.yaml#/components/responses/ServerErrorResponse"
+
     post:
       tags:
         - model
@@ -366,6 +423,90 @@ components:
           additionalProperties:
             type: string
 
+    ModelUpdatesRequest:
+      type: object
+      required:
+        - updates
+      properties:
+        updates:
+          type: array
+          items:
+            $ref: "#/components/schemas/ModelUpdateRequest"
+
+    ModelUpdateRequest:
+      type: object
+      oneOf:
+        - $ref: "#/components/schemas/RenameModelRequest"
+        - $ref: "#/components/schemas/SetModelPropertyRequest"
+        - $ref: "#/components/schemas/RemoveModelPropertyRequest"
+      discriminator:
+        propertyName: "@type"
+        mapping:
+          rename: "#/components/schemas/RenameModelRequest"
+          setProperty: "#/components/schemas/SetModelPropertyRequest"
+          removeProperty: "#/components/schemas/RemoveModelPropertyRequest"
+
+    RenameModelRequest:
+      type: object
+      required:
+        - "@type"
+        - newName
+      properties:
+        "@type":
+          type: string
+          enum:
+            - "rename"
+        newName:
+          type: string
+          description: The new name of the model
+      example: {
+        "@type": "rename",
+        "newName": "my_model_new"
+      }
+
+    SetModelPropertyRequest:
+      type: object
+      required:
+        - "@type"
+        - property
+        - value
+      properties:
+        "@type":
+          type: string
+          description: The type of the update
+          enum:
+            - setProperty
+        property:
+          type: string
+          description: The name of the property to set
+        value:
+          type: string
+          description: The value of the property to set
+      example: {
+        "@type": "setProperty",
+        "property": "key",
+        "value": "value"
+      }
+
+    RemoveModelPropertyRequest:
+      type: object
+      required:
+        - "@type"
+        - property
+      properties:
+        "@type":
+          type: string
+          description: The type of the update
+          enum:
+            - removeProperty
+        property:
+          type: string
+          description: The property to remove
+      example: {
+        "@type": "removeProperty",
+        "property": "key1"
+      }
+
     ModelVersionLinkRequest:
       type: object
       required:
@@ -392,6 +533,111 @@ components:
           additionalProperties:
             type: string
 
+    ModelVersionUpdatesRequest:
+      type: object
+      required:
+        - updates
+      properties:
+        updates:
+          type: array
+          items:
+            $ref: "#/components/schemas/ModelVersionUpdateRequest"
+
+    ModelVersionUpdateRequest:
+      type: object
+      oneOf:
+        - $ref: "#/components/schemas/UpdateModelVersionCommentRequest"
+        - $ref: "#/components/schemas/SetModelVersionPropertyRequest"
+        - $ref: "#/components/schemas/RemoveModelVersionPropertyRequest"
+        - $ref: "#/components/schemas/UpdateModelVersionUriRequest"
+      discriminator:
+        propertyName: "@type"
+        mapping:
+          updateComment: 
"#/components/schemas/UpdateModelVersionCommentRequest"
+          setProperty: "#/components/schemas/SetModelVersionPropertyRequest"
+          removeProperty: 
"#/components/schemas/RemoveModelVersionPropertyRequest"
+          updateUri: "#/components/schemas/UpdateModelVersionUriRequest"
+
+    UpdateModelVersionCommentRequest:
+      type: object
+      required:
+        - "@type"
+        - newComment
+      properties:
+        "@type":
+          type: string
+          enum:
+            - "updateComment"
+        newComment:
+          type: string
+          description: The new comment of the model version
+      example: {
+        "@type": "updateComment",
+        "newComment": "This is a new comment"
+      }
+
+    SetModelVersionPropertyRequest:
+      type: object
+      required:
+        - "@type"
+        - property
+        - value
+      properties:
+        "@type":
+          type: string
+          description: The type of the update
+          enum:
+            - setProperty
+        property:
+          type: string
+          description: The name of the property to set
+        value:
+          type: string
+          description: The value of the property to set
+      example: {
+        "@type": "setProperty",
+        "property": "key",
+        "value": "value"
+      }
+
+    RemoveModelVersionPropertyRequest:
+      type: object
+      required:
+        - "@type"
+        - property
+      properties:
+        "@type":
+          type: string
+          description: The type of the update
+          enum:
+            - removeProperty
+        property:
+          type: string
+          description: The property to remove
+      example: {
+        "@type": "removeProperty",
+        "property": "key1"
+      }
+
+    UpdateModelVersionUriRequest:
+      type: object
+      required:
+        - "@type"
+        - newUri
+      properties:
+        "@type":
+          type: string
+          enum:
+            - "updateUri"
+        newUri:
+          type: string
+          description: The new uri of the model version
+      example: {
+        "@type": "updateUri",
+        "newUri": "s3://path/to/model"
+      }
+
+
   responses:
     ModelResponse:
       description: The response of model object

Reply via email to