
com.symphony.api.pod.PresenceApi Maven / Gradle / Ivy
package com.symphony.api.pod;
import com.symphony.api.model.Error;
import com.symphony.api.model.Presence;
import com.symphony.api.model.StringId;
import com.symphony.api.model.SuccessResponse;
import com.symphony.api.model.V2Presence;
import com.symphony.api.model.V2PresenceList;
import com.symphony.api.model.V2PresenceStatus;
import com.symphony.api.model.V2UserPresence;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.List;
import java.util.Map;
import javax.ws.rs.*;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.MediaType;
import org.apache.cxf.jaxrs.ext.multipart.*;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.responses.ApiResponses;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.media.ArraySchema;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
/**
* Pod API
*
* This document refers to Symphony API calls that do not need encryption or decryption of content. - sessionToken can be obtained by calling the authenticationAPI on the symphony back end and the key manager respectively. Refer to the methods described in authenticatorAPI.yaml. - Actions are defined to be atomic, ie will succeed in their entirety or fail and have changed nothing. - If it returns a 40X status then it will have made no change to the system even if ome subset of the request would have succeeded. - If this contract cannot be met for any reason then this is an error and the response code will be 50X.
*
*/
@Path("/")
public interface PresenceApi {
/**
* Create Presence status feed.
*
* Create a new stream capturing presence status changes (\"presence feed\"). When read from, the feed will return the current presence status of company (pod) users if it has changed since the last read. Returns the ID of the presence feed to be used in subsequent read operations.
*
*/
@POST
@Path("/v1/presence/feed/create")
@Produces({ "application/json" })
@Operation(summary = "Create Presence status feed.", tags={ })
@ApiResponses(value = {
@ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = StringId.class))),
@ApiResponse(responseCode = "400", description = "Client error.", content = @Content(schema = @Schema(implementation = Error.class))),
@ApiResponse(responseCode = "401", description = "Unauthorized: Session tokens invalid.", content = @Content(schema = @Schema(implementation = Error.class))),
@ApiResponse(responseCode = "403", description = "Forbidden: Caller lacks necessary entitlement.", content = @Content(schema = @Schema(implementation = Error.class))),
@ApiResponse(responseCode = "500", description = "Server error, see response body for further details.", content = @Content(schema = @Schema(implementation = Error.class))) })
public StringId v1PresenceFeedCreatePost(@HeaderParam("sessionToken") String sessionToken);
/**
* Delete a presence status feed.
*
* Returns the ID of the deleted feed.
*
*/
@POST
@Path("/v1/presence/feed/{feedId}/delete")
@Produces({ "application/json" })
@Operation(summary = "Delete a presence status feed.", tags={ })
@ApiResponses(value = {
@ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = StringId.class))),
@ApiResponse(responseCode = "400", description = "Client error.", content = @Content(schema = @Schema(implementation = Error.class))),
@ApiResponse(responseCode = "401", description = "Unauthorized: Session tokens invalid.", content = @Content(schema = @Schema(implementation = Error.class))),
@ApiResponse(responseCode = "403", description = "Forbidden: Caller lacks necessary entitlement.", content = @Content(schema = @Schema(implementation = Error.class))),
@ApiResponse(responseCode = "500", description = "Server error, see response body for further details.", content = @Content(schema = @Schema(implementation = Error.class))) })
public StringId v1PresenceFeedFeedIdDeletePost(@HeaderParam("sessionToken") String sessionToken, @PathParam("feedId") String feedId);
/**
* Read a presence status feed.
*
* Returns the current presence status of company (pod) users if it has changed since the last read. Returns up to 500 records at a time.
*
*/
@GET
@Path("/v1/presence/feed/{feedId}/read")
@Produces({ "application/json" })
@Operation(summary = "Read a presence status feed.", tags={ })
@ApiResponses(value = {
@ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = V2PresenceList.class))),
@ApiResponse(responseCode = "400", description = "Client error.", content = @Content(schema = @Schema(implementation = Error.class))),
@ApiResponse(responseCode = "401", description = "Unauthorized: Session tokens invalid.", content = @Content(schema = @Schema(implementation = Error.class))),
@ApiResponse(responseCode = "403", description = "Forbidden: Caller lacks necessary entitlement.", content = @Content(schema = @Schema(implementation = Error.class))),
@ApiResponse(responseCode = "500", description = "Server error, see response body for further details.", content = @Content(schema = @Schema(implementation = Error.class))) })
public V2PresenceList v1PresenceFeedFeedIdReadGet(@HeaderParam("sessionToken") String sessionToken, @PathParam("feedId") String feedId);
/**
* Get presence information about the requesting user.
*
*/
@GET
@Path("/v1/user/presence")
@Produces({ "application/json" })
@Operation(summary = "Get presence information about the requesting user.", tags={ })
@ApiResponses(value = {
@ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = Presence.class))),
@ApiResponse(responseCode = "400", description = "Client error, see response body for further details.", content = @Content(schema = @Schema(implementation = Error.class))),
@ApiResponse(responseCode = "401", description = "Unauthorized: Invalid session token", content = @Content(schema = @Schema(implementation = Error.class))),
@ApiResponse(responseCode = "500", description = "Server error, see response body for further details.", content = @Content(schema = @Schema(implementation = Error.class))) })
public Presence v1UserPresenceGet(@HeaderParam("sessionToken") String sessionToken);
/**
* Set the presence of the requesting user.
*
*/
@POST
@Path("/v1/user/presence")
@Consumes({ "*/*" })
@Produces({ "application/json" })
@Operation(summary = "Set the presence of the requesting user.", tags={ })
@ApiResponses(value = {
@ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = Presence.class))),
@ApiResponse(responseCode = "400", description = "Client error.", content = @Content(schema = @Schema(implementation = Error.class))),
@ApiResponse(responseCode = "401", description = "Unauthorized: Invalid session token.", content = @Content(schema = @Schema(implementation = Error.class))),
@ApiResponse(responseCode = "500", description = "Server error, see response body for further details.", content = @Content(schema = @Schema(implementation = Error.class))) })
public Presence v1UserPresencePost(Presence body, @HeaderParam("sessionToken") String sessionToken);
/**
* Register interest in a user's presence status
*
*/
@POST
@Path("/v1/user/presence/register")
@Consumes({ "application/json" })
@Produces({ "application/json" })
@Operation(summary = "Register interest in a user's presence status", tags={ })
@ApiResponses(value = {
@ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = SuccessResponse.class))),
@ApiResponse(responseCode = "400", description = "Client error.", content = @Content(schema = @Schema(implementation = Error.class))),
@ApiResponse(responseCode = "401", description = "Unauthorized: Session tokens invalid.", content = @Content(schema = @Schema(implementation = Error.class))),
@ApiResponse(responseCode = "403", description = "Forbidden: Caller lacks necessary entitlement.", content = @Content(schema = @Schema(implementation = Error.class))),
@ApiResponse(responseCode = "404", description = "Not Found: user id cannot be located.", content = @Content(schema = @Schema(implementation = Error.class))),
@ApiResponse(responseCode = "500", description = "Server error, see response body for further details.", content = @Content(schema = @Schema(implementation = Error.class))) })
public SuccessResponse v1UserPresenceRegisterPost(List body, @HeaderParam("sessionToken") String sessionToken);
/**
* Get presence information about a particular user.
*
*/
@GET
@Path("/v1/user/{uid}/presence")
@Produces({ "application/json" })
@Operation(summary = "Get presence information about a particular user.", tags={ })
@ApiResponses(value = {
@ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = Presence.class))),
@ApiResponse(responseCode = "400", description = "Client error, see response body for further details.", content = @Content(schema = @Schema(implementation = Error.class))),
@ApiResponse(responseCode = "401", description = "Unauthorized: Session tokens invalid.", content = @Content(schema = @Schema(implementation = Error.class))),
@ApiResponse(responseCode = "403", description = "Forbidden: Caller lacks necessary entitlement.", content = @Content(schema = @Schema(implementation = Error.class))),
@ApiResponse(responseCode = "404", description = "Not Found: user id cannot be located.", content = @Content(schema = @Schema(implementation = Error.class))),
@ApiResponse(responseCode = "500", description = "Server error, see response body for further details.", content = @Content(schema = @Schema(implementation = Error.class))) })
public Presence v1UserUidPresenceGet(@PathParam("uid") Long uid, @HeaderParam("sessionToken") String sessionToken);
/**
* LIMITED RELEASE Set presence information for a particular user.
*
* Only the following states can be set AVAILABLE BUSY ON_THE_PHONE AWAY Attempts to set other states will result in a 403 FORBIDDEN response. The UNDEFINED value is an error case used to represent the case if the value stored in the system cannot be represented by the values known to the API. The other states are reserved for future use.
*
*/
@POST
@Path("/v1/user/{uid}/presence")
@Consumes({ "application/json" })
@Produces({ "application/json" })
@Operation(summary = "LIMITED RELEASE Set presence information for a particular user.", tags={ })
@ApiResponses(value = {
@ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = Presence.class))),
@ApiResponse(responseCode = "400", description = "Client error.", content = @Content(schema = @Schema(implementation = Error.class))),
@ApiResponse(responseCode = "401", description = "Unauthorized.", content = @Content(schema = @Schema(implementation = Error.class))),
@ApiResponse(responseCode = "403", description = "Forbidden.", content = @Content(schema = @Schema(implementation = Error.class))),
@ApiResponse(responseCode = "404", description = "Not Found: user id cannot be located.", content = @Content(schema = @Schema(implementation = Error.class))),
@ApiResponse(responseCode = "500", description = "Server error, see response body for further details.", content = @Content(schema = @Schema(implementation = Error.class))) })
public Presence v1UserUidPresencePost(Presence body, @HeaderParam("sessionToken") String sessionToken, @PathParam("uid") Long uid);
/**
* Get presence information about the requesting user.
*
*/
@GET
@Path("/v2/user/presence")
@Produces({ "application/json" })
@Operation(summary = "Get presence information about the requesting user.", tags={ })
@ApiResponses(value = {
@ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = V2Presence.class))),
@ApiResponse(responseCode = "400", description = "Client error, see response body for further details.", content = @Content(schema = @Schema(implementation = Error.class))),
@ApiResponse(responseCode = "401", description = "Unauthorized: Invalid session token", content = @Content(schema = @Schema(implementation = Error.class))),
@ApiResponse(responseCode = "500", description = "Server error, see response body for further details.", content = @Content(schema = @Schema(implementation = Error.class))) })
public V2Presence v2UserPresenceGet(@HeaderParam("sessionToken") String sessionToken);
/**
* Set the presence of the requesting user.
*
*/
@POST
@Path("/v2/user/presence")
@Consumes({ "application/json" })
@Produces({ "application/json" })
@Operation(summary = "Set the presence of the requesting user.", tags={ })
@ApiResponses(value = {
@ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = V2Presence.class))),
@ApiResponse(responseCode = "400", description = "Client error.", content = @Content(schema = @Schema(implementation = Error.class))),
@ApiResponse(responseCode = "401", description = "Unauthorized: Invalid session token.", content = @Content(schema = @Schema(implementation = Error.class))),
@ApiResponse(responseCode = "500", description = "Server error, see response body for further details.", content = @Content(schema = @Schema(implementation = Error.class))) })
public V2Presence v2UserPresencePost(V2PresenceStatus body, @HeaderParam("sessionToken") String sessionToken, @QueryParam("soft")Boolean soft);
/**
* Get presence information about a particular user.
*
*/
@GET
@Path("/v2/user/{uid}/presence")
@Produces({ "application/json" })
@Operation(summary = "Get presence information about a particular user.", tags={ })
@ApiResponses(value = {
@ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = Presence.class))),
@ApiResponse(responseCode = "400", description = "Client error, see response body for further details.", content = @Content(schema = @Schema(implementation = Error.class))),
@ApiResponse(responseCode = "401", description = "Unauthorized: Session tokens invalid.", content = @Content(schema = @Schema(implementation = Error.class))),
@ApiResponse(responseCode = "403", description = "Forbidden: Caller lacks necessary entitlement.", content = @Content(schema = @Schema(implementation = Error.class))),
@ApiResponse(responseCode = "404", description = "Not Found: user id cannot be located.", content = @Content(schema = @Schema(implementation = Error.class))),
@ApiResponse(responseCode = "500", description = "Server error, see response body for further details.", content = @Content(schema = @Schema(implementation = Error.class))) })
public Presence v2UserUidPresenceGet(@PathParam("uid") Long uid, @HeaderParam("sessionToken") String sessionToken, @QueryParam("local")@DefaultValue("false") Boolean local);
/**
* Get presence information about all company (pod) users.
*
* The returned data is taken from the in-memory cache for performance reasons which means inactive users may be omitted from the response. All non-inactive users WILL be returned and some inactive users MAY be included. Any omitted user IS inactive. Returned records are sorted by user ID, ascending. This method is expensive. It pulls ALL records from the cache, sorts them and then only uses a subset. For large numbers of users, this can be very inefficient both due to sorting and due to the cache being distributed across many nodes. Addiionally, there is the potential to miss users if they become active after the page in which their user ID falls has already been read by the client. To avoid this situation, a presence feed should be created (and optionally read from) first to capture presence changes of users who get reactivated during a paged call to this endpoint.
*
*/
@GET
@Path("/v2/users/presence")
@Produces({ "application/json" })
@Operation(summary = "Get presence information about all company (pod) users.", tags={ })
@ApiResponses(value = {
@ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = V2PresenceList.class))),
@ApiResponse(responseCode = "400", description = "Client error.", content = @Content(schema = @Schema(implementation = Error.class))),
@ApiResponse(responseCode = "401", description = "Unauthorized: Session tokens invalid.", content = @Content(schema = @Schema(implementation = Error.class))),
@ApiResponse(responseCode = "403", description = "Forbidden: Caller lacks necessary entitlement.", content = @Content(schema = @Schema(implementation = Error.class))),
@ApiResponse(responseCode = "500", description = "Server error, see response body for further details.", content = @Content(schema = @Schema(implementation = Error.class))) })
public V2PresenceList v2UsersPresenceGet(@HeaderParam("sessionToken") String sessionToken, @QueryParam("lastUserId")Long lastUserId, @QueryParam("limit")Integer limit);
/**
* Set presence information for a particular user.
*
*/
@POST
@Path("/v3/user/presence")
@Consumes({ "*/*" })
@Produces({ "application/json" })
@Operation(summary = "Set presence information for a particular user.", tags={ })
@ApiResponses(value = {
@ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = V2Presence.class))),
@ApiResponse(responseCode = "400", description = "Client error.", content = @Content(schema = @Schema(implementation = Error.class))),
@ApiResponse(responseCode = "401", description = "Unauthorized.", content = @Content(schema = @Schema(implementation = Error.class))),
@ApiResponse(responseCode = "403", description = "Forbidden.", content = @Content(schema = @Schema(implementation = Error.class))),
@ApiResponse(responseCode = "404", description = "Not Found: user id cannot be located.", content = @Content(schema = @Schema(implementation = Error.class))),
@ApiResponse(responseCode = "500", description = "Server error, see response body for further details.", content = @Content(schema = @Schema(implementation = Error.class))) })
public V2Presence v3UserPresencePost(V2UserPresence body, @HeaderParam("sessionToken") String sessionToken, @QueryParam("soft")Boolean soft);
/**
* Get presence information about a particular user.
*
*/
@GET
@Path("/v3/user/{uid}/presence")
@Produces({ "application/json" })
@Operation(summary = "Get presence information about a particular user.", tags={ })
@ApiResponses(value = {
@ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = V2Presence.class))),
@ApiResponse(responseCode = "400", description = "Client error, see response body for further details.", content = @Content(schema = @Schema(implementation = Error.class))),
@ApiResponse(responseCode = "401", description = "Unauthorized: Session tokens invalid.", content = @Content(schema = @Schema(implementation = Error.class))),
@ApiResponse(responseCode = "403", description = "Forbidden: Caller lacks necessary entitlement.", content = @Content(schema = @Schema(implementation = Error.class))),
@ApiResponse(responseCode = "404", description = "Not Found: user id cannot be located.", content = @Content(schema = @Schema(implementation = Error.class))),
@ApiResponse(responseCode = "500", description = "Server error, see response body for further details.", content = @Content(schema = @Schema(implementation = Error.class))) })
public V2Presence v3UserUidPresenceGet(@PathParam("uid") Long uid, @HeaderParam("sessionToken") String sessionToken, @QueryParam("local")@DefaultValue("false") Boolean local);
}