files:
  events:
    classes:
      - name: LoginSuccessfulEvent
        extends: BackgroundEvent
        implements:
          - JsonImplementation
        attributes:
          jid: String
          preStart:
            type: PreStartDoneEvent
            deserialise: true
      - name: LoginFailureEvent
        extends: BackgroundEvent
        implements:
          - JsonImplementation
        attributes:
          reason: String?
      - name: PreStartDoneEvent
        extends: BackgroundEvent
        implements:
          - JsonImplementation
        attributes:
          state: String
          permissionsToRequest: List<int>
          preferences:
            type: PreferencesState
            deserialise: true
          jid: String?
          displayName: String?
          avatarUrl: String?
          avatarHash: String?
          conversations:
            type: List<Conversation>?
            deserialise: true
          roster:
            type: List<RosterItem>?
            deserialise: true
          stickers:
            type: List<StickerPack>?
            deserialise: true
      # Triggered if a conversation has been added.
      # Also returned by [AddConversationCommand]
      - name: ConversationAddedEvent
        extends: BackgroundEvent
        implements:
          - JsonImplementation
        attributes:
          conversation:
            type: Conversation
            deserialise: true
      # Triggered if a conversation has been updated.
      # Also returned by [AddConversationCommand].
      - name: ConversationUpdatedEvent
        extends: BackgroundEvent
        implements:
          - JsonImplementation
        attributes:
          conversation:
            type: Conversation
            deserialise: true
      # Returned by [AddConversationCommand] if no conversation was added or
      # updated.
      - name: NoConversationModifiedEvent
        extends: BackgroundEvent
        implements:
          - JsonImplementation
      # Send by the service if a message has been received or returned by [SendMessageCommand].
      - name: MessageAddedEvent
        extends: BackgroundEvent
        implements:
          - JsonImplementation
        attributes:
          message:
            type: Message
            deserialise: true
      # Send by the service if a message has been updated.
      - name: MessageUpdatedEvent
        extends: BackgroundEvent
        implements:
          - JsonImplementation
        attributes:
          message:
            type: Message
            deserialise: true
      # Send by the service if the blocklist has been modified by a blocklist push or
      # if [BlockJidCommand] or [UnblockJidCommand] have been invoked.
      - name: BlocklistPushEvent
        extends: BackgroundEvent
        implements:
          - JsonImplementation
        attributes:
          added: List<String>
          removed: List<String>
      # Triggered if we receive a blocklist push unblocking every JID
      - name: BlocklistUnblockAllEvent
        extends: BackgroundEvent
        implements:
          - JsonImplementation
      # Triggered in response to a [GetBlocklistCommand]
      - name: GetBlocklistResultEvent
        extends: BackgroundEvent
        implements:
          - JsonImplementation
        attributes:
          entries: List<String>
      # Triggered by DownloadService or UploadService.
      - name: ProgressEvent
        extends: BackgroundEvent
        implements:
          - JsonImplementation
        attributes:
          id: int
          progress: double?
      # Triggered by [RosterService] if we receive a roster push.
      - name: RosterDiffEvent
        extends: BackgroundEvent
        implements:
          - JsonImplementation
        attributes:
          added:
            type: List<RosterItem>
            deserialise: true
            default: "[]"
          modified:
            type: List<RosterItem>
            deserialise: true
            default: "[]"
          removed:
            type: List<String>
            default: "[]"
      # Triggered by the service in response to an [AddContactCommand].
      - name: AddContactResultEvent
        extends: BackgroundEvent
        implements:
          - JsonImplementation
        attributes:
          conversation:
            type: Conversation?
            deserialise: true
          # Indicate if the conversation is new (true) or modified (false).
          # Does not mean anything unless conversation != null.
          added: bool
      # Triggered by the service if our avatar changed
      - name: SelfAvatarChangedEvent
        extends: BackgroundEvent
        implements:
          - JsonImplementation
        attributes:
          path: String
          hash: String
      # Triggered by [CloseConversationCommand]
      - name: CloseConversationEvent
        extends: BackgroundEvent
        implements:
          - JsonImplementation
      # Returned by [GetFeaturesCommand]
      - name: GetFeaturesEvent
        extends: BackgroundEvent
        implements:
          - JsonImplementation
        attributes:
          supportsStreamManagement: bool
          supportsCsi: bool
          supportsUserBlocking: bool
          supportsHttpFileUpload: bool
          supportsCarbons: bool
      # Returned by [SignOutCommand]
      - name: SignedOutEvent
        extends: BackgroundEvent
        implements:
          - JsonImplementation
      # Returned by the service once it is ready
      - name: ServiceReadyEvent 
        extends: BackgroundEvent
        implements:
          - JsonImplementation
      - name: GetConversationOmemoFingerprintsResult
        extends: BackgroundEvent
        implements:
          - JsonImplementation
        attributes:
          fingerprints:
            type: List<OmemoDevice>
            deserialise: true
      - name: GetOwnOmemoFingerprintsResult
        extends: BackgroundEvent
        implements:
          - JsonImplementation
        attributes:
          ownDeviceFingerprint: String
          ownDeviceId: int
          fingerprints:
            type: List<OmemoDevice>
            deserialise: true
      - name: RegenerateOwnDeviceResult
        extends: BackgroundEvent
        implements:
          - JsonImplementation
        attributes:
          device:
            type: OmemoDevice
            deserialise: true
      - name: MessageNotificationTappedEvent
        extends: BackgroundEvent
        implements:
          - JsonImplementation
        attributes:
          conversationJid: String
          title: String
          avatarPath: String
      - name: StickerPackImportSuccessEvent
        extends: BackgroundEvent
        implements:
          - JsonImplementation
        attributes:
          stickerPack:
            type: StickerPack
            deserialise: true
      - name: StickerPackImportFailureEvent
        extends: BackgroundEvent
        implements:
          - JsonImplementation
        attributes:
      - name: FetchStickerPackSuccessResult
        extends: BackgroundEvent
        implements:
          - JsonImplementation
        attributes:
          stickerPack:
            type: StickerPack
            deserialise: true
      - name: FetchStickerPackFailureResult
        extends: BackgroundEvent
        implements:
          - JsonImplementation
        attributes:
      - name: StickerPackInstallSuccessEvent
        extends: BackgroundEvent
        implements:
          - JsonImplementation
        attributes:
          stickerPack:
            type: StickerPack
            deserialise: true
      - name: StickerPackInstallFailureEvent
        extends: BackgroundEvent
        implements:
          - JsonImplementation
        attributes:
      - name: StickerPackAddedEvent
        extends: BackgroundEvent
        implements:
          - JsonImplementation
        attributes:
          stickerPack:
            type: StickerPack
            deserialise: true
      # Returned by [GetPagedMessagesCommand]
      - name: PagedMessagesResultEvent
        extends: BackgroundEvent
        implements:
          - JsonImplementation
        attributes:
          messages:
            type: List<Message>
            deserialise: true
      # Returned by [GetReactionsForMessageCommand]
      - name: ReactionsForMessageResult
        extends: BackgroundEvent
        implements:
          - JsonImplementation
        attributes:
          reactions:
            type: List<ReactionGroup>
            deserialise: true
      # Triggered when the stream negotiations have been completed
      - name: StreamNegotiationsCompletedEvent
        extends: BackgroundEvent
        implements:
          - JsonImplementation
        attributes:
          resumed: bool
      - name: AvatarUpdatedEvent
        extends: BackgroundEvent
        implements:
          - JsonImplementation
        attributes:
          jid: String
          path: String
      # Returned when attempting to start a chat with a groupchat
      - name: JidIsGroupchatEvent
        extends: BackgroundEvent
        implements:
          - JsonImplementation
      # Returned when an error occured
      - name: ErrorEvent
        extends: BackgroundEvent
        implements:
          - JsonImplementation
        attributes:
          errorId: int
    generate_builder: true
    builder_name: "Event"
    builder_baseclass: "BackgroundEvent"
    partof: events.dart
  commands:
    classes:
      - name: LoginCommand
        extends: BackgroundCommand
        implements:
          - JsonImplementation
        attributes:
          jid: String
          password: String
          useDirectTLS: bool
      - name: PerformPreStartCommand
        extends: BackgroundCommand
        implements:
          - JsonImplementation
        attributes:
          systemLocaleCode: String
      - name: AddConversationCommand
        extends: BackgroundCommand
        implements:
          - JsonImplementation
        attributes:
          title: String
          lastMessageBody: String
          avatarUrl: String
          jid: String
          conversationType: String
      - name: SetOpenConversationCommand
        extends: BackgroundCommand
        implements:
          - JsonImplementation
        attributes:
          jid: String?
      - name: SendMessageCommand
        extends: BackgroundCommand
        implements:
          - JsonImplementation
        attributes:
          recipients: List<String>
          body: String
          chatState: String
          quotedMessage:
            type: Message?
            deserialise: true
          editSid: String?
          editId: int?
          currentConversationJid: String?
      - name: SendFilesCommand
        extends: BackgroundCommand
        implements:
          - JsonImplementation
        attributes:
          recipients: List<String>
          paths: List<String>
      - name: BlockJidCommand
        extends: BackgroundCommand
        implements:
          - JsonImplementation
        attributes:
          jid: String
      - name: UnblockJidCommand
        extends: BackgroundCommand
        implements:
          - JsonImplementation
        attributes:
          jid: String
      - name: UnblockAllCommand
        extends: BackgroundCommand
        implements:
          - JsonImplementation
      - name: SetCSIStateCommand
        extends: BackgroundCommand
        implements:
          - JsonImplementation
        attributes:
          active: bool
      - name: SetPreferencesCommand
        extends: BackgroundCommand
        implements:
          - JsonImplementation
        attributes:
          preferences:
            type: PreferencesState
            deserialise: true
      - name: AddContactCommand
        extends: BackgroundCommand
        implements:
          - JsonImplementation
        attributes:
          jid: String
      - name: RemoveContactCommand
        extends: BackgroundCommand
        implements:
          - JsonImplementation
        attributes:
          jid: String
      - name: RequestDownloadCommand
        extends: BackgroundCommand
        implements:
          - JsonImplementation
        attributes:
          message:
            type: Message
            deserialise: true
      - name: SetAvatarCommand
        extends: BackgroundCommand
        implements:
          - JsonImplementation
        attributes:
          path: String
          hash: String
      - name: SetShareOnlineStatusCommand
        extends: BackgroundCommand
        implements:
          - JsonImplementation
        attributes:
          jid: String
          share: bool
      - name: CloseConversationCommand
        extends: BackgroundCommand
        implements:
          - JsonImplementation
        attributes:
          jid: String
      - name: SendChatStateCommand
        extends: BackgroundCommand
        implements:
          - JsonImplementation
        attributes:
          state: String
          jid: String
      - name: GetFeaturesCommand
        extends: BackgroundCommand
        implements:
          - JsonImplementation
      - name: SignOutCommand 
        extends: BackgroundCommand
        implements:
          - JsonImplementation
      - name: SetConversationMuteStatusCommand
        extends: BackgroundCommand
        implements:
          - JsonImplementation
        attributes:
          jid: String
          muted: bool
      - name: GetConversationOmemoFingerprintsCommand
        extends: BackgroundCommand
        implements:
          - JsonImplementation
        attributes:
          jid: String
      - name: SetOmemoDeviceEnabledCommand
        extends: BackgroundCommand
        implements:
          - JsonImplementation
        attributes:
          jid: String
          deviceId: int
          enabled: bool
      - name: RecreateSessionsCommand
        extends: BackgroundCommand
        implements:
          - JsonImplementation
        attributes:
          jid: String
      - name: SetOmemoEnabledCommand
        extends: BackgroundCommand
        implements:
          - JsonImplementation
        attributes:
          jid: String
          enabled: bool
      - name: GetOwnOmemoFingerprintsCommand
        extends: BackgroundCommand
        implements:
          - JsonImplementation
        attributes:
      - name: RemoveOwnDeviceCommand
        extends: BackgroundCommand
        implements:
          - JsonImplementation
        attributes:
          deviceId: int
      - name: RegenerateOwnDeviceCommand
        extends: BackgroundCommand
        implements:
          - JsonImplementation
        attributes:
      - name: RetractMessageCommentCommand
        extends: BackgroundCommand
        implements:
          - JsonImplementation
        attributes:
          originId: String
          conversationJid: String
      - name: MarkConversationAsReadCommand
        extends: BackgroundCommand
        implements:
          - JsonImplementation
        attributes:
          conversationJid: String
      - name: MarkMessageAsReadCommand
        extends: BackgroundCommand
        implements:
          - JsonImplementation
        attributes:
          conversationJid: String
          sid: String
          newUnreadCounter: int
      - name: MarkMessageAsReadScrolledCommand
        extends: BackgroundCommand
        implements:
          - JsonImplementation
        attributes:
          conversationJid: String
          sid: String
          id: int
      - name: AddReactionToMessageCommand
        extends: BackgroundCommand
        implements:
          - JsonImplementation
        attributes:
          messageId: int
          conversationJid: String
          emoji: String
      - name: RemoveReactionFromMessageCommand
        extends: BackgroundCommand
        implements:
          - JsonImplementation
        attributes:
          messageId: int
          conversationJid: String
          emoji: String
      - name: MarkOmemoDeviceAsVerifiedCommand
        extends: BackgroundCommand
        implements:
          - JsonImplementation
        attributes:
          deviceId: int
          jid: String
      - name: ImportStickerPackCommand
        extends: BackgroundCommand
        implements:
          - JsonImplementation
        attributes:
          path: String
      - name: RemoveStickerPackCommand
        extends: BackgroundCommand
        implements:
          - JsonImplementation
        attributes:
          stickerPackId: String
      - name: SendStickerCommand
        extends: BackgroundCommand
        implements:
          - JsonImplementation
        attributes:
          sticker:
            type: Sticker
            deserialise: true
          recipient: String
          quotes:
            type: Message?
            deserialise: true
      - name: FetchStickerPackCommand
        extends: BackgroundCommand
        implements:
          - JsonImplementation
        attributes:
          stickerPackId: String
          jid: String
      - name: InstallStickerPackCommand
        extends: BackgroundCommand
        implements:
          - JsonImplementation
        attributes:
          stickerPack:
            type: StickerPack
            deserialise: true
      - name: GetBlocklistCommand
        extends: BackgroundCommand
        implements:
          - JsonImplementation
        attributes:
      - name: GetPagedMessagesCommand
        extends: BackgroundCommand
        implements:
          - JsonImplementation
        attributes:
          conversationJid: String
          olderThan: bool
          timestamp: int?
      - name: GetPagedSharedMediaCommand
        extends: BackgroundCommand
        implements:
          - JsonImplementation
        attributes:
          conversationJid: String
          olderThan: bool
          timestamp: int?
      - name: GetReactionsForMessageCommand
        extends: BackgroundCommand
        implements:
          - JsonImplementation
        attributes:
          messageId: int
      - name: RequestAvatarForJidCommand
        extends: BackgroundCommand
        implements:
          - JsonImplementation
        attributes:
          jid: String
          hash: String?
          ownAvatar: bool
      - name: DebugCommand
        extends: BackgroundCommand
        implements:
          - JsonImplementation
        attributes:
          id: int
    generate_builder: true
    # get${builder_Name}FromJson
    builder_name: "Command"
    builder_baseclass: "BackgroundCommand"
    partof: commands.dart
