All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.com.caesarealabs.rpc4k.generated.LoggyServiceNetworkClient.kt Maven / Gradle / Ivy

The newest version!
@file:OptIn(ExperimentalUnsignedTypes::class, ExperimentalSerializationApi::class)

package com.caesarealabs.rpc4k.generated

import com.caesarealabs.loggy.shared.Invocation
import com.caesarealabs.loggy.shared.Query
import com.caesarealabs.loggy.shared.SearchResult
import com.caesarealabs.rpc4k.runtime.api.RpcClient
import com.caesarealabs.rpc4k.runtime.api.SerializationFormat
import com.caesarealabs.rpc4k.runtime.implementation.GeneratedCodeUtils.coldEventFlow
import com.caesarealabs.rpc4k.runtime.implementation.GeneratedCodeUtils.request
import com.caesarealabs.rpc4k.runtime.user.EventSubscription
import kotlin.ExperimentalUnsignedTypes
import kotlin.OptIn
import kotlin.String
import kotlin.collections.List
import kotlin.collections.listOf
import kotlinx.serialization.ExperimentalSerializationApi
import kotlinx.serialization.builtins.ListSerializer
import kotlinx.serialization.builtins.nullable
import kotlinx.serialization.builtins.serializer

public class LoggyServiceNetworkClient(
  private val client: RpcClient,
  private val format: SerializationFormat,
) {
  public suspend fun getEndpoints(): List = request(client, format, "getEndpoints",
      listOf(), listOf(), ListSerializer(String.serializer()))

  public suspend fun getDataValuesForKeyInQuery(
    query: String,
    key: String,
    userTimeZone: String,
  ): List? = request(client, format, "getDataValuesForKeyInQuery", listOf(query, key,
      userTimeZone), listOf(String.serializer(), String.serializer(), String.serializer()),
      ListSerializer(String.serializer()).nullable)

  public suspend fun getInvocations(query: Query, userTimeZone: String): SearchResult =
      request(client, format, "getInvocations", listOf(query, userTimeZone),
      listOf(Query.serializer(), String.serializer()),
      SearchResult.serializer(Invocation.serializer()))

  public fun onInvocationAdded(endpoint: String?, query: Query): EventSubscription =
      coldEventFlow(client, format, "onInvocationAdded", listOf(endpoint, query),
      listOf(String.serializer().nullable, Query.serializer()), Invocation.serializer())
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy