Class Message

    • Field Detail

      • fileHandlerClass

        public static java.lang.Class<? extends FileHandler> fileHandlerClass
    • Constructor Detail

      • Message

        public Message()
    • Method Detail

      • getAdditionalFields

        public java.util.Map<java.lang.String,​java.lang.Object> getAdditionalFields()
      • setAdditionalField

        public void setAdditionalField​(java.lang.String name,
                                       java.lang.Object value)
      • send

        @NotNull
        public static Message.MessageSendRequestData.MessageSendRequest send​(@NotNull
                                                                             java.lang.String channelType,
                                                                             @NotNull
                                                                             java.lang.String channelId)
        Creates send request
        Parameters:
        channelType - the channel type
        channelId - the channel id
        Returns:
        the created request
      • get

        @NotNull
        public static Message.MessageGetRequest get​(@NotNull
                                                    java.lang.String id)
        Creates a get request
        Parameters:
        id - the message id
        Returns:
        the created request
      • delete

        @NotNull
        public static Message.MessageDeleteRequest delete​(@NotNull
                                                          java.lang.String id)
        Creates an delete request
        Parameters:
        id - the message id
        Returns:
        the created request
      • uploadFile

        @NotNull
        public static Message.MessageUploadFileRequest uploadFile​(@NotNull
                                                                  java.lang.String channelType,
                                                                  @NotNull
                                                                  java.lang.String channelId,
                                                                  @NotNull
                                                                  java.lang.String userId,
                                                                  @Nullable
                                                                  java.lang.String contentType)
        Creates a file upload request
        Parameters:
        channelType - the channel type
        channelId - the channel id
        userId - the id of the user sending this file
        contentType - the content type of the file to send
        Returns:
        the created request
      • uploadImage

        @NotNull
        public static Message.MessageUploadImageRequest uploadImage​(@NotNull
                                                                    java.lang.String channelType,
                                                                    @NotNull
                                                                    java.lang.String channelId,
                                                                    @NotNull
                                                                    java.lang.String userId,
                                                                    @NotNull
                                                                    java.lang.String contentType)
        Creates an image upload request
        Parameters:
        channelType - the channel type
        channelId - the channel id
        userId - the id of the user sending this image
        contentType - the content type of the image to send
        Returns:
        the created request
      • deleteFile

        @NotNull
        public static Message.MessageDeleteFileRequest deleteFile​(@NotNull
                                                                  java.lang.String channelType,
                                                                  @NotNull
                                                                  java.lang.String channelId,
                                                                  @NotNull
                                                                  java.lang.String url)
        Creates a delete file request
        Parameters:
        channelType - the channel type
        channelId - the channel id
        url - the file url
        Returns:
        the created request
      • deleteImage

        @NotNull
        public static Message.MessageDeleteImageRequest deleteImage​(@NotNull
                                                                    java.lang.String channelType,
                                                                    @NotNull
                                                                    java.lang.String channelId,
                                                                    @NotNull
                                                                    java.lang.String url)
        Creates a delete image request
        Parameters:
        channelType - the channel type
        channelId - the channel id
        url - the image url
        Returns:
        the created request
      • getMany

        @NotNull
        public static Message.MessageGetManyRequest getMany​(@NotNull
                                                            java.lang.String channelType,
                                                            @NotNull
                                                            java.lang.String channelId,
                                                            @NotNull
                                                            java.util.List<java.lang.String> messageIds)
        Creates a get many request
        Parameters:
        channelType - the channel type
        channelId - the channel id
        messageIds - the message ids
        Returns:
        the created request
      • getReplies

        @NotNull
        public static Message.MessageGetRepliesRequest getReplies​(@NotNull
                                                                  java.lang.String parentMessageId)
        Creates a get replies request
        Parameters:
        parentMessageId - the parent message id
        Returns:
        the created request
      • flag

        @NotNull
        public static Flag.FlagCreateRequestData.FlagCreateRequest flag​(@NotNull
                                                                        java.lang.String messageId)
        Creates a flag request
        Parameters:
        messageId - the message id to flag
        Returns:
        the created request
      • unflag

        @NotNull
        public static Flag.FlagDeleteRequestData.FlagDeleteRequest unflag​(@NotNull
                                                                          java.lang.String messageId)
        Creates a unflag request
        Parameters:
        messageId - the message id to unflag
        Returns:
        the created request
      • pinMessage

        @NotNull
        public static Message.MessagePartialUpdateRequestData.MessagePartialUpdateRequest pinMessage​(@NotNull
                                                                                                     java.lang.String id,
                                                                                                     @NotNull
                                                                                                     java.lang.String userId)
        Creates a pin message request without expiration. It invokes message partial update under the hood.
        Parameters:
        id - the message id
        userId - id of the user who pins the message
        Returns:
        the created request
      • pinMessage

        @NotNull
        public static Message.MessagePartialUpdateRequestData.MessagePartialUpdateRequest pinMessage​(@NotNull
                                                                                                     java.lang.String id,
                                                                                                     @NotNull
                                                                                                     java.lang.String userId,
                                                                                                     @NotNull
                                                                                                     java.util.Date expiration)
        Creates a pin message request with expiration. It invokes message partial update under the hood.
        Parameters:
        id - the message id
        userId - id of the user who pins the message
        expiration - expiration of the pin
        Returns:
        the created request
      • unpinMessage

        @NotNull
        public static Message.MessagePartialUpdateRequestData.MessagePartialUpdateRequest unpinMessage​(@NotNull
                                                                                                       java.lang.String id,
                                                                                                       @NotNull
                                                                                                       java.lang.String userId)
        Creates an unpin message request. It invokes message partial update under the hood.
        Parameters:
        id - the message id
        userId - id of the user who unpins the message
        Returns:
        the created request