Skip to content

Commit

Permalink
Sync analytics plan
Browse files Browse the repository at this point in the history
  • Loading branch information
bmarty authored Nov 6, 2023
1 parent 8bfd5f7 commit eb12237
Show file tree
Hide file tree
Showing 5 changed files with 201 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,19 +39,51 @@ data class Composer(
* sent event.
*/
val isReply: Boolean,
/**
* The type of the message.
*/
val messageType: MessageType,
/**
* Whether this message begins a new thread or not.
*/
val startsThread: Boolean? = null,
) : VectorAnalyticsEvent {

enum class MessageType {
/**
* A pin drop location message.
*/
LocationPin,

/**
* A user current location message.
*/
LocationUser,

/**
* A poll message.
*/
Poll,

/**
* A text message.
*/
Text,

/**
* A voice message.
*/
VoiceMessage,
}

override fun getName() = "Composer"

override fun getProperties(): Map<String, Any>? {
return mutableMapOf<String, Any>().apply {
put("inThread", inThread)
put("isEditing", isEditing)
put("isReply", isReply)
put("messageType", messageType.name)
startsThread?.let { put("startsThread", it) }
}.takeIf { it.isNotEmpty() }
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ data class MobileScreen(
*/
Breadcrumbs,

/**
* The screen shown to create a poll.
*/
CreatePollView,

/**
* The screen shown to create a new (non-direct) room.
*/
Expand All @@ -58,6 +63,11 @@ data class MobileScreen(
*/
Dialpad,

/**
* The screen shown to edit a poll.
*/
EditPollView,

/**
* The Favourites tab on mobile that lists your favourite people/rooms.
*/
Expand Down Expand Up @@ -88,6 +98,16 @@ data class MobileScreen(
*/
Invites,

/**
* The screen shown to share location.
*/
LocationSend,

/**
* The screen shown to view a shared location.
*/
LocationView,

/**
* The screen that displays the login flow (when the user already has an
* account).
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
/*
* 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 a poll is created or edited.
*/
data class PollCreation(
/**
* Whether this poll has been created or edited.
*/
val action: Action,
/**
* Whether this poll is undisclosed.
*/
val isUndisclosed: Boolean,
/**
* Number of answers in the poll.
*/
val numberOfAnswers: Int,
) : VectorAnalyticsEvent {

enum class Action {
/**
* Newly created poll
*/
Create,

/**
* Edit of an existing poll
*/
Edit,
}

override fun getName() = "PollCreation"

override fun getProperties(): Map<String, Any>? {
return mutableMapOf<String, Any>().apply {
put("action", action.name)
put("isUndisclosed", isUndisclosed)
put("numberOfAnswers", numberOfAnswers)
}.takeIf { it.isNotEmpty() }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/*
* 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 a poll has been ended.
*/
data class PollEnd(
/**
* Do not use this. Remove this property when the kotlin type generator
* can properly generate types without proprties other than the event
* name.
*/
val doNotUse: Boolean? = null,
) : VectorAnalyticsEvent {

override fun getName() = "PollEnd"

override fun getProperties(): Map<String, Any>? {
return mutableMapOf<String, Any>().apply {
doNotUse?.let { put("doNotUse", it) }
}.takeIf { it.isNotEmpty() }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/*
* 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 a poll vote has been cast.
*/
data class PollVote(
/**
* Do not use this. Remove this property when the kotlin type generator
* can properly generate types without proprties other than the event
* name.
*/
val doNotUse: Boolean? = null,
) : VectorAnalyticsEvent {

override fun getName() = "PollVote"

override fun getProperties(): Map<String, Any>? {
return mutableMapOf<String, Any>().apply {
doNotUse?.let { put("doNotUse", it) }
}.takeIf { it.isNotEmpty() }
}
}

0 comments on commit eb12237

Please sign in to comment.