diff --git a/schemas/Composer.json b/schemas/Composer.json index 3bdd1cc..6639f4f 100644 --- a/schemas/Composer.json +++ b/schemas/Composer.json @@ -21,19 +21,17 @@ "description": "Whether this message begins a new thread or not.", "type": "boolean" }, - "isLocation": { - "description": "Whether this message it's a shared location.", - "type": "boolean" - }, - "locationType": { - "description": "The type of the shared location", - "type": "string", + "messageType": { + "description": "The type of the message.", + "type": "string", "oneOf": [ - {"const": "PinDrop", "description": "Pin drop location"}, - {"const": "MyLocation", "description": "User current location"} + {"const": "Text", "description": "A text message."}, + {"const": "LocationPin", "description": "A pin drop location message."}, + {"const": "LocationUser", "description": "A user current location message."}, + {"const": "Poll", "description": "A poll message."} ] } }, - "required": ["eventName", "isEditing", "isReply", "inThread", "isLocation"], + "required": ["eventName", "isEditing", "isReply", "inThread", "messageType"], "additionalProperties": false } diff --git a/schemas/MobileScreen.json b/schemas/MobileScreen.json index 4389fde..e7380bc 100644 --- a/schemas/MobileScreen.json +++ b/schemas/MobileScreen.json @@ -64,7 +64,9 @@ {"const": "Invites", "description": "Room accessed via space bottom sheet list."}, {"const": "CreateSpace", "description": "The screen shown to create a new space."}, {"const": "LocationSend", "description": "The screen shown to share location."}, - {"const": "LocationView", "description": "The screen shown to view a shared location."} + {"const": "LocationView", "description": "The screen shown to view a shared location."}, + {"const": "CreatePollView", "description": "The screen shown to create a poll."}, + {"const": "EditPollView", "description": "The screen shown to edit a poll."} ] }, "durationMs": { diff --git a/schemas/PollCreation.json b/schemas/PollCreation.json new file mode 100644 index 0000000..e3f0318 --- /dev/null +++ b/schemas/PollCreation.json @@ -0,0 +1,27 @@ +{ + "type": "object", + "description": "Triggered when a poll is created or edited.", + "properties": { + "eventName": { + "enum": ["PollCreation"] + }, + "action": { + "description": "Whether this poll has been created or edited.", + "type": "string", + "oneOf": [ + {"const": "Create", "description": "Newly created poll"}, + {"const": "Edit", "description": "Edit of an existing poll"} + ] + }, + "isUndisclosed": { + "description": "Whether this poll is undisclosed.", + "type": "boolean" + }, + "numberOfAnswers": { + "description": "Number of answers in the poll.", + "type": "integer" + } + }, + "required": ["action", "numberOfAnswers", "isUndisclosed", "eventName"], + "additionalProperties": false +} diff --git a/schemas/PollEnd.json b/schemas/PollEnd.json new file mode 100644 index 0000000..152f8ac --- /dev/null +++ b/schemas/PollEnd.json @@ -0,0 +1,15 @@ +{ + "type": "object", + "description": "Triggered when a poll has been ended.", + "properties": { + "eventName": { + "enum": ["PollEnd"] + }, + "doNotUse": { + "description": "Do not use this. Remove this property when the kotlin type generator can properly generate types without proprties other than the event name.", + "type": "boolean" + } + }, + "required": ["eventName"], + "additionalProperties": false +} diff --git a/schemas/PollVote.json b/schemas/PollVote.json new file mode 100644 index 0000000..57f600f --- /dev/null +++ b/schemas/PollVote.json @@ -0,0 +1,15 @@ +{ + "type": "object", + "description": "Triggered when a poll vote has been cast.", + "properties": { + "eventName": { + "enum": ["PollVote"] + }, + "doNotUse": { + "description": "Do not use this. Remove this property when the kotlin type generator can properly generate types without proprties other than the event name.", + "type": "boolean" + } + }, + "required": ["eventName"], + "additionalProperties": false +} diff --git a/types/kotlin/Composer.kt b/types/kotlin/Composer.kt index 59a3e31..fb8b0f7 100644 --- a/types/kotlin/Composer.kt +++ b/types/kotlin/Composer.kt @@ -16,20 +16,15 @@ data class Composer ( */ val isEditing: Boolean, - /** - * Whether this message it's a shared location. - */ - val isLocation: Boolean, - /** * Whether the user's composer interaction was a reply to a previously sent event. */ val isReply: Boolean, /** - * The type of the shared location + * The type of the message. */ - val locationType: String? = null, + val messageType: String, /** * Whether this message begins a new thread or not. diff --git a/types/kotlin/PollCreation.kt b/types/kotlin/PollCreation.kt new file mode 100644 index 0000000..1b9878f --- /dev/null +++ b/types/kotlin/PollCreation.kt @@ -0,0 +1,27 @@ +package quicktype + +/** + * Triggered when a poll is created or edited. + */ +data class PollCreation ( + /** + * Whether this poll has been created or edited. + */ + val action: String, + + val eventName: EventName, + + /** + * Whether this poll is undisclosed. + */ + val isUndisclosed: Boolean, + + /** + * Number of answers in the poll. + */ + val numberOfAnswers: Long +) + +enum class EventName { + PollCreation +} diff --git a/types/kotlin/PollEnd.kt b/types/kotlin/PollEnd.kt new file mode 100644 index 0000000..bd7a1f6 --- /dev/null +++ b/types/kotlin/PollEnd.kt @@ -0,0 +1,18 @@ +package quicktype + +/** + * 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, + + val eventName: EventName +) + +enum class EventName { + PollEnd +} diff --git a/types/kotlin/PollVote.kt b/types/kotlin/PollVote.kt new file mode 100644 index 0000000..70d1fe3 --- /dev/null +++ b/types/kotlin/PollVote.kt @@ -0,0 +1,18 @@ +package quicktype + +/** + * 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, + + val eventName: EventName +) + +enum class EventName { + PollVote +} diff --git a/types/kotlin2/Composer.kt b/types/kotlin2/Composer.kt index c1af3e3..9b299e7 100644 --- a/types/kotlin2/Composer.kt +++ b/types/kotlin2/Composer.kt @@ -34,35 +34,41 @@ data class Composer( * event. */ val isEditing: Boolean, - /** - * Whether this message it's a shared location. - */ - val isLocation: Boolean, /** * Whether the user's composer interaction was a reply to a previously * sent event. */ val isReply: Boolean, /** - * The type of the shared location + * The type of the message. */ - val locationType: LocationType? = null, + val messageType: MessageType, /** * Whether this message begins a new thread or not. */ val startsThread: Boolean? = null, ) : VectorAnalyticsEvent { - enum class LocationType { + enum class MessageType { + /** + * A pin drop location message. + */ + LocationPin, + + /** + * A user current location message. + */ + LocationUser, + /** - * User current location + * A poll message. */ - MyLocation, + Poll, /** - * Pin drop location + * A text message. */ - PinDrop, + Text, } override fun getName() = "Composer" @@ -71,9 +77,8 @@ data class Composer( return mutableMapOf().apply { put("inThread", inThread) put("isEditing", isEditing) - put("isLocation", isLocation) put("isReply", isReply) - locationType?.let { put("locationType", it.name) } + put("messageType", messageType.name) startsThread?.let { put("startsThread", it) } }.takeIf { it.isNotEmpty() } } diff --git a/types/kotlin2/MobileScreen.kt b/types/kotlin2/MobileScreen.kt index ad1e38e..59b53aa 100644 --- a/types/kotlin2/MobileScreen.kt +++ b/types/kotlin2/MobileScreen.kt @@ -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. */ @@ -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. */ diff --git a/types/kotlin2/PollCreation.kt b/types/kotlin2/PollCreation.kt new file mode 100644 index 0000000..ebb7a3e --- /dev/null +++ b/types/kotlin2/PollCreation.kt @@ -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? { + return mutableMapOf().apply { + put("action", action.name) + put("isUndisclosed", isUndisclosed) + put("numberOfAnswers", numberOfAnswers) + }.takeIf { it.isNotEmpty() } + } +} diff --git a/types/kotlin2/PollEnd.kt b/types/kotlin2/PollEnd.kt new file mode 100644 index 0000000..f55e395 --- /dev/null +++ b/types/kotlin2/PollEnd.kt @@ -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? { + return mutableMapOf().apply { + doNotUse?.let { put("doNotUse", it) } + }.takeIf { it.isNotEmpty() } + } +} diff --git a/types/kotlin2/PollVote.kt b/types/kotlin2/PollVote.kt new file mode 100644 index 0000000..722f52b --- /dev/null +++ b/types/kotlin2/PollVote.kt @@ -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? { + return mutableMapOf().apply { + doNotUse?.let { put("doNotUse", it) } + }.takeIf { it.isNotEmpty() } + } +} diff --git a/types/swift/Composer.swift b/types/swift/Composer.swift index c0fe795..2db40cc 100644 --- a/types/swift/Composer.swift +++ b/types/swift/Composer.swift @@ -28,38 +28,38 @@ extension AnalyticsEvent { public let inThread: Bool /// Whether the user's composer interaction was editing a previously sent event. public let isEditing: Bool - /// Whether this message it's a shared location. - public let isLocation: Bool /// Whether the user's composer interaction was a reply to a previously sent event. public let isReply: Bool - /// The type of the shared location - public let locationType: LocationType? + /// The type of the message. + public let messageType: MessageType /// Whether this message begins a new thread or not. public let startsThread: Bool? - public init(inThread: Bool, isEditing: Bool, isLocation: Bool, isReply: Bool, locationType: LocationType?, startsThread: Bool?) { + public init(inThread: Bool, isEditing: Bool, isReply: Bool, messageType: MessageType, startsThread: Bool?) { self.inThread = inThread self.isEditing = isEditing - self.isLocation = isLocation self.isReply = isReply - self.locationType = locationType + self.messageType = messageType self.startsThread = startsThread } - public enum LocationType: String { - /// User current location - case MyLocation - /// Pin drop location - case PinDrop + public enum MessageType: String { + /// A pin drop location message. + case LocationPin + /// A user current location message. + case LocationUser + /// A poll message. + case Poll + /// A text message. + case Text } public var properties: [String: Any] { return [ "inThread": inThread, "isEditing": isEditing, - "isLocation": isLocation, "isReply": isReply, - "locationType": locationType?.rawValue as Any, + "messageType": messageType.rawValue, "startsThread": startsThread as Any ] } diff --git a/types/swift/MobileScreen.swift b/types/swift/MobileScreen.swift index c052446..a09f071 100644 --- a/types/swift/MobileScreen.swift +++ b/types/swift/MobileScreen.swift @@ -35,6 +35,8 @@ extension AnalyticsEvent { public enum ScreenName: String { /// The screen that displays the user's breadcrumbs. case Breadcrumbs + /// The screen shown to create a poll. + case CreatePollView /// The screen shown to create a new (non-direct) room. case CreateRoom /// The screen shown to create a new space. @@ -43,6 +45,8 @@ extension AnalyticsEvent { case DeactivateAccount /// The tab on mobile that displays the dialpad. case Dialpad + /// The screen shown to edit a poll. + case EditPollView /// The Favourites tab on mobile that lists your favourite people/rooms. case Favourites /// The form for the forgot password use case. diff --git a/types/swift/PollCreation.swift b/types/swift/PollCreation.swift new file mode 100644 index 0000000..1a58bd6 --- /dev/null +++ b/types/swift/PollCreation.swift @@ -0,0 +1,55 @@ +// +// 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 a poll is created or edited. +extension AnalyticsEvent { + public struct PollCreation: AnalyticsEventProtocol { + public let eventName = "PollCreation" + + /// Whether this poll has been created or edited. + public let action: Action + /// Whether this poll is undisclosed. + public let isUndisclosed: Bool + /// Number of answers in the poll. + public let numberOfAnswers: Int + + public init(action: Action, isUndisclosed: Bool, numberOfAnswers: Int) { + self.action = action + self.isUndisclosed = isUndisclosed + self.numberOfAnswers = numberOfAnswers + } + + public enum Action: String { + /// Newly created poll + case Create + /// Edit of an existing poll + case Edit + } + + public var properties: [String: Any] { + return [ + "action": action.rawValue, + "isUndisclosed": isUndisclosed, + "numberOfAnswers": numberOfAnswers + ] + } + } +} diff --git a/types/swift/PollEnd.swift b/types/swift/PollEnd.swift new file mode 100644 index 0000000..310cf05 --- /dev/null +++ b/types/swift/PollEnd.swift @@ -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/ + +/// Triggered when a poll has been ended. +extension AnalyticsEvent { + public struct PollEnd: AnalyticsEventProtocol { + public let eventName = "PollEnd" + + /// Do not use this. Remove this property when the kotlin type generator can properly generate types without proprties other than the event name. + public let doNotUse: Bool? + + public init(doNotUse: Bool?) { + self.doNotUse = doNotUse + } + + public var properties: [String: Any] { + return [ + "doNotUse": doNotUse as Any + ] + } + } +} diff --git a/types/swift/PollVote.swift b/types/swift/PollVote.swift new file mode 100644 index 0000000..f4f652f --- /dev/null +++ b/types/swift/PollVote.swift @@ -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/ + +/// Triggered when a poll vote has been cast. +extension AnalyticsEvent { + public struct PollVote: AnalyticsEventProtocol { + public let eventName = "PollVote" + + /// Do not use this. Remove this property when the kotlin type generator can properly generate types without proprties other than the event name. + public let doNotUse: Bool? + + public init(doNotUse: Bool?) { + self.doNotUse = doNotUse + } + + public var properties: [String: Any] { + return [ + "doNotUse": doNotUse as Any + ] + } + } +}