UpdateService

interface UpdateService

Modifies endpoint behaviour on a connected device at runtime. Changes take effect immediately and are applied on top of the endpoint's static configuration — passing null for any value resets it to the endpoint's configured default.

Functions

Link copied to clipboard
abstract suspend fun applyPreset(connection: MockzillaConnectionConfig, key: EndpointConfiguration.Key, dashboardOverridePreset: DashboardOverridePreset): Result<Unit>

Applies a dashboard preset to the endpoint identified by key on the device at connection, overriding the endpoint's response until the override is cleared.

Link copied to clipboard
abstract suspend fun applyPresetByName(connection: MockzillaConnectionConfig, key: EndpointConfiguration.Key, presetName: String): Result<Unit>

Applies a code-defined dashboard preset to the endpoint identified by key on the device at connection by looking it up by presetName, overriding the endpoint's response until the override is cleared.

Link copied to clipboard
abstract suspend fun setDelay(connection: MockzillaConnectionConfig, keys: Collection<EndpointConfiguration.Key>, delayMs: Int?): Result<Unit>

Overrides the response delay for the specified endpoints on the device at connection.

Link copied to clipboard
abstract suspend fun setShouldFail(connection: MockzillaConnectionConfig, keys: Collection<EndpointConfiguration.Key>, shouldFail: Boolean?): Result<Unit>

Overrides whether the specified endpoints return error responses on the device at connection.