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 @NotNull Message.MessageSendRequestData.MessageSendRequest send​(@NotNull
                                                                                      @NotNull java.lang.String channelType,
                                                                                      @NotNull
                                                                                      @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 @NotNull Message.MessageGetRequest get​(@NotNull
                                                             @NotNull java.lang.String id)
        Creates a get request
        Parameters:
        id - the message id
        Returns:
        the created request
      • delete

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

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

        @NotNull
        public static @NotNull Message.MessageDeleteRequest deleteForMe​(@NotNull
                                                                        @NotNull java.lang.String id,
                                                                        @NotNull
                                                                        @NotNull java.lang.String userId)
        Creates a delete for me request
        Parameters:
        id - the message id
        userId - the user id for whom the message should be deleted
        Returns:
        the created request
      • uploadFile

        @NotNull
        public static @NotNull Message.MessageUploadFileRequest uploadFile​(@NotNull
                                                                           @NotNull java.lang.String channelType,
                                                                           @NotNull
                                                                           @NotNull java.lang.String channelId,
                                                                           @NotNull
                                                                           @NotNull java.lang.String userId,
                                                                           @Nullable
                                                                           @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 @NotNull Message.MessageUploadImageRequest uploadImage​(@NotNull
                                                                             @NotNull java.lang.String channelType,
                                                                             @NotNull
                                                                             @NotNull java.lang.String channelId,
                                                                             @NotNull
                                                                             @NotNull java.lang.String userId,
                                                                             @NotNull
                                                                             @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 @NotNull Message.MessageDeleteFileRequest deleteFile​(@NotNull
                                                                           @NotNull java.lang.String channelType,
                                                                           @NotNull
                                                                           @NotNull java.lang.String channelId,
                                                                           @NotNull
                                                                           @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 @NotNull Message.MessageDeleteImageRequest deleteImage​(@NotNull
                                                                             @NotNull java.lang.String channelType,
                                                                             @NotNull
                                                                             @NotNull java.lang.String channelId,
                                                                             @NotNull
                                                                             @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 @NotNull Message.MessageGetManyRequest getMany​(@NotNull
                                                                     @NotNull java.lang.String channelType,
                                                                     @NotNull
                                                                     @NotNull java.lang.String channelId,
                                                                     @NotNull
                                                                     @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 @NotNull Message.MessageGetRepliesRequest getReplies​(@NotNull
                                                                           @NotNull java.lang.String parentMessageId)
        Creates a get replies request
        Parameters:
        parentMessageId - the parent message id
        Returns:
        the created request
      • commit

        @NotNull
        public static @NotNull Message.MessageCommitRequestData.MessageCommitRequest commit​(@NotNull
                                                                                            @NotNull java.lang.String messageId)
        Creates a commit message request
        Parameters:
        messageId - the pending message id to commit
        Returns:
        the created request
      • flag

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

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

        @NotNull
        public static @NotNull Message.MessagePartialUpdateRequestData.MessagePartialUpdateRequest pinMessage​(@NotNull
                                                                                                              @NotNull java.lang.String id,
                                                                                                              @NotNull
                                                                                                              @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 @NotNull Message.MessagePartialUpdateRequestData.MessagePartialUpdateRequest pinMessage​(@NotNull
                                                                                                              @NotNull java.lang.String id,
                                                                                                              @NotNull
                                                                                                              @NotNull java.lang.String userId,
                                                                                                              @NotNull
                                                                                                              @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 @NotNull Message.MessagePartialUpdateRequestData.MessagePartialUpdateRequest unpinMessage​(@NotNull
                                                                                                                @NotNull java.lang.String id,
                                                                                                                @NotNull
                                                                                                                @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