Package-level declarations

Types

Link copied to clipboard
@Serializable(with = AnyValueSerializer::class)
class AnyValue

The value of a Data Connect Any scalar: a String, a Boolean, a Double, a List of such values (or null) or a Map from String to such values (or null). A null scalar is represented by null rather than by an AnyValue.

Link copied to clipboard
open class AuthUserChangedException(message: String, cause: Throwable? = null) : DataConnectException

Thrown when the signed-in Firebase Authentication user changed while an operation was in progress, so its result belongs to a different user and is discarded; run the operation again.

Link copied to clipboard
class CacheSettings(val storage: CacheSettings.Storage = Storage.PERSISTENT, val maxAge: Duration = Duration.ZERO)

The settings of the query result cache, see DataConnectSettings.cacheSettings.

Link copied to clipboard
class ConnectorConfig(val connector: String, val location: String, val serviceId: String)

Identifies a Data Connect connector: the connector of the service serviceId in the region location.

Link copied to clipboard
open class DataConnectException(message: String, cause: Throwable? = null) : Exception

The base class of the exceptions thrown by Firebase Data Connect.

Link copied to clipboard

Thrown when the execution of an operation fails: the server reported errors for it, or the data it returned could not be decoded. response carries the errors, the raw data and the decoded data when decoding succeeded.

Link copied to clipboard

The details of a failed operation, see DataConnectOperationException.response.

Link copied to clipboard
sealed interface DataConnectPathSegment

One segment of the path of a field in the data of an operation, see DataConnectOperationFailureResponse.ErrorInfo.path.

Link copied to clipboard
class DataConnectSettings(val host: String = "firebasedataconnect.googleapis.com", val sslEnabled: Boolean = true, val cacheSettings: CacheSettings? = null)

The settings of a FirebaseDataConnect instance: the host it connects to, whether over TLS, and its query cache.

Link copied to clipboard

Where a QueryResult's data came from.

Link copied to clipboard
sealed interface EnumValue<out T : Enum<out T>>

The value of a Data Connect enum field: Known when the server's value is one of the Enum constants this code was compiled with, Unknown (carrying the string) when the enum gained a value since. Serialized by com.google.firebase.dataconnect.serializers.EnumValueSerializer.

Link copied to clipboard
@RequiresOptIn(level = RequiresOptIn.Level.WARNING, message = "This declaration is "experimental": its signature and/or semantics may change in backwards-incompatible ways at any time without notice, up to and including complete removal. If you have a use case that relies on this declaration please open a "feature request" issue at https://github.com/firebase/firebase-android-sdk requesting this declaration's promotion from "experimental" to "fully-supported".")
annotation class ExperimentalFirebaseDataConnect

Marks a Firebase Data Connect declaration as experimental, as the Firebase Android SDK does: its signature and/or semantics may change in backwards-incompatible ways at any time without notice, up to and including complete removal.

Link copied to clipboard

The entry point of Firebase Data Connect: creates QueryRefs and MutationRefs for the operations of the connector config of app. Obtained with FirebaseDataConnect.Companion.getInstance; one instance exists per app and connector until it is closed.

Link copied to clipboard
@Serializable(with = LocalDateSerializer::class)
class LocalDate(val year: Int, val month: Int, val day: Int)

A calendar date without a time zone, the Kotlin form of the Data Connect Date scalar. month and day are 1-based; the values are not validated, so that dates from a server can be represented as sent.

Link copied to clipboard

How much Firebase Data Connect logs, see FirebaseDataConnect.Companion.logLevel.

Link copied to clipboard

A reference to a mutation, see FirebaseDataConnect.mutation.

Link copied to clipboard

The result of executing a MutationRef.

Link copied to clipboard

A reference to an operation of a connector with a fixed set of variables: execute sends it and decodes its data. A reference is immutable; copy, withVariablesSerializer and withDataDeserializer derive new ones.

Link copied to clipboard

The result of executing an OperationRef: the decoded data.

Link copied to clipboard
sealed interface OptionalVariable<out T>

A variable of an operation that may be left undefined, which is distinct from null: an Undefined variable is not sent to the server at all (and takes the operation's default), a Value is sent even when it holds null.

Link copied to clipboard

A reference to a query, see FirebaseDataConnect.query; its results can be cached and subscribed to.

Link copied to clipboard

The result of executing a QueryRef.

Link copied to clipboard

A subscription to the results of a query: flow emits the cached result, if any, when collected, then the result of every execution of an equivalent query (same operation and variables) on the same FirebaseDataConnect instance.

Link copied to clipboard

One emission of QuerySubscription.flow: the result of an execution, successful or not.

Properties

Link copied to clipboard
actual val FirebaseDataConnect.Companion.logLevel: MutableStateFlow<LogLevel>

The log level of every instance; set it to change it.

expect val FirebaseDataConnect.Companion.logLevel: MutableStateFlow<LogLevel>

The log level of every instance; set it to change it.

actual val FirebaseDataConnect.Companion.logLevel: MutableStateFlow<LogLevel>

The log level of every instance; set it to change it.

Functions

Link copied to clipboard
fun CacheSettings.copy(storage: CacheSettings.Storage = this.storage, maxAge: Duration = this.maxAge): CacheSettings
fun DataConnectSettings.copy(host: String = this.host, sslEnabled: Boolean = this.sslEnabled, cacheSettings: CacheSettings? = this.cacheSettings): DataConnectSettings

A copy of these settings with the given values replaced.

fun ConnectorConfig.copy(connector: String = this.connector, location: String = this.location, serviceId: String = this.serviceId): ConnectorConfig

A copy of this config with the given values replaced.

fun LocalDate.copy(year: Int = this.year, month: Int = this.month, day: Int = this.day): LocalDate

A copy of this date with the given values replaced.

Link copied to clipboard
inline fun <T> AnyValue.decode(): T

Decodes this value with the serializer of T.

fun <T> AnyValue.decode(deserializer: DeserializationStrategy<T>, serializersModule: SerializersModule? = null): T

Decodes this value with deserializer.

Link copied to clipboard
inline fun <T> AnyValue.Companion.encode(value: T): AnyValue

Encodes value with the serializer of T.

fun <T> AnyValue.Companion.encode(value: T, serializer: SerializationStrategy<T>, serializersModule: SerializersModule? = null): AnyValue

Encodes value with serializer; a null result is an error, as AnyValue never holds null.

Link copied to clipboard

Wraps a plain value; throws IllegalArgumentException for a type that an Any scalar cannot hold.

@JvmName(name = "fromNullableAny")
fun AnyValue.Companion.fromAny(value: Any?): AnyValue?

fromAny for a nullable value: null for null.

Link copied to clipboard

The instance for the default app and config, see getInstance.

The instance for app and config, created with settings if it does not exist yet. Throws IllegalArgumentException if an instance for the same app and connector exists with different settings.

The instance for the default app and config, see getInstance.

The instance for app and config, created with settings if it does not exist yet. Throws IllegalArgumentException if an instance for the same app and connector exists with different settings.

The instance for the default app and config, see getInstance.

The instance for app and config, created with settings if it does not exist yet. Throws IllegalArgumentException if an instance for the same app and connector exists with different settings.

Link copied to clipboard

This kotlinx.datetime.LocalDate as a Data Connect LocalDate.

Link copied to clipboard
fun LocalDate.toKotlinxLocalDate(): LocalDate

This date as a kotlinx.datetime.LocalDate, which validates it.