HttpsCallableReference

A reference to a callable HTTPS trigger in Cloud Functions, mirroring com.google.firebase.functions.HttpsCallableReference from the Firebase Android SDK. Obtained from FirebaseFunctions.getHttpsCallable or getHttpsCallableFromUrl.

The timeout is set with the setTimeout and withTimeout extensions taking a kotlin.time.Duration. The Android SDK's TimeUnit overloads keep their signatures through the error-deprecated java.util.concurrent.TimeUnit stand-in and can only be called from Android/JVM code: from common code they fail to compile with a message naming the Duration forms.

Not mirrored: stream() (returns an org.reactivestreams.Publisher, which is JVM-only, and the iOS SDK's streaming API is Swift-only).

The JS SDK fixes a callable's options, including its timeout, when the callable is created, so the reference keeps what it needs to create one and js is created on demand with the current timeout.

The JS SDK fixes a callable's options, including its timeout, when the callable is created, so the reference keeps what it needs to create one and js is created on demand with the current timeout.

Properties

Link copied to clipboard
val ios: <Error class: unknown class>

The underlying Firebase iOS SDK object; withTimeout creates a new one, so it is kept per reference.

Link copied to clipboard

The underlying Firebase JS SDK callable, created with the current timeout.

The underlying Firebase JS SDK callable, created with the current timeout.

Link copied to clipboard
actual val timeout: Long
actual val timeout: Long
expect val timeout: Long

The timeout of the calls made through this reference, in milliseconds.

actual val timeout: Long
actual val timeout: Long
actual val timeout: Long

Functions

Link copied to clipboard
actual fun call(): <Error class: unknown class><HttpsCallableResult>
actual fun call(data: Any?): <Error class: unknown class><HttpsCallableResult>
actual fun call(): <Error class: unknown class><HttpsCallableResult>
actual fun call(data: Any?): <Error class: unknown class><HttpsCallableResult>

The call data goes through the format, which applies the Android SDK's rules before the iOS SDK's serializer sees it. A null goes through the no-data entry point: the iOS SDK's Objective-C one with data boxes a nil as a Swift Optional its serializer rejects, while both send the same JSON null.

expect fun call(): <Error class: unknown class><HttpsCallableResult>

Executes this callable HTTPS trigger without arguments. The request automatically carries the Firebase installation id and, when a user is signed in, their auth token. A failed task carries a FirebaseFunctionsException.

expect fun call(data: Any?): <Error class: unknown class><HttpsCallableResult>

Executes this callable HTTPS trigger with data, which is serialized as JSON: null, a String, a number, a Boolean, a List or a Map with String keys of these (on JS also the JS SDK's own objects and arrays). See call.

actual fun call(): <Error class: unknown class><HttpsCallableResult>
actual fun call(data: Any?): <Error class: unknown class><HttpsCallableResult>

The call data goes through the format, which applies the Android SDK's rules and writes the JS value the JS SDK takes.

actual fun call(): <Error class: unknown class><HttpsCallableResult>
actual fun call(data: Any?): <Error class: unknown class><HttpsCallableResult>
actual fun call(): <Error class: unknown class><HttpsCallableResult>
actual fun call(data: Any?): <Error class: unknown class><HttpsCallableResult>

The call data goes through the format, which applies the Android SDK's rules and writes the JS value the JS SDK takes.

Link copied to clipboard

Executes this callable HTTPS trigger without arguments and suspends until the result arrives; see invoke.

inline suspend operator fun <T> HttpsCallableReference.invoke(data: T, buildSettings: <Error class: unknown class>.() -> Unit = {}): HttpsCallableResult

Executes this callable HTTPS trigger with data, serialized with kotlinx.serialization, and suspends until the result arrives. A failed call throws a FirebaseFunctionsException. See CompatHttpsCallableReference.call.

inline suspend operator fun <T> HttpsCallableReference.invoke(strategy: SerializationStrategy<T>, data: T, buildSettings: <Error class: unknown class>.() -> Unit = {}): HttpsCallableResult

Executes this callable HTTPS trigger with data serialized by strategy; see invoke.

Link copied to clipboard
actual fun setTimeout(timeout: Long, units: TimeUnit)
actual fun setTimeout(timeout: Long, units: <Error class: unknown class>)
expect fun setTimeout(timeout: Long, units: <Error class: unknown class>)

Sets the timeout of the calls made through this reference; Android/JVM only, common code uses setTimeout with a Duration.

actual fun setTimeout(timeout: Long, units: <Error class: unknown class>)
actual fun setTimeout(timeout: Long, units: TimeUnit)
actual fun setTimeout(timeout: Long, units: <Error class: unknown class>)
Link copied to clipboard
actual fun HttpsCallableReference.setTimeout(timeout: <Error class: unknown class>)
expect fun HttpsCallableReference.setTimeout(timeout: <Error class: unknown class>)

Sets the timeout of the calls made through this reference.

actual fun HttpsCallableReference.setTimeout(timeout: <Error class: unknown class>)
actual fun HttpsCallableReference.setTimeout(timeout: <Error class: unknown class>)
Link copied to clipboard
open override fun toString(): String
open override fun toString(): String
open override fun toString(): String
Link copied to clipboard
actual fun withTimeout(timeout: Long, units: TimeUnit): HttpsCallableReference
actual fun withTimeout(timeout: Long, units: <Error class: unknown class>): HttpsCallableReference
expect fun withTimeout(timeout: Long, units: <Error class: unknown class>): HttpsCallableReference

A copy of this reference with the given timeout; Android/JVM only, common code uses withTimeout with a Duration.

actual fun withTimeout(timeout: Long, units: <Error class: unknown class>): HttpsCallableReference
actual fun withTimeout(timeout: Long, units: TimeUnit): HttpsCallableReference
actual fun withTimeout(timeout: Long, units: <Error class: unknown class>): HttpsCallableReference
Link copied to clipboard
actual fun HttpsCallableReference.withTimeout(timeout: <Error class: unknown class>): HttpsCallableReference
expect fun HttpsCallableReference.withTimeout(timeout: <Error class: unknown class>): HttpsCallableReference

A copy of this reference whose calls use the given timeout.

actual fun HttpsCallableReference.withTimeout(timeout: <Error class: unknown class>): HttpsCallableReference
actual fun HttpsCallableReference.withTimeout(timeout: <Error class: unknown class>): HttpsCallableReference