NetworkMockEndpointViewModel

class NetworkMockEndpointViewModel(endpointKey: EndpointKey, configRepository: MockConfigRepository, stateRepository: MockStateRepository) : ViewModel

ViewModel for the Network Mock endpoint detail screen.

Manages the state and business logic for a single endpoint, combining its discovered mock responses with the live persisted EndpointMockState so the UI always reflects the latest selection without any manual lookup.

Responsibilities

  • Discover available mock response files for the given endpointKey

  • Observe the live EndpointMockState for the endpoint from DataStore

  • Combine both into a single uiState flow

  • Handle mock state changes triggered by the user

Constructors

Link copied to clipboard
constructor(endpointKey: EndpointKey, configRepository: MockConfigRepository, stateRepository: MockStateRepository)

Properties

Link copied to clipboard

Combined UI state for the endpoint detail screen.

Functions

Link copied to clipboard
expect open fun addCloseable(closeable: AutoCloseable)
expect fun addCloseable(key: String, closeable: AutoCloseable)
Link copied to clipboard
expect fun <T : AutoCloseable> getCloseable(key: String): T?
Link copied to clipboard
fun setMockState(responseFileName: String?)

Sets the mock state for this endpoint.