-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ff91b42
commit ed22005
Showing
9 changed files
with
317 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
76 changes: 76 additions & 0 deletions
76
kotlin/lib/src/main/java/im/vector/app/features/analytics/plan/PinUnpinAction.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
/* | ||
* Copyright (c) 2021 New Vector Ltd | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package im.vector.app.features.analytics.plan | ||
|
||
import im.vector.app.features.analytics.itf.VectorAnalyticsEvent | ||
|
||
// GENERATED FILE, DO NOT EDIT. FOR MORE INFORMATION VISIT | ||
// https://github.com/matrix-org/matrix-analytics-events/ | ||
|
||
/** | ||
* Triggered when the user pin or unpin a message. | ||
*/ | ||
data class PinUnpinAction( | ||
/** | ||
* From where the action is triggered | ||
*/ | ||
val from: From, | ||
/** | ||
* Is pin or unpin | ||
*/ | ||
val kind: Kind, | ||
) : VectorAnalyticsEvent { | ||
|
||
enum class Kind(val rawValue: String) { | ||
/** | ||
* Pin a message | ||
*/ | ||
Pin("Pin"), | ||
|
||
/** | ||
* Unpin a message | ||
*/ | ||
Unpin("Unpin"), | ||
} | ||
|
||
enum class From(val rawValue: String) { | ||
|
||
/** | ||
* Action triggered from the menu item in message pinning list | ||
*/ | ||
MessagePinningList("MessagePinningList"), | ||
|
||
/** | ||
* Action triggered from the timeline | ||
*/ | ||
Timeline("Timeline"), | ||
|
||
/** | ||
* Action triggered from the Unpin all button in message pinning list | ||
*/ | ||
UnpinAll("UnpinAll"), | ||
} | ||
|
||
override fun getName() = "PinUnpinAction" | ||
|
||
override fun getProperties(): Map<String, Any>? { | ||
return mutableMapOf<String, Any>().apply { | ||
put("from", from.rawValue) | ||
put("kind", kind.rawValue) | ||
}.takeIf { it.isNotEmpty() } | ||
} | ||
} |
41 changes: 41 additions & 0 deletions
41
kotlin/lib/src/main/java/im/vector/app/features/analytics/plan/PinnnedMessageCount.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/* | ||
* Copyright (c) 2021 New Vector Ltd | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package im.vector.app.features.analytics.plan | ||
|
||
import im.vector.app.features.analytics.itf.VectorAnalyticsEvent | ||
|
||
// GENERATED FILE, DO NOT EDIT. FOR MORE INFORMATION VISIT | ||
// https://github.com/matrix-org/matrix-analytics-events/ | ||
|
||
/** | ||
* Number of pinned messages in a room | ||
*/ | ||
data class PinnnedMessageCount( | ||
/** | ||
* Number of pinned messages in a room | ||
*/ | ||
val count: Int, | ||
) : VectorAnalyticsEvent { | ||
|
||
override fun getName() = "PinnedMessageCount" | ||
|
||
override fun getProperties(): Map<String, Any>? { | ||
return mutableMapOf<String, Any>().apply { | ||
put("count", count) | ||
}.takeIf { it.isNotEmpty() } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
{ | ||
"type": "object", | ||
"description": "Triggered when the user pin or unpin a message.", | ||
"properties": { | ||
"eventName": { | ||
"enum": ["PinUnpinAction"] | ||
}, | ||
"kind": { | ||
"description": "Is pin or unpin", | ||
"type": "string", | ||
"oneOf": [ | ||
{"const": "Pin", "description": "Pin a message"}, | ||
{"const": "Unpin", "description": "Unpin a message"} | ||
] | ||
}, | ||
"from": { | ||
"description": "From where the action is triggered", | ||
"type": "string", | ||
"oneOf": [ | ||
{"const": "Timeline", "description": "Action triggered from the timeline"}, | ||
{"const": "MessagePinningList", "description": "Action triggered from the menu item in message pinning list"}, | ||
{"const": "UnpinAll", "description": "Action triggered from the Unpin all button in message pinning list"} | ||
] | ||
} | ||
}, | ||
"required": ["eventName", "kind", "from"], | ||
"additionalProperties": false | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"type": "object", | ||
"description": "Number of pinned messages in a room", | ||
"properties": { | ||
"eventName": { | ||
"enum": ["PinnedMessageCount"] | ||
}, | ||
"count": { | ||
"description": "Number of pinned messages in a room", | ||
"type": "integer" | ||
} | ||
}, | ||
"required": ["eventName", "count"], | ||
"additionalProperties": false | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
// | ||
// Copyright 2021 New Vector Ltd | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// | ||
|
||
import Foundation | ||
|
||
// GENERATED FILE, DO NOT EDIT. FOR MORE INFORMATION VISIT | ||
// https://github.com/matrix-org/matrix-analytics-events/ | ||
|
||
/// Triggered when the user pin or unpin a message. | ||
extension AnalyticsEvent { | ||
public struct PinUnpinAction: AnalyticsEventProtocol { | ||
public let eventName = "PinUnpinAction" | ||
|
||
/// From where the action is triggered | ||
public let from: From | ||
/// Is pin or unpin | ||
public let kind: Kind | ||
|
||
public init(from: From, kind: Kind) { | ||
self.from = from | ||
self.kind = kind | ||
} | ||
|
||
public enum Kind: String { | ||
/// Pin a message | ||
case Pin = "Pin" | ||
/// Unpin a message | ||
case Unpin = "Unpin" | ||
} | ||
|
||
public enum From: String { | ||
/// Action triggered from the menu item in message pinning list | ||
case MessagePinningList = "MessagePinningList" | ||
/// Action triggered from the timeline | ||
case Timeline = "Timeline" | ||
/// Action triggered from the Unpin all button in message pinning list | ||
case UnpinAll = "UnpinAll" | ||
} | ||
|
||
public var properties: [String: Any] { | ||
return [ | ||
"from": from.rawValue, | ||
"kind": kind.rawValue | ||
] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
// | ||
// Copyright 2021 New Vector Ltd | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// | ||
|
||
import Foundation | ||
|
||
// GENERATED FILE, DO NOT EDIT. FOR MORE INFORMATION VISIT | ||
// https://github.com/matrix-org/matrix-analytics-events/ | ||
|
||
/// Number of pinned messages in a room | ||
extension AnalyticsEvent { | ||
public struct PinnnedMessageCount: AnalyticsEventProtocol { | ||
public let eventName = "PinnedMessageCount" | ||
|
||
/// Number of pinned messages in a room | ||
public let count: Int | ||
|
||
public init(count: Int) { | ||
self.count = count | ||
} | ||
|
||
public var properties: [String: Any] { | ||
return [ | ||
"count": count | ||
] | ||
} | ||
} | ||
} |