forBundleRequest

fun forBundleRequest(methodForCreate: HttpCreateMethod, methodForUpdate: HttpUpdateMethod, squash: Boolean, bundleSize: Int): UploadStrategy

Creates an UploadStrategy for bundling changes into a single request.

This strategy fetches all local changes, generates a single patch per resource (squashing multiple changes to the same resource if applicable), and bundles them into a single HTTP request for uploading to the server.

Note: Currently, only the squash = true scenario is supported. When squash = false, the bundle request would need to support chunking to accommodate multiple changes for the same resource. This functionality is not yet implemented.

Return

An UploadStrategy configured for bundle requests.

Parameters

methodForCreate

The HTTP method to use for creating new resources (PUT or POST).

methodForUpdate

The HTTP method to use for updating existing resources (PUT or PATCH).

squash

Whether to combine multiple changes to the same resource into a single update. Only true is supported currently.

bundleSize

The maximum number of resources to include in a single bundle.