com.liveperson.api.MessagingConsumer Maven / Gradle / Ivy
/**
* The MIT License
* Copyright (c) 2018 LivePerson, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package com.liveperson.api;
import com.fasterxml.jackson.databind.JsonNode;
import com.liveperson.api.infra.ServiceName;
import com.liveperson.api.infra.ws.WebsocketService;
import com.liveperson.api.infra.ws.annotations.WebsocketNotification;
import com.liveperson.api.infra.ws.annotations.WebsocketPath;
import com.liveperson.api.infra.ws.annotations.WebsocketReq;
import com.liveperson.api.infra.ws.annotations.WebsocketSingleNotification;
import retrofit2.http.Header;
import java.util.Map;
import java.util.concurrent.CompletableFuture;
import java.util.function.Consumer;
import java.util.function.Predicate;
@ServiceName("asyncMessagingEnt")
@WebsocketPath("{protocol}://{domain}/ws_api/account/{account}/messaging/consumer?v=3")
public interface MessagingConsumer {
@WebsocketReq("GetClock")
CompletableFuture getClock();
@WebsocketReq("cm.ConsumerRequestConversation")
CompletableFuture consumerRequestConversation();
@WebsocketReq("InitConnection")
CompletableFuture initConnection(
@Header(".ams.headers.ConsumerAuthentication") Map jwtHeader);
@WebsocketReq("cm.UpdateConversationField")
CompletableFuture updateConversationField(Map body);
@WebsocketReq("ms.PublishEvent")
CompletableFuture publishEvent(Map body);
@WebsocketReq("ms.SubscribeMessagingEvents")
CompletableFuture subscribeMessagingEvents(Map body);
@WebsocketReq("cqm.SubscribeExConversations")
CompletableFuture subscribeExConversationEvents(Map body);
@WebsocketReq("cqm.UnsubscribeExConversations")
CompletableFuture unsubscribeExConversationEvents(Map body);
@WebsocketNotification("ms.MessagingEventNotification")
Predicate onMessagingEventNotification(Consumer cb);
@WebsocketSingleNotification("ms.MessagingEventNotification")
WebsocketService.ListenerBuilder onNextMessagingEventNotification();
@WebsocketSingleNotification("cqm.ExConversationChangeNotification")
WebsocketService.ListenerBuilder onNextExConversationChangeNotification();
@WebsocketSingleNotification("cqm.SubscribeExConversationsResponse")
WebsocketService.ListenerBuilder onNextExConversationResponse();
@WebsocketNotification("cqm.ExConversationChangeNotification")
Predicate onExConversationChangeNotification(Consumer cb);
}