Skip to content

Commit 880b97c

Browse files
committed
Analytics: import latest plan
1 parent c404699 commit 880b97c

File tree

1 file changed

+62
-0
lines changed

1 file changed

+62
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
/*
2+
* Copyright (c) 2021 New Vector Ltd
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package im.vector.app.features.analytics.plan
18+
19+
import im.vector.app.features.analytics.itf.VectorAnalyticsEvent
20+
21+
// GENERATED FILE, DO NOT EDIT. FOR MORE INFORMATION VISIT
22+
// https://github.com/matrix-org/matrix-analytics-events/
23+
24+
/**
25+
* Triggered when the user becomes unauthenticated without actually clicking sign out(E.g. Due to expiry of an access token without a way to refresh).
26+
*/
27+
data class UnauthenticatedError(
28+
/**
29+
* The error code as defined in matrix spec. The source of this error is from the homeserver.
30+
*/
31+
val errorCode: ErrorCode,
32+
/**
33+
* The reason for the error. The source of this error is from the homeserver, the reason can vary and is subject to change so there is no enum of possible values.
34+
*/
35+
val errorReason: String,
36+
/**
37+
* Whether the auth mechanism is refresh-token-based.
38+
*/
39+
val refreshTokenAuth: Boolean,
40+
/**
41+
* Whether a soft logout or hard logout was triggered.
42+
*/
43+
val softLogout: Boolean,
44+
) : VectorAnalyticsEvent {
45+
46+
enum class ErrorCode {
47+
M_FORBIDDEN,
48+
M_UNKNOWN,
49+
M_UNKNOWN_TOKEN,
50+
}
51+
52+
override fun getName() = "UnauthenticatedError"
53+
54+
override fun getProperties(): Map<String, Any>? {
55+
return mutableMapOf<String, Any>().apply {
56+
put("errorCode", errorCode.name)
57+
put("errorReason", errorReason)
58+
put("refreshTokenAuth", refreshTokenAuth)
59+
put("softLogout", softLogout)
60+
}.takeIf { it.isNotEmpty() }
61+
}
62+
}

0 commit comments

Comments
 (0)