Skip to content

Commit 751120f

Browse files
emilypgoogleVinayGuthal
authored andcommitted
Adjust Functions Kotlin docs for release
1 parent c2f8014 commit 751120f

File tree

7 files changed

+31
-31
lines changed

7 files changed

+31
-31
lines changed

firebase-functions/src/main/java/com/google/firebase/functions/FirebaseFunctions.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ internal constructor(
151151
}
152152
}
153153

154-
@Deprecated("Use {@link #useEmulator(String, int)} to connect to the emulator. ")
154+
@Deprecated("Use useEmulator to connect to the emulator.")
155155
public fun useFunctionsEmulator(origin: String) {
156156
Preconditions.checkNotNull(origin, "origin cannot be null")
157157
urlFormat = "$origin/%2\$s/%1\$s/%3\$s"

firebase-functions/src/main/java/com/google/firebase/functions/FirebaseFunctionsException.kt

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ public class FirebaseFunctionsException : FirebaseException {
2929
*/
3030
public enum class Code(private val value: Int) {
3131
/**
32-
* The operation completed successfully. FirebaseFunctionsException will never have a status of
33-
* OK.
32+
* The operation completed successfully. `FirebaseFunctionsException` will never have a status of
33+
* `OK`.
3434
*/
3535
OK(0),
3636

@@ -41,9 +41,9 @@ public class FirebaseFunctionsException : FirebaseException {
4141
UNKNOWN(2),
4242

4343
/**
44-
* Client specified an invalid argument. Note that this differs from FAILED_PRECONDITION.
45-
* INVALID_ARGUMENT indicates arguments that are problematic regardless of the state of the
46-
* system (e.g., an invalid field name).
44+
* Client specified an invalid argument. Note that this differs from `FAILED_PRECONDITION`.
45+
* `INVALID_ARGUMENT` indicates arguments that are problematic regardless of the state of the
46+
* system (For example, an invalid field name).
4747
*/
4848
INVALID_ARGUMENT(3),
4949

@@ -126,12 +126,12 @@ public class FirebaseFunctionsException : FirebaseException {
126126
}
127127

128128
/**
129-
* Takes an HTTP status code and returns the corresponding FUNErrorCode error code. This is
129+
* Takes an HTTP status code and returns the corresponding [Code] error code. This is
130130
* the standard HTTP status code -> error mapping defined in:
131131
* https://github.com/googleapis/googleapis/blob/master/google/rpc/code.proto
132132
*
133133
* @param status An HTTP status code.
134-
* @return The corresponding Code, or Code.UNKNOWN if none.
134+
* @return The corresponding `Code`, or `Code.UNKNOWN` if none.
135135
*/
136136
@JvmStatic
137137
public fun fromHttpStatus(status: Int): Code {
@@ -157,7 +157,7 @@ public class FirebaseFunctionsException : FirebaseException {
157157
/**
158158
* Gets the error code for the operation that failed.
159159
*
160-
* @return the code for the FirebaseFunctionsException
160+
* @return the code for the `FirebaseFunctionsException`
161161
*/
162162
public val code: Code
163163

@@ -183,7 +183,7 @@ public class FirebaseFunctionsException : FirebaseException {
183183
this.details = details
184184
}
185185

186-
public companion object {
186+
internal companion object {
187187
/**
188188
* Takes an HTTP response and returns the corresponding Exception if any.
189189
*
@@ -193,7 +193,7 @@ public class FirebaseFunctionsException : FirebaseException {
193193
* @return The corresponding Exception, or null if none.
194194
*/
195195
@JvmStatic
196-
public fun fromResponse(
196+
internal fun fromResponse(
197197
code: Code,
198198
body: String?,
199199
serializer: Serializer

firebase-functions/src/main/java/com/google/firebase/functions/HttpsCallOptions.kt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,22 +17,22 @@ import java.util.concurrent.TimeUnit
1717
import okhttp3.OkHttpClient
1818

1919
/** An internal class for keeping track of options applied to an HttpsCallableReference. */
20-
public class HttpsCallOptions {
20+
internal class HttpsCallOptions {
2121
// The timeout to use for calls from references created by this Functions.
2222
private var timeout = DEFAULT_TIMEOUT
2323
private var timeoutUnits = DEFAULT_TIMEOUT_UNITS
2424
@JvmField public val limitedUseAppCheckTokens: Boolean
2525

2626
/** Creates an (internal) HttpsCallOptions from the (external) [HttpsCallableOptions]. */
27-
public constructor(publicCallableOptions: HttpsCallableOptions) {
27+
internal constructor(publicCallableOptions: HttpsCallableOptions) {
2828
limitedUseAppCheckTokens = publicCallableOptions.limitedUseAppCheckTokens
2929
}
3030

31-
public constructor() {
31+
internal constructor() {
3232
limitedUseAppCheckTokens = false
3333
}
3434

35-
public fun getLimitedUseAppCheckTokens(): Boolean {
35+
internal fun getLimitedUseAppCheckTokens(): Boolean {
3636
return limitedUseAppCheckTokens
3737
}
3838

@@ -42,7 +42,7 @@ public class HttpsCallOptions {
4242
* @param timeout The length of the timeout, in the given units.
4343
* @param units The units for the specified timeout.
4444
*/
45-
public fun setTimeout(timeout: Long, units: TimeUnit) {
45+
internal fun setTimeout(timeout: Long, units: TimeUnit) {
4646
this.timeout = timeout
4747
timeoutUnits = units
4848
}
@@ -52,12 +52,12 @@ public class HttpsCallOptions {
5252
*
5353
* @return The timeout, in milliseconds.
5454
*/
55-
public fun getTimeout(): Long {
55+
internal fun getTimeout(): Long {
5656
return timeoutUnits.toMillis(timeout)
5757
}
5858

5959
/** Creates a new OkHttpClient with these options applied to it. */
60-
public fun apply(client: OkHttpClient): OkHttpClient {
60+
internal fun apply(client: OkHttpClient): OkHttpClient {
6161
return client
6262
.newBuilder()
6363
.callTimeout(timeout, timeoutUnits)

firebase-functions/src/main/java/com/google/firebase/functions/HttpsCallableOptions.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ private constructor(
3131
return limitedUseAppCheckTokens
3232
}
3333

34-
/** Builder class for [com.google.firebase.functions.HttpsCallableOptions] */
34+
/** A builder for creating [com.google.firebase.functions.HttpsCallableOptions]. */
3535
public class Builder {
3636
@JvmField public var limitedUseAppCheckTokens: Boolean = false
3737

firebase-functions/src/main/java/com/google/firebase/functions/HttpsCallableReference.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public class HttpsCallableReference {
3232
private val url: URL?
3333

3434
// Options for how to do the HTTPS call.
35-
@VisibleForTesting public val options: HttpsCallOptions
35+
@VisibleForTesting internal val options: HttpsCallOptions
3636

3737
/** Creates a new reference with the given options. */
3838
internal constructor(
@@ -81,7 +81,7 @@ public class HttpsCallableReference {
8181
* Auth, an auth token for the user will also be automatically included.
8282
*
8383
* Firebase Instance ID sends data to the Firebase backend periodically to collect information
84-
* regarding the app instance. To stop this, see [ ]
84+
* regarding the app instance. To stop this, see
8585
* [com.google.firebase.iid.FirebaseInstanceId.deleteInstanceId]. It will resume with a new
8686
* Instance ID the next time you call this method.
8787
*
@@ -111,7 +111,7 @@ public class HttpsCallableReference {
111111
* Auth, an auth token for the user will also be automatically included.
112112
*
113113
* Firebase Instance ID sends data to the Firebase backend periodically to collect information
114-
* regarding the app instance. To stop this, see [ ]
114+
* regarding the app instance. To stop this, see
115115
* [com.google.firebase.iid.FirebaseInstanceId.deleteInstanceId]. It will resume with a new
116116
* Instance ID the next time you call this method.
117117
*

firebase-functions/src/main/java/com/google/firebase/functions/HttpsCallableResult.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,16 @@
1313
// limitations under the License.
1414
package com.google.firebase.functions
1515

16-
/** The result of calling a HttpsCallableReference function. */
16+
/** The result of calling a `HttpsCallableReference` function. */
1717
public class HttpsCallableResult
1818
internal constructor( // The actual result data, as generic types decoded from JSON.
1919
private val data: Any?) {
2020
/**
2121
* Returns the data that was returned from the Callable HTTPS trigger.
2222
*
2323
* The data is in the form of native Java objects. For example, if your trigger returned an array,
24-
* this object would be a List<Object>. If your trigger returned a JavaScript object with keys and
25-
* values, this object would be a Map<String, Object>.
24+
* this object would be a `List<Object>`. If your trigger returned a JavaScript object with keys and
25+
* values, this object would be a `Map<String, Object>`.
2626
*/
2727
public fun getData(): Any? {
2828
return data

firebase-functions/src/main/java/com/google/firebase/functions/Serializer.kt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import org.json.JSONException
2323
import org.json.JSONObject
2424

2525
/** Converts raw Java types into JSON objects. */
26-
public class Serializer {
26+
internal class Serializer {
2727
private val dateFormat: DateFormat
2828

2929
init {
@@ -32,7 +32,7 @@ public class Serializer {
3232
dateFormat.timeZone = TimeZone.getTimeZone("UTC")
3333
}
3434

35-
public fun encode(obj: Any?): Any {
35+
internal fun encode(obj: Any?): Any {
3636
if (obj == null || obj === JSONObject.NULL) {
3737
return JSONObject.NULL
3838
}
@@ -113,7 +113,7 @@ public class Serializer {
113113
throw IllegalArgumentException("Object cannot be encoded in JSON: $obj")
114114
}
115115

116-
public fun decode(obj: Any): Any? {
116+
internal fun decode(obj: Any): Any? {
117117
// TODO: Maybe this should throw a FirebaseFunctionsException instead?
118118
if (obj is Number) {
119119
return obj
@@ -170,11 +170,11 @@ public class Serializer {
170170
throw IllegalArgumentException("Object cannot be decoded from JSON: $obj")
171171
}
172172

173-
public companion object {
173+
internal companion object {
174174
@VisibleForTesting
175-
public const val LONG_TYPE: String = "type.googleapis.com/google.protobuf.Int64Value"
175+
internal const val LONG_TYPE: String = "type.googleapis.com/google.protobuf.Int64Value"
176176

177177
@VisibleForTesting
178-
public const val UNSIGNED_LONG_TYPE: String = "type.googleapis.com/google.protobuf.UInt64Value"
178+
internal const val UNSIGNED_LONG_TYPE: String = "type.googleapis.com/google.protobuf.UInt64Value"
179179
}
180180
}

0 commit comments

Comments
 (0)