@@ -29,15 +29,15 @@ public actual fun Firebase.functions(app: FirebaseApp, region: String): Firebase
29
29
public val FirebaseFunctions .js: Functions get() = js
30
30
31
31
public actual class FirebaseFunctions internal constructor(internal val js : Functions ) {
32
- public actual fun httpsCallable (name : String , timeout : Duration ? ): HttpsCallableReference =
33
- rethrow {
34
- HttpsCallableReference (
35
- httpsCallable(
36
- js ,
37
- name ,
38
- timeout?. let { json( " timeout " to timeout.toDouble( DurationUnit . MILLISECONDS )) }) .native
39
- )
40
- }
32
+ public actual fun httpsCallable (name : String , timeout : Duration ? ): HttpsCallableReference = rethrow {
33
+ HttpsCallableReference (
34
+ httpsCallable (
35
+ js,
36
+ name ,
37
+ timeout?. let { json( " timeout " to timeout.toDouble( DurationUnit . MILLISECONDS )) } ,
38
+ ) .native,
39
+ )
40
+ }
41
41
42
42
public actual fun useEmulator (host : String , port : Int ) {
43
43
connectFunctionsEmulator(js, host, port)
@@ -66,15 +66,14 @@ public actual class HttpsCallableResult(internal val js: JsHttpsCallableResult)
66
66
67
67
public actual inline fun <T > data (
68
68
strategy : DeserializationStrategy <T >,
69
- buildSettings : DecodeSettings .Builder .() -> Unit
70
- ): T =
71
- rethrow { decode(strategy, publicJs.data, buildSettings) }
69
+ buildSettings : DecodeSettings .Builder .() -> Unit ,
70
+ ): T = rethrow { decode(strategy, publicJs.data, buildSettings) }
72
71
}
73
72
74
73
public actual class FirebaseFunctionsException (
75
74
cause : Throwable ,
76
75
public val code : FunctionsExceptionCode ,
77
- public val details : Any?
76
+ public val details : Any? ,
78
77
) : FirebaseException(cause.message, cause)
79
78
80
79
public actual val FirebaseFunctionsException .code: FunctionsExceptionCode get() = code
@@ -124,97 +123,97 @@ internal fun errorToException(e: dynamic): FirebaseFunctionsException = (e?.code
124
123
" cancelled" in it -> FirebaseFunctionsException (
125
124
e.unsafeCast<Throwable >(),
126
125
FunctionsExceptionCode .CANCELLED ,
127
- e.details
126
+ e.details,
128
127
)
129
128
130
129
" invalid-argument" in it -> FirebaseFunctionsException (
131
130
e.unsafeCast<Throwable >(),
132
131
FunctionsExceptionCode .INVALID_ARGUMENT ,
133
- e.details
132
+ e.details,
134
133
)
135
134
136
135
" deadline-exceeded" in it -> FirebaseFunctionsException (
137
136
e.unsafeCast<Throwable >(),
138
137
FunctionsExceptionCode .DEADLINE_EXCEEDED ,
139
- e.details
138
+ e.details,
140
139
)
141
140
142
141
" not-found" in it -> FirebaseFunctionsException (
143
142
e.unsafeCast<Throwable >(),
144
143
FunctionsExceptionCode .NOT_FOUND ,
145
- e.details
144
+ e.details,
146
145
)
147
146
148
147
" already-exists" in it -> FirebaseFunctionsException (
149
148
e.unsafeCast<Throwable >(),
150
149
FunctionsExceptionCode .ALREADY_EXISTS ,
151
- e.details
150
+ e.details,
152
151
)
153
152
154
153
" permission-denied" in it -> FirebaseFunctionsException (
155
154
e.unsafeCast<Throwable >(),
156
155
FunctionsExceptionCode .PERMISSION_DENIED ,
157
- e.details
156
+ e.details,
158
157
)
159
158
160
159
" resource-exhausted" in it -> FirebaseFunctionsException (
161
160
e.unsafeCast<Throwable >(),
162
161
FunctionsExceptionCode .RESOURCE_EXHAUSTED ,
163
- e.details
162
+ e.details,
164
163
)
165
164
166
165
" failed-precondition" in it -> FirebaseFunctionsException (
167
166
e.unsafeCast<Throwable >(),
168
167
FunctionsExceptionCode .FAILED_PRECONDITION ,
169
- e.details
168
+ e.details,
170
169
)
171
170
172
171
" aborted" in it -> FirebaseFunctionsException (
173
172
e.unsafeCast<Throwable >(),
174
173
FunctionsExceptionCode .ABORTED ,
175
- e.details
174
+ e.details,
176
175
)
177
176
178
177
" out-of-range" in it -> FirebaseFunctionsException (
179
178
e.unsafeCast<Throwable >(),
180
179
FunctionsExceptionCode .OUT_OF_RANGE ,
181
- e.details
180
+ e.details,
182
181
)
183
182
184
183
" unimplemented" in it -> FirebaseFunctionsException (
185
184
e.unsafeCast<Throwable >(),
186
185
FunctionsExceptionCode .UNIMPLEMENTED ,
187
- e.details
186
+ e.details,
188
187
)
189
188
190
189
" internal" in it -> FirebaseFunctionsException (
191
190
e.unsafeCast<Throwable >(),
192
191
FunctionsExceptionCode .INTERNAL ,
193
- e.details
192
+ e.details,
194
193
)
195
194
196
195
" unavailable" in it -> FirebaseFunctionsException (
197
196
e.unsafeCast<Throwable >(),
198
197
FunctionsExceptionCode .UNAVAILABLE ,
199
- e.details
198
+ e.details,
200
199
)
201
200
202
201
" data-loss" in it -> FirebaseFunctionsException (
203
202
e.unsafeCast<Throwable >(),
204
203
FunctionsExceptionCode .DATA_LOSS ,
205
- e.details
204
+ e.details,
206
205
)
207
206
208
207
" unauthenticated" in it -> FirebaseFunctionsException (
209
208
e.unsafeCast<Throwable >(),
210
209
FunctionsExceptionCode .UNAUTHENTICATED ,
211
- e.details
210
+ e.details,
212
211
)
213
212
214
213
" unknown" in it -> FirebaseFunctionsException (
215
214
e.unsafeCast<Throwable >(),
216
215
FunctionsExceptionCode .UNKNOWN ,
217
- e.details
216
+ e.details,
218
217
)
219
218
220
219
else -> {
0 commit comments