# KtorWriteCrudRepoClient

class KtorWriteCrudRepoClient < ObjectType , IdType , InputValue >(baseUrl: String , httpClient: ERROR CLASS: Symbol not found for HttpClient, val newObjectsFlow: Flow< ObjectType >, val updatedObjectsFlow: Flow< ObjectType >, val deletedObjectsIdsFlow: Flow< IdType >, createSetup: suspend ERROR CLASS: Symbol not found for HttpRequestBuilder.( List < InputValue >) -> Unit , updateSetup: suspend ERROR CLASS: Symbol not found for HttpRequestBuilder.( List < UpdatedValuePair < IdType , InputValue >>) -> Unit , deleteByIdSetup: suspend ERROR CLASS: Symbol not found for HttpRequestBuilder.( List < IdType >) -> Unit , createBodyGetter: suspend ERROR CLASS: Symbol not found for HttpResponse.() -> List < ObjectType >, updateBodyGetter: suspend ERROR CLASS: Symbol not found for HttpResponse.() -> List < ObjectType >) : WriteCRUDRepo < ObjectType , IdType , InputValue > (source)

## Constructors

KtorWriteCrudRepoClient
Link copied to clipboard
constructor(baseUrl: String , httpClient: ERROR CLASS: Symbol not found for HttpClient, newObjectsFlow: Flow< ObjectType >, updatedObjectsFlow: Flow< ObjectType >, deletedObjectsIdsFlow: Flow< IdType >, createSetup: suspend ERROR CLASS: Symbol not found for HttpRequestBuilder.( List < InputValue >) -> Unit , updateSetup: suspend ERROR CLASS: Symbol not found for HttpRequestBuilder.( List < UpdatedValuePair < IdType , InputValue >>) -> Unit , deleteByIdSetup: suspend ERROR CLASS: Symbol not found for HttpRequestBuilder.( List < IdType >) -> Unit , createBodyGetter: suspend ERROR CLASS: Symbol not found for HttpResponse.() -> List < ObjectType >, updateBodyGetter: suspend ERROR CLASS: Symbol not found for HttpResponse.() -> List < ObjectType >)

## Types

Companion
Link copied to clipboard
object Companion

## Properties

deletedObjectsIdsFlow
Link copied to clipboard
open override val deletedObjectsIdsFlow : Flow< IdType >

Flow that emits the ID of each deleted object after a successful deleteById call.

newObjectsFlow
Link copied to clipboard
open override val newObjectsFlow : Flow< ObjectType >

Flow that emits each newly created object after a successful create call.

onDeletedObjectsIds
Link copied to clipboard
val < IdType > WriteCRUDRepo <*, IdType , *>. onDeletedObjectsIds : Flow< IdType >

Mirrors WriteCRUDRepo.deletedObjectsIdsFlow under the name onDeletedObjectsIds for consistency with KV repos naming.

onNewObjects
Link copied to clipboard
val < ObjectType > WriteCRUDRepo < ObjectType , *, *>. onNewObjects : Flow< ObjectType >

Mirrors WriteCRUDRepo.newObjectsFlow under the name onNewObjects for consistency with KV repos naming.

onUpdatedObjects
Link copied to clipboard
val < ObjectType > WriteCRUDRepo < ObjectType , *, *>. onUpdatedObjects : Flow< ObjectType >

Mirrors WriteCRUDRepo.updatedObjectsFlow under the name onUpdatedObjects for consistency with KV repos naming.

updatedObjectsFlow
Link copied to clipboard
open override val updatedObjectsFlow : Flow< ObjectType >

Flow that emits each updated object after a successful update call.

## Functions

caching
Link copied to clipboard
fun < ObjectType , IdType , InputType > WriteCRUDRepo < ObjectType , IdType , InputType >. caching (kvCache: KVCache < IdType , ObjectType >, scope: CoroutineScope, locker: SmartRWLocker = SmartRWLocker(), idGetter: ( ObjectType ) -> IdType ): WriteCRUDCacheRepo < ObjectType , IdType , InputType >
create
Link copied to clipboard
open suspend override fun create (values: List < InputValue >): List < ObjectType >

Creates new objects from the given list of input values. Successfully created objects must be emitted via newObjectsFlow.

create
Link copied to clipboard
suspend fun < ObjectType , IdType , InputValueType > WriteCRUDRepo < ObjectType , IdType , InputValueType >. create (vararg values: InputValueType ): List < ObjectType >

Vararg overload of WriteCRUDRepo.create for convenience.

deleteById
Link copied to clipboard
open suspend override fun deleteById (ids: List < IdType >)

Deletes objects with the given list of IDs. Successfully deleted IDs must be emitted via deletedObjectsIdsFlow.

deleteById
Link copied to clipboard
suspend fun < ObjectType , IdType , InputValueType > WriteCRUDRepo < ObjectType , IdType , InputValueType >. deleteById (vararg ids: IdType )

Vararg overload of WriteCRUDRepo.deleteById for convenience.

update
Link copied to clipboard
open suspend override fun update (values: List < UpdatedValuePair < IdType , InputValue >>): List < ObjectType >

Batch-updates objects using the given list of ID-value pairs. Successfully updated objects must be emitted via updatedObjectsFlow.

open suspend override fun update (id: IdType , value: InputValue ): ObjectType ?

Updates the object identified by id with the given value. Successfully updated object must be emitted via updatedObjectsFlow.

update
Link copied to clipboard
suspend fun < ObjectType , IdType , InputValueType > WriteCRUDRepo < ObjectType , IdType , InputValueType >. update (vararg values: UpdatedValuePair < IdType , InputValueType >): List < ObjectType >

Vararg overload of WriteCRUDRepo.update for convenience.

withMapper
Link copied to clipboard
inline fun < FromKey , FromValue , FromInput , ToKey , ToValue , ToInput > WriteCRUDRepo < ToValue , ToKey , ToInput >. withMapper (mapper: MapperRepo < FromKey , FromValue , ToKey , ToValue >, simpleSuspendableMapper: SimpleSuspendableMapper < FromInput , ToInput >): WriteCRUDRepo < FromValue , FromKey , FromInput >
inline fun < FromKey , FromValue , FromInput , ToKey , ToValue , ToInput > WriteCRUDRepo < ToValue , ToKey , ToInput >. withMapper (noinline keyFromToTo: suspend FromKey .() -> ToKey = { this as ToKey }, noinline valueFromToTo: suspend FromValue .() -> ToValue = { this as ToValue }, noinline inputFromToTo: suspend FromInput .() -> ToInput = { this as ToInput }, noinline keyToToFrom: suspend ToKey .() -> FromKey = { this as FromKey }, noinline valueToToFrom: suspend ToValue .() -> FromValue = { this as FromValue }, noinline inputToToFrom: suspend ToInput .() -> FromInput = { this as FromInput }): WriteCRUDRepo < FromValue , FromKey , FromInput >