Package io.getstream.chat.java.models
Class Message
- java.lang.Object
-
- io.getstream.chat.java.models.Message
-
- Direct Known Subclasses:
Message.SearchResultMessage
public class Message extends java.lang.Object
-
-
Nested Class Summary
-
Field Summary
Fields Modifier and Type Field Description static java.lang.Class<? extends FileHandler>
fileHandlerClass
-
Constructor Summary
Constructors Constructor Description Message()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static @NotNull Message.MessageCommitRequestData.MessageCommitRequest
commit(@NotNull java.lang.String messageId)
Creates a commit message requeststatic @NotNull Message.MessageDeleteRequest
delete(@NotNull java.lang.String id)
Creates an delete requeststatic @NotNull Message.MessageDeleteFileRequest
deleteFile(@NotNull java.lang.String channelType, @NotNull java.lang.String channelId, @NotNull java.lang.String url)
Creates a delete file requeststatic @NotNull Message.MessageDeleteRequest
deleteForMe(@NotNull java.lang.String id, @NotNull java.lang.String userId)
Creates a delete for me requeststatic @NotNull Message.MessageDeleteImageRequest
deleteImage(@NotNull java.lang.String channelType, @NotNull java.lang.String channelId, @NotNull java.lang.String url)
Creates a delete image requeststatic @NotNull Flag.FlagCreateRequestData.FlagCreateRequest
flag(@NotNull java.lang.String messageId)
Creates a flag requeststatic @NotNull Message.MessageGetRequest
get(@NotNull java.lang.String id)
Creates a get requestjava.util.Map<java.lang.String,java.lang.Object>
getAdditionalFields()
static @NotNull 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 requeststatic @NotNull Message.MessageGetRepliesRequest
getReplies(@NotNull java.lang.String parentMessageId)
Creates a get replies requeststatic @NotNull Message.MessageDeleteRequest
hardDelete(@NotNull java.lang.String id)
Creates a hard delete requeststatic @NotNull Message.MessagePartialUpdateRequestData.MessagePartialUpdateRequest
partialUpdate(@NotNull java.lang.String id)
Creates a partial update requeststatic @NotNull Message.MessagePartialUpdateRequestData.MessagePartialUpdateRequest
pinMessage(@NotNull java.lang.String id, @NotNull java.lang.String userId)
Creates a pin message request without expiration.static @NotNull 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.static @NotNull Flag.FlagMessageQueryRequestData.FlagMessageQueryRequest
queryFlags()
Creates a query flag requeststatic @NotNull Message.MessageRunCommandActionRequestData.MessageRunCommandActionRequest
runCommandAction(@NotNull java.lang.String messageId)
Creates a run command action requeststatic @NotNull Message.MessageSearchRequestData.MessageSearchRequest
search()
Creates a search requeststatic @NotNull Message.MessageSendRequestData.MessageSendRequest
send(@NotNull java.lang.String channelType, @NotNull java.lang.String channelId)
Creates send requestvoid
setAdditionalField(java.lang.String name, java.lang.Object value)
static @NotNull Message.MessageTranslateRequestData.MessageTranslateRequest
translate(@NotNull java.lang.String messageId)
Creates a translate requeststatic @NotNull Message.MessageUnblockRequestData.MessageUnblockRequest
unblock(@NotNull java.lang.String messageId)
Creates an unblock message requeststatic @NotNull Flag.FlagDeleteRequestData.FlagDeleteRequest
unflag(@NotNull java.lang.String messageId)
Creates a unflag requeststatic @NotNull Message.MessagePartialUpdateRequestData.MessagePartialUpdateRequest
unpinMessage(@NotNull java.lang.String id, @NotNull java.lang.String userId)
Creates an unpin message request.static @NotNull Message.MessageUpdateRequestData.MessageUpdateRequest
update(@NotNull java.lang.String id)
Creates an update requeststatic @NotNull 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 requeststatic @NotNull 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
-
-
-
Field Detail
-
fileHandlerClass
public static java.lang.Class<? extends FileHandler> fileHandlerClass
-
-
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 typechannelId
- 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
-
update
@NotNull public static @NotNull Message.MessageUpdateRequestData.MessageUpdateRequest update(@NotNull @NotNull java.lang.String id)
Creates an update 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 iduserId
- the user id for whom the message should be deleted- Returns:
- the created request
-
search
@NotNull public static @NotNull Message.MessageSearchRequestData.MessageSearchRequest search()
Creates a search request- 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 typechannelId
- the channel iduserId
- the id of the user sending this filecontentType
- 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 typechannelId
- the channel iduserId
- the id of the user sending this imagecontentType
- 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 typechannelId
- the channel idurl
- 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 typechannelId
- the channel idurl
- 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 typechannelId
- the channel idmessageIds
- 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
-
runCommandAction
@NotNull public static @NotNull Message.MessageRunCommandActionRequestData.MessageRunCommandActionRequest runCommandAction(@NotNull @NotNull java.lang.String messageId)
Creates a run command action request- Parameters:
messageId
- the message id- Returns:
- the created request
-
translate
@NotNull public static @NotNull Message.MessageTranslateRequestData.MessageTranslateRequest translate(@NotNull @NotNull java.lang.String messageId)
Creates a translate request- Parameters:
messageId
- the 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
-
queryFlags
@NotNull public static @NotNull Flag.FlagMessageQueryRequestData.FlagMessageQueryRequest queryFlags()
Creates a query flag request- Returns:
- the created request
-
partialUpdate
@NotNull public static @NotNull Message.MessagePartialUpdateRequestData.MessagePartialUpdateRequest partialUpdate(@NotNull @NotNull java.lang.String id)
Creates a partial update request- Parameters:
id
- the message id- 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 iduserId
- 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 iduserId
- id of the user who pins the messageexpiration
- 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 iduserId
- id of the user who unpins the message- Returns:
- the created request
-
unblock
@NotNull public static @NotNull Message.MessageUnblockRequestData.MessageUnblockRequest unblock(@NotNull @NotNull java.lang.String messageId)
Creates an unblock message request- Parameters:
messageId
- the message id to unblock- Returns:
- the created request
-
-