Skip to main content

diff_preview_create

Function diff_preview_create 

Source
pub async fn diff_preview_create(
    kind: String,
    payload: Value,
    store: State<'_, DiffStoreHandle>,
) -> Result<DiffId, AppError>
Expand description

Create a pending diff record and return its DiffId.

§Parameters

  • kind — Must be "storage_class" in v1. Other values are rejected with AppError::Validation.
  • payload — JSON-encoded payload matching the schema for the given kind.
  • store — The managed DiffStoreHandle.

§Payload schema (kind = “storage_class”)

{
  "targets": [{ "bucket": "my-bucket", "key": "photos/img.jpg" }],
  "current": { "photos/img.jpg": "STANDARD" },
  "new_class": "GLACIER"
}

§OCP

New kinds are added as new match arms. The kind string is the only discriminator — no other caller code changes.