Update Channel Invite
Updates the status of a channel invite (e.g., accept or reject) based on the specified request parameters. This function allows users to change the status of a received channel invite.
Steps to update a channel invite
- Create an UpdateChannelInviteRequest object using the builder pattern.
- Call the
updateChannelInvite()
function using an instance ofLMChatClient
, passing therequest
object and an optional response handler. - Process the response LMResponse<NoData> to handle the success or failure of the update operation.
let request = UpdateChannelInviteRequest.builder()
.channelId("12345")
.inviteStatus(.accepted)
.build()
LMChatClient.shared.updateChannelInvite(request: request) { response in
switch response {
case .success(_):
print("Channel invite status updated successfully.")
case .failure(let error):
print("Error updating channel invite: \(error.localizedDescription)")
}
}
Models
UpdateChannelInviteRequest
A request object for updating a channel invite in the LikeMinds Chat SDK. It provides a builder pattern for constructing instances with customizable parameters.
VARIABLE | TYPE | DESCRIPTION | OPTIONAL |
---|---|---|---|
channelId | String | The unique identifier of the channel | |
inviteStatus | ChannelInviteStatus | The desired invite status (e.g., accept or reject) |
ChannelInviteStatus
Represents the status of a channel invite.
STATUS | VALUE | DESCRIPTION |
---|---|---|
invited | 0 | The invite is pending |
accepted | 1 | The invite has been accepted |
rejected | 2 | The invite has been rejected |